mirror of https://github.com/vernonkeenan/lib
parent
175a16a96a
commit
d2abc5e075
|
|
@ -0,0 +1,236 @@
|
||||||
|
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/document_parameters"
|
||||||
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||||
|
openapiruntime "github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
var documentParameterTestAuth = openapiruntime.ClientAuthInfoWriterFunc(
|
||||||
|
func(openapiruntime.ClientRequest, strfmt.Registry) error { return nil },
|
||||||
|
)
|
||||||
|
|
||||||
|
type documentParameterCaptureTransport struct {
|
||||||
|
operation *openapiruntime.ClientOperation
|
||||||
|
}
|
||||||
|
|
||||||
|
func (transport *documentParameterCaptureTransport) Submit(
|
||||||
|
operation *openapiruntime.ClientOperation,
|
||||||
|
) (any, error) {
|
||||||
|
return transport.SubmitContext(context.Background(), operation)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (transport *documentParameterCaptureTransport) SubmitContext(
|
||||||
|
_ context.Context,
|
||||||
|
operation *openapiruntime.ClientOperation,
|
||||||
|
) (any, error) {
|
||||||
|
transport.operation = operation
|
||||||
|
switch operation.ID {
|
||||||
|
case "getDocumentParameters":
|
||||||
|
return document_parameters.NewGetDocumentParametersOK(), nil
|
||||||
|
case "postDocumentParameters":
|
||||||
|
return document_parameters.NewPostDocumentParametersOK(), nil
|
||||||
|
case "putDocumentParameters":
|
||||||
|
return document_parameters.NewPutDocumentParametersOK(), nil
|
||||||
|
default:
|
||||||
|
panic("unexpected generated DocumentParameter operation: " + operation.ID)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGeneratedDocumentParameterOperationContract(t *testing.T) {
|
||||||
|
type operationCall func(openapiruntime.ContextualTransport) error
|
||||||
|
tests := []struct {
|
||||||
|
name, wantID, wantMethod string
|
||||||
|
call operationCall
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "list or get", wantID: "getDocumentParameters", wantMethod: "GET",
|
||||||
|
call: func(transport openapiruntime.ContextualTransport) error {
|
||||||
|
_, err := document_parameters.New(transport, strfmt.Default).
|
||||||
|
GetDocumentParameters(
|
||||||
|
document_parameters.NewGetDocumentParametersParams(),
|
||||||
|
documentParameterTestAuth,
|
||||||
|
)
|
||||||
|
return err
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "create", wantID: "postDocumentParameters", wantMethod: "POST",
|
||||||
|
call: func(transport openapiruntime.ContextualTransport) error {
|
||||||
|
_, err := document_parameters.New(transport, strfmt.Default).
|
||||||
|
PostDocumentParameters(
|
||||||
|
document_parameters.NewPostDocumentParametersParams(),
|
||||||
|
documentParameterTestAuth,
|
||||||
|
)
|
||||||
|
return err
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "CAS update", wantID: "putDocumentParameters", wantMethod: "PUT",
|
||||||
|
call: func(transport openapiruntime.ContextualTransport) error {
|
||||||
|
_, err := document_parameters.New(transport, strfmt.Default).
|
||||||
|
PutDocumentParameters(
|
||||||
|
document_parameters.NewPutDocumentParametersParams(),
|
||||||
|
documentParameterTestAuth,
|
||||||
|
)
|
||||||
|
return err
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, test := range tests {
|
||||||
|
t.Run(test.name, func(t *testing.T) {
|
||||||
|
transport := &documentParameterCaptureTransport{}
|
||||||
|
if err := test.call(transport); err != nil {
|
||||||
|
t.Fatalf("generated client operation failed: %v", err)
|
||||||
|
}
|
||||||
|
if transport.operation == nil {
|
||||||
|
t.Fatal("generated client did not submit an operation")
|
||||||
|
}
|
||||||
|
if transport.operation.ID != test.wantID ||
|
||||||
|
transport.operation.Method != test.wantMethod ||
|
||||||
|
transport.operation.PathPattern != "/documentparameters" {
|
||||||
|
t.Fatalf(
|
||||||
|
"operation = %s %s %s, want %s %s /documentparameters",
|
||||||
|
transport.operation.ID, transport.operation.Method,
|
||||||
|
transport.operation.PathPattern, test.wantID, test.wantMethod,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if transport.operation.AuthInfo == nil {
|
||||||
|
t.Fatal("generated operation discarded its compound auth writer")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestDocumentParameterSpecPreservesScopesPersonasAndCAS(t *testing.T) {
|
||||||
|
specText := readMembersLearningSpec(t)
|
||||||
|
pathBlock := learningSpecPathBlock(t, specText, "/documentparameters")
|
||||||
|
for _, forbidden := range []string{" delete:", " patch:"} {
|
||||||
|
if strings.Contains(pathBlock, forbidden) {
|
||||||
|
t.Errorf("/documentparameters exposes unsupported %s", strings.TrimSpace(forbidden))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
operations := map[string]struct{ id, scope string }{
|
||||||
|
"get": {id: "getDocumentParameters", scope: "members:document-parameter:read"},
|
||||||
|
"post": {id: "postDocumentParameters", scope: "members:document-parameter:create"},
|
||||||
|
"put": {id: "putDocumentParameters", scope: "members:document-parameter:update"},
|
||||||
|
}
|
||||||
|
const compoundSecurity = " security:\n - ApiKeyAuth: []\n kvSessionCookie: []"
|
||||||
|
for method, expected := range operations {
|
||||||
|
block := learningSpecOperationBlock(t, specText, "/documentparameters", method)
|
||||||
|
if !strings.Contains(block, " operationId: "+expected.id+"\n") {
|
||||||
|
t.Errorf("%s lost operationId %q", strings.ToUpper(method), expected.id)
|
||||||
|
}
|
||||||
|
if strings.Count(block, compoundSecurity) != 1 {
|
||||||
|
t.Errorf("%s does not preserve compound authentication", strings.ToUpper(method))
|
||||||
|
}
|
||||||
|
if !strings.Contains(block, expected.scope) {
|
||||||
|
t.Errorf("%s lost exact scope %q", strings.ToUpper(method), expected.scope)
|
||||||
|
}
|
||||||
|
if method != "get" &&
|
||||||
|
(!strings.Contains(block, "Owner") || !strings.Contains(block, "Manager")) {
|
||||||
|
t.Errorf("%s lost Owner/Manager mutation boundary", strings.ToUpper(method))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !document_parameters.NewPutDocumentParametersConflict().IsCode(409) {
|
||||||
|
t.Fatal("DocumentParameter update client lost stale-write conflict")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestDocumentParameterModelAndRequestAreBounded(t *testing.T) {
|
||||||
|
assertExactModelFields(t, members_models.DocumentParameter{}, map[string]string{
|
||||||
|
"CreatedByID": "*string", "CreatedDate": "*string", "DeletedDate": "*string",
|
||||||
|
"DocumentID": "*string", "ID": "string", "IsDeleted": "*bool",
|
||||||
|
"LastModifiedByID": "*string", "LastModifiedDate": "*string",
|
||||||
|
"Name": "*string", "TenantID": "*string", "UserID": "*string",
|
||||||
|
"Value": "*string",
|
||||||
|
})
|
||||||
|
request := &members_models.DocumentParameterRequest{}
|
||||||
|
if err := request.Validate(strfmt.Default); err == nil {
|
||||||
|
t.Fatal("generated request accepted an empty write batch")
|
||||||
|
}
|
||||||
|
request.Data = make([]*members_models.DocumentParameter, 101)
|
||||||
|
if err := request.Validate(strfmt.Default); err == nil {
|
||||||
|
t.Fatal("generated request accepted more than 100 records")
|
||||||
|
}
|
||||||
|
request.Data = []*members_models.DocumentParameter{{}}
|
||||||
|
if err := request.Validate(strfmt.Default); err != nil {
|
||||||
|
t.Fatalf("generated request rejected a bounded record: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestDocumentParameterSurfaceExposesNoDeleteOrFolderBypass(t *testing.T) {
|
||||||
|
contract := reflect.TypeOf((*document_parameters.ClientService)(nil)).Elem()
|
||||||
|
for index := 0; index < contract.NumMethod(); index++ {
|
||||||
|
method := contract.Method(index).Name
|
||||||
|
for _, forbidden := range []string{"Delete", "Folder", "Salesforce", "Cache"} {
|
||||||
|
if strings.Contains(method, forbidden) {
|
||||||
|
t.Errorf("DocumentParameter client exposes forbidden method %s", method)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
root := reflect.TypeOf(members_client.Members{})
|
||||||
|
if _, exists := root.FieldByName("DocumentParameters"); !exists {
|
||||||
|
t.Fatal("root Members client does not expose governed DocumentParameters")
|
||||||
|
}
|
||||||
|
if _, exists := root.FieldByName("Folders"); exists {
|
||||||
|
t.Fatal("root Members client published deferred Folder operations")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGeneratedDocumentParameterSurfaceHasNoExternalBypassOrSecrets(t *testing.T) {
|
||||||
|
repoRoot := learningRepoRoot(t)
|
||||||
|
targets := []string{
|
||||||
|
filepath.Join(repoRoot, "api", "members", "members_client", "document_parameters"),
|
||||||
|
filepath.Join(repoRoot, "api", "members", "members_models", "document_parameter.go"),
|
||||||
|
filepath.Join(repoRoot, "api", "members", "members_models", "document_parameter_request.go"),
|
||||||
|
filepath.Join(repoRoot, "api", "members", "members_models", "document_parameter_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", "soql", "apex", "sf-gate", "go-force",
|
||||||
|
"cache", "processor_token", "private key-----",
|
||||||
|
} {
|
||||||
|
if strings.Contains(lower, forbidden) {
|
||||||
|
t.Errorf("%s contains forbidden boundary %q", path, forbidden)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if credentialLiteral.Match(content) {
|
||||||
|
t.Errorf("%s contains a credential-like literal", path)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("inspect generated DocumentParameter surface: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,296 @@
|
||||||
|
// 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 document_parameters
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
httptransport "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// New creates a new document parameters API client.
|
||||||
|
func New(transport runtime.ContextualTransport, formats strfmt.Registry) ClientService {
|
||||||
|
return &Client{transport: transport, formats: formats}
|
||||||
|
}
|
||||||
|
|
||||||
|
// New creates a new document parameters API client with basic auth credentials.
|
||||||
|
//
|
||||||
|
// It takes the following parameters:
|
||||||
|
// - host: http host (github.com).
|
||||||
|
// - basePath: any base path for the API client ("/v1", "/v3").
|
||||||
|
// - scheme: http scheme ("http", "https").
|
||||||
|
// - user: user for basic authentication header.
|
||||||
|
// - password: password for basic authentication header.
|
||||||
|
func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService {
|
||||||
|
transport := httptransport.New(host, basePath, []string{scheme})
|
||||||
|
transport.DefaultAuthentication = httptransport.BasicAuth(user, password)
|
||||||
|
return &Client{transport: transport, formats: strfmt.Default}
|
||||||
|
}
|
||||||
|
|
||||||
|
// New creates a new document parameters API client with a bearer token for authentication.
|
||||||
|
//
|
||||||
|
// It takes the following parameters:
|
||||||
|
// - host: http host (github.com).
|
||||||
|
// - basePath: any base path for the API client ("/v1", "/v3").
|
||||||
|
// - scheme: http scheme ("http", "https").
|
||||||
|
// - bearerToken: bearer token for Bearer authentication header.
|
||||||
|
func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService {
|
||||||
|
transport := httptransport.New(host, basePath, []string{scheme})
|
||||||
|
transport.DefaultAuthentication = httptransport.BearerToken(bearerToken)
|
||||||
|
return &Client{transport: transport, formats: strfmt.Default}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Client for document parameters API.
|
||||||
|
type Client struct {
|
||||||
|
transport runtime.ContextualTransport
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ClientOption may be used to customize the behavior of Client methods.
|
||||||
|
type ClientOption func(*runtime.ClientOperation)
|
||||||
|
|
||||||
|
// ClientService is the interface for Client methods.
|
||||||
|
type ClientService interface {
|
||||||
|
|
||||||
|
// GetDocumentParameters get document parameters.
|
||||||
|
GetDocumentParameters(params *GetDocumentParametersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDocumentParametersOK, error)
|
||||||
|
|
||||||
|
// GetDocumentParametersContext get document parameters.
|
||||||
|
GetDocumentParametersContext(ctx context.Context, params *GetDocumentParametersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDocumentParametersOK, error)
|
||||||
|
|
||||||
|
// PostDocumentParameters create document parameters.
|
||||||
|
PostDocumentParameters(params *PostDocumentParametersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostDocumentParametersOK, error)
|
||||||
|
|
||||||
|
// PostDocumentParametersContext create document parameters.
|
||||||
|
PostDocumentParametersContext(ctx context.Context, params *PostDocumentParametersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostDocumentParametersOK, error)
|
||||||
|
|
||||||
|
// PutDocumentParameters update document parameters.
|
||||||
|
PutDocumentParameters(params *PutDocumentParametersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutDocumentParametersOK, error)
|
||||||
|
|
||||||
|
// PutDocumentParametersContext update document parameters.
|
||||||
|
PutDocumentParametersContext(ctx context.Context, params *PutDocumentParametersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutDocumentParametersOK, error)
|
||||||
|
|
||||||
|
SetTransport(transport runtime.ContextualTransport)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetDocumentParameters gets document parameters.
|
||||||
|
//
|
||||||
|
// Tenant- and user-scoped DocumentParameter read. Requires members:document-parameter:read and an active human session. Contributors can read only their own records; Owners and Managers can read the tenant..
|
||||||
|
//
|
||||||
|
// 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.GetDocumentParametersContext] instead.
|
||||||
|
func (a *Client) GetDocumentParameters(params *GetDocumentParametersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDocumentParametersOK, error) {
|
||||||
|
var ctx context.Context
|
||||||
|
if params.inner.ctx != nil {
|
||||||
|
ctx = params.inner.ctx
|
||||||
|
} else {
|
||||||
|
ctx = context.Background()
|
||||||
|
}
|
||||||
|
|
||||||
|
return a.GetDocumentParametersContext(ctx, params, authInfo, opts...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetDocumentParametersContext gets document parameters.
|
||||||
|
//
|
||||||
|
// Tenant- and user-scoped DocumentParameter read. Requires members:document-parameter:read and an active human session. Contributors can read only their own records; Owners and Managers can read the tenant..
|
||||||
|
//
|
||||||
|
// Do not use the deprecated [GetDocumentParametersParams.Context] with this method: it would be ignored.
|
||||||
|
func (a *Client) GetDocumentParametersContext(ctx context.Context, params *GetDocumentParametersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetDocumentParametersOK, error) {
|
||||||
|
// NOTE: parameters are not validated before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewGetDocumentParametersParams()
|
||||||
|
}
|
||||||
|
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "getDocumentParameters",
|
||||||
|
Method: "GET",
|
||||||
|
PathPattern: "/documentparameters",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json"},
|
||||||
|
Schemes: []string{"http"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &GetDocumentParametersReader{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.(*GetDocumentParametersOK)
|
||||||
|
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 getDocumentParameters: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
// PostDocumentParameters creates document parameters.
|
||||||
|
//
|
||||||
|
// Tenant-scoped DocumentParameter create. Requires members:document-parameter:create, an active human session, and Owner or Manager authority..
|
||||||
|
//
|
||||||
|
// 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.PostDocumentParametersContext] instead.
|
||||||
|
func (a *Client) PostDocumentParameters(params *PostDocumentParametersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostDocumentParametersOK, error) {
|
||||||
|
var ctx context.Context
|
||||||
|
if params.inner.ctx != nil {
|
||||||
|
ctx = params.inner.ctx
|
||||||
|
} else {
|
||||||
|
ctx = context.Background()
|
||||||
|
}
|
||||||
|
|
||||||
|
return a.PostDocumentParametersContext(ctx, params, authInfo, opts...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// PostDocumentParametersContext creates document parameters.
|
||||||
|
//
|
||||||
|
// Tenant-scoped DocumentParameter create. Requires members:document-parameter:create, an active human session, and Owner or Manager authority..
|
||||||
|
//
|
||||||
|
// Do not use the deprecated [PostDocumentParametersParams.Context] with this method: it would be ignored.
|
||||||
|
func (a *Client) PostDocumentParametersContext(ctx context.Context, params *PostDocumentParametersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostDocumentParametersOK, error) {
|
||||||
|
// NOTE: parameters are not validated before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewPostDocumentParametersParams()
|
||||||
|
}
|
||||||
|
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "postDocumentParameters",
|
||||||
|
Method: "POST",
|
||||||
|
PathPattern: "/documentparameters",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json"},
|
||||||
|
Schemes: []string{"http"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &PostDocumentParametersReader{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.(*PostDocumentParametersOK)
|
||||||
|
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 postDocumentParameters: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||||
|
panic(msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
// PutDocumentParameters updates document parameters.
|
||||||
|
//
|
||||||
|
// Tenant-scoped DocumentParameter CAS update. Requires members:document-parameter:update, an active human session, and Owner or Manager authority..
|
||||||
|
//
|
||||||
|
// 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.PutDocumentParametersContext] instead.
|
||||||
|
func (a *Client) PutDocumentParameters(params *PutDocumentParametersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutDocumentParametersOK, error) {
|
||||||
|
var ctx context.Context
|
||||||
|
if params.inner.ctx != nil {
|
||||||
|
ctx = params.inner.ctx
|
||||||
|
} else {
|
||||||
|
ctx = context.Background()
|
||||||
|
}
|
||||||
|
|
||||||
|
return a.PutDocumentParametersContext(ctx, params, authInfo, opts...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// PutDocumentParametersContext updates document parameters.
|
||||||
|
//
|
||||||
|
// Tenant-scoped DocumentParameter CAS update. Requires members:document-parameter:update, an active human session, and Owner or Manager authority..
|
||||||
|
//
|
||||||
|
// Do not use the deprecated [PutDocumentParametersParams.Context] with this method: it would be ignored.
|
||||||
|
func (a *Client) PutDocumentParametersContext(ctx context.Context, params *PutDocumentParametersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutDocumentParametersOK, error) {
|
||||||
|
// NOTE: parameters are not validated before sending
|
||||||
|
if params == nil {
|
||||||
|
params = NewPutDocumentParametersParams()
|
||||||
|
}
|
||||||
|
|
||||||
|
op := &runtime.ClientOperation{
|
||||||
|
ID: "putDocumentParameters",
|
||||||
|
Method: "PUT",
|
||||||
|
PathPattern: "/documentparameters",
|
||||||
|
ProducesMediaTypes: []string{"application/json"},
|
||||||
|
ConsumesMediaTypes: []string{"application/json"},
|
||||||
|
Schemes: []string{"http"},
|
||||||
|
Params: params,
|
||||||
|
Reader: &PutDocumentParametersReader{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.(*PutDocumentParametersOK)
|
||||||
|
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 putDocumentParameters: 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
|
||||||
|
func (a *Client) SetTransport(transport runtime.ContextualTransport) {
|
||||||
|
a.transport = transport
|
||||||
|
}
|
||||||
|
|
||||||
|
// innerParams captures internal fields so they don't conflict with user-supplied parameters.
|
||||||
|
type innerParams struct {
|
||||||
|
timeout time.Duration
|
||||||
|
|
||||||
|
// Deprecated: use the operation call with context to pass the context instead of [DocumentParametersParams].
|
||||||
|
ctx context.Context
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,241 @@
|
||||||
|
// 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 document_parameters
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
cr "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag/conv"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewGetDocumentParametersParams creates a new GetDocumentParametersParams 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 NewGetDocumentParametersParams() *GetDocumentParametersParams {
|
||||||
|
return NewGetDocumentParametersParamsWithTimeout(cr.DefaultTimeout)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetDocumentParametersParamsWithTimeout creates a new GetDocumentParametersParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewGetDocumentParametersParamsWithTimeout(timeout time.Duration) *GetDocumentParametersParams {
|
||||||
|
return &GetDocumentParametersParams{
|
||||||
|
inner: innerParams{
|
||||||
|
timeout: timeout,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetDocumentParametersParamsWithContext creates a new GetDocumentParametersParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
//
|
||||||
|
// Deprecated: use the operation call with context to pass the context instead of [GetDocumentParametersParams].
|
||||||
|
func NewGetDocumentParametersParamsWithContext(ctx context.Context) *GetDocumentParametersParams {
|
||||||
|
return &GetDocumentParametersParams{
|
||||||
|
inner: innerParams{
|
||||||
|
ctx: ctx,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetDocumentParametersParamsWithHTTPClient creates a new GetDocumentParametersParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewGetDocumentParametersParamsWithHTTPClient(client *http.Client) *GetDocumentParametersParams {
|
||||||
|
return &GetDocumentParametersParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GetDocumentParametersParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the get document parameters operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type GetDocumentParametersParams struct {
|
||||||
|
|
||||||
|
// ID.
|
||||||
|
//
|
||||||
|
// Unique Record ID
|
||||||
|
ID *string
|
||||||
|
|
||||||
|
// Limit.
|
||||||
|
//
|
||||||
|
// How many objects to return at one time
|
||||||
|
//
|
||||||
|
// Format: int64
|
||||||
|
Limit *int64
|
||||||
|
|
||||||
|
// Offset.
|
||||||
|
//
|
||||||
|
// How many objects to skip?
|
||||||
|
//
|
||||||
|
// Format: int64
|
||||||
|
Offset *int64
|
||||||
|
|
||||||
|
HTTPClient *http.Client
|
||||||
|
|
||||||
|
inner innerParams
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the get document parameters params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetDocumentParametersParams) WithDefaults() *GetDocumentParametersParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the get document parameters params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *GetDocumentParametersParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the get document parameters params.
|
||||||
|
func (o *GetDocumentParametersParams) WithTimeout(timeout time.Duration) *GetDocumentParametersParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the get document parameters params.
|
||||||
|
func (o *GetDocumentParametersParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.inner.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the get document parameters params.
|
||||||
|
//
|
||||||
|
// Deprecated: use the operation call with context to pass the context instead of [GetDocumentParametersParams].
|
||||||
|
func (o *GetDocumentParametersParams) WithContext(ctx context.Context) *GetDocumentParametersParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the get document parameters params.
|
||||||
|
//
|
||||||
|
// Deprecated: use the operation call with context to pass the context instead of [GetDocumentParametersParams].
|
||||||
|
func (o *GetDocumentParametersParams) SetContext(ctx context.Context) {
|
||||||
|
o.inner.ctx = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the get document parameters params.
|
||||||
|
func (o *GetDocumentParametersParams) WithHTTPClient(client *http.Client) *GetDocumentParametersParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the get document parameters params.
|
||||||
|
func (o *GetDocumentParametersParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithID adds the id to the get document parameters params.
|
||||||
|
func (o *GetDocumentParametersParams) WithID(id *string) *GetDocumentParametersParams {
|
||||||
|
o.SetID(id)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetID adds the id to the get document parameters params.
|
||||||
|
func (o *GetDocumentParametersParams) SetID(id *string) {
|
||||||
|
o.ID = id
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithLimit adds the limit to the get document parameters params.
|
||||||
|
func (o *GetDocumentParametersParams) WithLimit(limit *int64) *GetDocumentParametersParams {
|
||||||
|
o.SetLimit(limit)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetLimit adds the limit to the get document parameters params.
|
||||||
|
func (o *GetDocumentParametersParams) SetLimit(limit *int64) {
|
||||||
|
o.Limit = limit
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithOffset adds the offset to the get document parameters params.
|
||||||
|
func (o *GetDocumentParametersParams) WithOffset(offset *int64) *GetDocumentParametersParams {
|
||||||
|
o.SetOffset(offset)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetOffset adds the offset to the get document parameters params.
|
||||||
|
func (o *GetDocumentParametersParams) SetOffset(offset *int64) {
|
||||||
|
o.Offset = offset
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||||
|
func (o *GetDocumentParametersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if o.ID != nil {
|
||||||
|
|
||||||
|
// query param id
|
||||||
|
var qrID string
|
||||||
|
|
||||||
|
if o.ID != nil {
|
||||||
|
qrID = *o.ID
|
||||||
|
}
|
||||||
|
qID := qrID
|
||||||
|
if qID != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("id", qID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.Limit != nil {
|
||||||
|
|
||||||
|
// query param limit
|
||||||
|
var qrLimit int64
|
||||||
|
|
||||||
|
if o.Limit != nil {
|
||||||
|
qrLimit = *o.Limit
|
||||||
|
}
|
||||||
|
qLimit := conv.FormatInteger(qrLimit)
|
||||||
|
if qLimit != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.Offset != nil {
|
||||||
|
|
||||||
|
// query param offset
|
||||||
|
var qrOffset int64
|
||||||
|
|
||||||
|
if o.Offset != nil {
|
||||||
|
qrOffset = *o.Offset
|
||||||
|
}
|
||||||
|
qOffset := conv.FormatInteger(qrOffset)
|
||||||
|
if qOffset != "" {
|
||||||
|
|
||||||
|
if err := r.SetQueryParam("offset", qOffset); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,484 @@
|
||||||
|
// 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 document_parameters
|
||||||
|
|
||||||
|
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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetDocumentParametersReader is a Reader for the GetDocumentParameters structure.
|
||||||
|
type GetDocumentParametersReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *GetDocumentParametersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewGetDocumentParametersOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 401:
|
||||||
|
result := NewGetDocumentParametersUnauthorized()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 403:
|
||||||
|
result := NewGetDocumentParametersForbidden()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewGetDocumentParametersNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 422:
|
||||||
|
result := NewGetDocumentParametersUnprocessableEntity()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 500:
|
||||||
|
result := NewGetDocumentParametersInternalServerError()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[GET /documentparameters] getDocumentParameters", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetDocumentParametersOK creates a GetDocumentParametersOK with default headers values
|
||||||
|
func NewGetDocumentParametersOK() *GetDocumentParametersOK {
|
||||||
|
return &GetDocumentParametersOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetDocumentParametersOK describes a response with status code 200, with default header values.
|
||||||
|
//
|
||||||
|
// DocumentParameter Response Object
|
||||||
|
type GetDocumentParametersOK struct {
|
||||||
|
Payload *members_models.DocumentParameterResponse
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get document parameters o k response has a 2xx status code
|
||||||
|
func (o *GetDocumentParametersOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get document parameters o k response has a 3xx status code
|
||||||
|
func (o *GetDocumentParametersOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get document parameters o k response has a 4xx status code
|
||||||
|
func (o *GetDocumentParametersOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get document parameters o k response has a 5xx status code
|
||||||
|
func (o *GetDocumentParametersOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get document parameters o k response a status code equal to that given
|
||||||
|
func (o *GetDocumentParametersOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get document parameters o k response
|
||||||
|
func (o *GetDocumentParametersOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersOK) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /documentparameters][%d] getDocumentParametersOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersOK) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /documentparameters][%d] getDocumentParametersOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersOK) GetPayload() *members_models.DocumentParameterResponse {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
o.Payload = new(members_models.DocumentParameterResponse)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetDocumentParametersUnauthorized creates a GetDocumentParametersUnauthorized with default headers values
|
||||||
|
func NewGetDocumentParametersUnauthorized() *GetDocumentParametersUnauthorized {
|
||||||
|
return &GetDocumentParametersUnauthorized{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetDocumentParametersUnauthorized describes a response with status code 401, with default header values.
|
||||||
|
//
|
||||||
|
// Access Unauthorized, invalid API-KEY was used
|
||||||
|
type GetDocumentParametersUnauthorized struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get document parameters unauthorized response has a 2xx status code
|
||||||
|
func (o *GetDocumentParametersUnauthorized) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get document parameters unauthorized response has a 3xx status code
|
||||||
|
func (o *GetDocumentParametersUnauthorized) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get document parameters unauthorized response has a 4xx status code
|
||||||
|
func (o *GetDocumentParametersUnauthorized) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get document parameters unauthorized response has a 5xx status code
|
||||||
|
func (o *GetDocumentParametersUnauthorized) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get document parameters unauthorized response a status code equal to that given
|
||||||
|
func (o *GetDocumentParametersUnauthorized) IsCode(code int) bool {
|
||||||
|
return code == 401
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get document parameters unauthorized response
|
||||||
|
func (o *GetDocumentParametersUnauthorized) Code() int {
|
||||||
|
return 401
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersUnauthorized) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /documentparameters][%d] getDocumentParametersUnauthorized %s", 401, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersUnauthorized) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /documentparameters][%d] getDocumentParametersUnauthorized %s", 401, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersUnauthorized) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersUnauthorized) 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
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetDocumentParametersForbidden creates a GetDocumentParametersForbidden with default headers values
|
||||||
|
func NewGetDocumentParametersForbidden() *GetDocumentParametersForbidden {
|
||||||
|
return &GetDocumentParametersForbidden{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetDocumentParametersForbidden describes a response with status code 403, with default header values.
|
||||||
|
//
|
||||||
|
// Access forbidden, account lacks access
|
||||||
|
type GetDocumentParametersForbidden struct {
|
||||||
|
AccessControlAllowOrigin string
|
||||||
|
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get document parameters forbidden response has a 2xx status code
|
||||||
|
func (o *GetDocumentParametersForbidden) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get document parameters forbidden response has a 3xx status code
|
||||||
|
func (o *GetDocumentParametersForbidden) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get document parameters forbidden response has a 4xx status code
|
||||||
|
func (o *GetDocumentParametersForbidden) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get document parameters forbidden response has a 5xx status code
|
||||||
|
func (o *GetDocumentParametersForbidden) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get document parameters forbidden response a status code equal to that given
|
||||||
|
func (o *GetDocumentParametersForbidden) IsCode(code int) bool {
|
||||||
|
return code == 403
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get document parameters forbidden response
|
||||||
|
func (o *GetDocumentParametersForbidden) Code() int {
|
||||||
|
return 403
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersForbidden) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /documentparameters][%d] getDocumentParametersForbidden %s", 403, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersForbidden) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /documentparameters][%d] getDocumentParametersForbidden %s", 403, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersForbidden) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersForbidden) 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
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetDocumentParametersNotFound creates a GetDocumentParametersNotFound with default headers values
|
||||||
|
func NewGetDocumentParametersNotFound() *GetDocumentParametersNotFound {
|
||||||
|
return &GetDocumentParametersNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetDocumentParametersNotFound describes a response with status code 404, with default header values.
|
||||||
|
//
|
||||||
|
// Resource was not found
|
||||||
|
type GetDocumentParametersNotFound struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get document parameters not found response has a 2xx status code
|
||||||
|
func (o *GetDocumentParametersNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get document parameters not found response has a 3xx status code
|
||||||
|
func (o *GetDocumentParametersNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get document parameters not found response has a 4xx status code
|
||||||
|
func (o *GetDocumentParametersNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get document parameters not found response has a 5xx status code
|
||||||
|
func (o *GetDocumentParametersNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get document parameters not found response a status code equal to that given
|
||||||
|
func (o *GetDocumentParametersNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get document parameters not found response
|
||||||
|
func (o *GetDocumentParametersNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersNotFound) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /documentparameters][%d] getDocumentParametersNotFound %s", 404, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersNotFound) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /documentparameters][%d] getDocumentParametersNotFound %s", 404, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersNotFound) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersNotFound) 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
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetDocumentParametersUnprocessableEntity creates a GetDocumentParametersUnprocessableEntity with default headers values
|
||||||
|
func NewGetDocumentParametersUnprocessableEntity() *GetDocumentParametersUnprocessableEntity {
|
||||||
|
return &GetDocumentParametersUnprocessableEntity{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetDocumentParametersUnprocessableEntity describes a response with status code 422, with default header values.
|
||||||
|
//
|
||||||
|
// Unprocessable Entity, likely a bad parameter
|
||||||
|
type GetDocumentParametersUnprocessableEntity struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get document parameters unprocessable entity response has a 2xx status code
|
||||||
|
func (o *GetDocumentParametersUnprocessableEntity) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get document parameters unprocessable entity response has a 3xx status code
|
||||||
|
func (o *GetDocumentParametersUnprocessableEntity) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get document parameters unprocessable entity response has a 4xx status code
|
||||||
|
func (o *GetDocumentParametersUnprocessableEntity) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get document parameters unprocessable entity response has a 5xx status code
|
||||||
|
func (o *GetDocumentParametersUnprocessableEntity) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get document parameters unprocessable entity response a status code equal to that given
|
||||||
|
func (o *GetDocumentParametersUnprocessableEntity) IsCode(code int) bool {
|
||||||
|
return code == 422
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get document parameters unprocessable entity response
|
||||||
|
func (o *GetDocumentParametersUnprocessableEntity) Code() int {
|
||||||
|
return 422
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersUnprocessableEntity) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /documentparameters][%d] getDocumentParametersUnprocessableEntity %s", 422, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersUnprocessableEntity) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /documentparameters][%d] getDocumentParametersUnprocessableEntity %s", 422, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersUnprocessableEntity) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersUnprocessableEntity) 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
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetDocumentParametersInternalServerError creates a GetDocumentParametersInternalServerError with default headers values
|
||||||
|
func NewGetDocumentParametersInternalServerError() *GetDocumentParametersInternalServerError {
|
||||||
|
return &GetDocumentParametersInternalServerError{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetDocumentParametersInternalServerError describes a response with status code 500, with default header values.
|
||||||
|
//
|
||||||
|
// Server Internal Error
|
||||||
|
type GetDocumentParametersInternalServerError struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this get document parameters internal server error response has a 2xx status code
|
||||||
|
func (o *GetDocumentParametersInternalServerError) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this get document parameters internal server error response has a 3xx status code
|
||||||
|
func (o *GetDocumentParametersInternalServerError) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this get document parameters internal server error response has a 4xx status code
|
||||||
|
func (o *GetDocumentParametersInternalServerError) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this get document parameters internal server error response has a 5xx status code
|
||||||
|
func (o *GetDocumentParametersInternalServerError) IsServerError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this get document parameters internal server error response a status code equal to that given
|
||||||
|
func (o *GetDocumentParametersInternalServerError) IsCode(code int) bool {
|
||||||
|
return code == 500
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the get document parameters internal server error response
|
||||||
|
func (o *GetDocumentParametersInternalServerError) Code() int {
|
||||||
|
return 500
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersInternalServerError) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /documentparameters][%d] getDocumentParametersInternalServerError %s", 500, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersInternalServerError) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[GET /documentparameters][%d] getDocumentParametersInternalServerError %s", 500, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersInternalServerError) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetDocumentParametersInternalServerError) 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
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,159 @@
|
||||||
|
// 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 document_parameters
|
||||||
|
|
||||||
|
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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewPostDocumentParametersParams creates a new PostDocumentParametersParams 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 NewPostDocumentParametersParams() *PostDocumentParametersParams {
|
||||||
|
return NewPostDocumentParametersParamsWithTimeout(cr.DefaultTimeout)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPostDocumentParametersParamsWithTimeout creates a new PostDocumentParametersParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewPostDocumentParametersParamsWithTimeout(timeout time.Duration) *PostDocumentParametersParams {
|
||||||
|
return &PostDocumentParametersParams{
|
||||||
|
inner: innerParams{
|
||||||
|
timeout: timeout,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPostDocumentParametersParamsWithContext creates a new PostDocumentParametersParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
//
|
||||||
|
// Deprecated: use the operation call with context to pass the context instead of [PostDocumentParametersParams].
|
||||||
|
func NewPostDocumentParametersParamsWithContext(ctx context.Context) *PostDocumentParametersParams {
|
||||||
|
return &PostDocumentParametersParams{
|
||||||
|
inner: innerParams{
|
||||||
|
ctx: ctx,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPostDocumentParametersParamsWithHTTPClient creates a new PostDocumentParametersParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewPostDocumentParametersParamsWithHTTPClient(client *http.Client) *PostDocumentParametersParams {
|
||||||
|
return &PostDocumentParametersParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
PostDocumentParametersParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the post document parameters operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type PostDocumentParametersParams struct {
|
||||||
|
|
||||||
|
// DocumentParameterRequest.
|
||||||
|
//
|
||||||
|
// An array of DocumentParameter records
|
||||||
|
DocumentParameterRequest *members_models.DocumentParameterRequest
|
||||||
|
|
||||||
|
HTTPClient *http.Client
|
||||||
|
|
||||||
|
inner innerParams
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the post document parameters params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *PostDocumentParametersParams) WithDefaults() *PostDocumentParametersParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the post document parameters params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *PostDocumentParametersParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the post document parameters params.
|
||||||
|
func (o *PostDocumentParametersParams) WithTimeout(timeout time.Duration) *PostDocumentParametersParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the post document parameters params.
|
||||||
|
func (o *PostDocumentParametersParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.inner.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the post document parameters params.
|
||||||
|
//
|
||||||
|
// Deprecated: use the operation call with context to pass the context instead of [PostDocumentParametersParams].
|
||||||
|
func (o *PostDocumentParametersParams) WithContext(ctx context.Context) *PostDocumentParametersParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the post document parameters params.
|
||||||
|
//
|
||||||
|
// Deprecated: use the operation call with context to pass the context instead of [PostDocumentParametersParams].
|
||||||
|
func (o *PostDocumentParametersParams) SetContext(ctx context.Context) {
|
||||||
|
o.inner.ctx = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the post document parameters params.
|
||||||
|
func (o *PostDocumentParametersParams) WithHTTPClient(client *http.Client) *PostDocumentParametersParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the post document parameters params.
|
||||||
|
func (o *PostDocumentParametersParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDocumentParameterRequest adds the documentParameterRequest to the post document parameters params.
|
||||||
|
func (o *PostDocumentParametersParams) WithDocumentParameterRequest(documentParameterRequest *members_models.DocumentParameterRequest) *PostDocumentParametersParams {
|
||||||
|
o.SetDocumentParameterRequest(documentParameterRequest)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDocumentParameterRequest adds the documentParameterRequest to the post document parameters params.
|
||||||
|
func (o *PostDocumentParametersParams) SetDocumentParameterRequest(documentParameterRequest *members_models.DocumentParameterRequest) {
|
||||||
|
o.DocumentParameterRequest = documentParameterRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||||
|
func (o *PostDocumentParametersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
if o.DocumentParameterRequest != nil {
|
||||||
|
if err := r.SetBodyParam(o.DocumentParameterRequest); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,484 @@
|
||||||
|
// 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 document_parameters
|
||||||
|
|
||||||
|
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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// PostDocumentParametersReader is a Reader for the PostDocumentParameters structure.
|
||||||
|
type PostDocumentParametersReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *PostDocumentParametersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewPostDocumentParametersOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 401:
|
||||||
|
result := NewPostDocumentParametersUnauthorized()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 403:
|
||||||
|
result := NewPostDocumentParametersForbidden()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewPostDocumentParametersNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 422:
|
||||||
|
result := NewPostDocumentParametersUnprocessableEntity()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 500:
|
||||||
|
result := NewPostDocumentParametersInternalServerError()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[POST /documentparameters] postDocumentParameters", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPostDocumentParametersOK creates a PostDocumentParametersOK with default headers values
|
||||||
|
func NewPostDocumentParametersOK() *PostDocumentParametersOK {
|
||||||
|
return &PostDocumentParametersOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PostDocumentParametersOK describes a response with status code 200, with default header values.
|
||||||
|
//
|
||||||
|
// DocumentParameter Response Object
|
||||||
|
type PostDocumentParametersOK struct {
|
||||||
|
Payload *members_models.DocumentParameterResponse
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this post document parameters o k response has a 2xx status code
|
||||||
|
func (o *PostDocumentParametersOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this post document parameters o k response has a 3xx status code
|
||||||
|
func (o *PostDocumentParametersOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this post document parameters o k response has a 4xx status code
|
||||||
|
func (o *PostDocumentParametersOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this post document parameters o k response has a 5xx status code
|
||||||
|
func (o *PostDocumentParametersOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this post document parameters o k response a status code equal to that given
|
||||||
|
func (o *PostDocumentParametersOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the post document parameters o k response
|
||||||
|
func (o *PostDocumentParametersOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersOK) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[POST /documentparameters][%d] postDocumentParametersOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersOK) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[POST /documentparameters][%d] postDocumentParametersOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersOK) GetPayload() *members_models.DocumentParameterResponse {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
o.Payload = new(members_models.DocumentParameterResponse)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPostDocumentParametersUnauthorized creates a PostDocumentParametersUnauthorized with default headers values
|
||||||
|
func NewPostDocumentParametersUnauthorized() *PostDocumentParametersUnauthorized {
|
||||||
|
return &PostDocumentParametersUnauthorized{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PostDocumentParametersUnauthorized describes a response with status code 401, with default header values.
|
||||||
|
//
|
||||||
|
// Access Unauthorized, invalid API-KEY was used
|
||||||
|
type PostDocumentParametersUnauthorized struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this post document parameters unauthorized response has a 2xx status code
|
||||||
|
func (o *PostDocumentParametersUnauthorized) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this post document parameters unauthorized response has a 3xx status code
|
||||||
|
func (o *PostDocumentParametersUnauthorized) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this post document parameters unauthorized response has a 4xx status code
|
||||||
|
func (o *PostDocumentParametersUnauthorized) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this post document parameters unauthorized response has a 5xx status code
|
||||||
|
func (o *PostDocumentParametersUnauthorized) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this post document parameters unauthorized response a status code equal to that given
|
||||||
|
func (o *PostDocumentParametersUnauthorized) IsCode(code int) bool {
|
||||||
|
return code == 401
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the post document parameters unauthorized response
|
||||||
|
func (o *PostDocumentParametersUnauthorized) Code() int {
|
||||||
|
return 401
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersUnauthorized) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[POST /documentparameters][%d] postDocumentParametersUnauthorized %s", 401, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersUnauthorized) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[POST /documentparameters][%d] postDocumentParametersUnauthorized %s", 401, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersUnauthorized) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersUnauthorized) 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
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPostDocumentParametersForbidden creates a PostDocumentParametersForbidden with default headers values
|
||||||
|
func NewPostDocumentParametersForbidden() *PostDocumentParametersForbidden {
|
||||||
|
return &PostDocumentParametersForbidden{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PostDocumentParametersForbidden describes a response with status code 403, with default header values.
|
||||||
|
//
|
||||||
|
// Access forbidden, account lacks access
|
||||||
|
type PostDocumentParametersForbidden struct {
|
||||||
|
AccessControlAllowOrigin string
|
||||||
|
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this post document parameters forbidden response has a 2xx status code
|
||||||
|
func (o *PostDocumentParametersForbidden) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this post document parameters forbidden response has a 3xx status code
|
||||||
|
func (o *PostDocumentParametersForbidden) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this post document parameters forbidden response has a 4xx status code
|
||||||
|
func (o *PostDocumentParametersForbidden) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this post document parameters forbidden response has a 5xx status code
|
||||||
|
func (o *PostDocumentParametersForbidden) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this post document parameters forbidden response a status code equal to that given
|
||||||
|
func (o *PostDocumentParametersForbidden) IsCode(code int) bool {
|
||||||
|
return code == 403
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the post document parameters forbidden response
|
||||||
|
func (o *PostDocumentParametersForbidden) Code() int {
|
||||||
|
return 403
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersForbidden) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[POST /documentparameters][%d] postDocumentParametersForbidden %s", 403, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersForbidden) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[POST /documentparameters][%d] postDocumentParametersForbidden %s", 403, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersForbidden) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersForbidden) 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
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPostDocumentParametersNotFound creates a PostDocumentParametersNotFound with default headers values
|
||||||
|
func NewPostDocumentParametersNotFound() *PostDocumentParametersNotFound {
|
||||||
|
return &PostDocumentParametersNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PostDocumentParametersNotFound describes a response with status code 404, with default header values.
|
||||||
|
//
|
||||||
|
// Resource was not found
|
||||||
|
type PostDocumentParametersNotFound struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this post document parameters not found response has a 2xx status code
|
||||||
|
func (o *PostDocumentParametersNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this post document parameters not found response has a 3xx status code
|
||||||
|
func (o *PostDocumentParametersNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this post document parameters not found response has a 4xx status code
|
||||||
|
func (o *PostDocumentParametersNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this post document parameters not found response has a 5xx status code
|
||||||
|
func (o *PostDocumentParametersNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this post document parameters not found response a status code equal to that given
|
||||||
|
func (o *PostDocumentParametersNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the post document parameters not found response
|
||||||
|
func (o *PostDocumentParametersNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersNotFound) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[POST /documentparameters][%d] postDocumentParametersNotFound %s", 404, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersNotFound) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[POST /documentparameters][%d] postDocumentParametersNotFound %s", 404, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersNotFound) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersNotFound) 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
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPostDocumentParametersUnprocessableEntity creates a PostDocumentParametersUnprocessableEntity with default headers values
|
||||||
|
func NewPostDocumentParametersUnprocessableEntity() *PostDocumentParametersUnprocessableEntity {
|
||||||
|
return &PostDocumentParametersUnprocessableEntity{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PostDocumentParametersUnprocessableEntity describes a response with status code 422, with default header values.
|
||||||
|
//
|
||||||
|
// Unprocessable Entity, likely a bad parameter
|
||||||
|
type PostDocumentParametersUnprocessableEntity struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this post document parameters unprocessable entity response has a 2xx status code
|
||||||
|
func (o *PostDocumentParametersUnprocessableEntity) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this post document parameters unprocessable entity response has a 3xx status code
|
||||||
|
func (o *PostDocumentParametersUnprocessableEntity) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this post document parameters unprocessable entity response has a 4xx status code
|
||||||
|
func (o *PostDocumentParametersUnprocessableEntity) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this post document parameters unprocessable entity response has a 5xx status code
|
||||||
|
func (o *PostDocumentParametersUnprocessableEntity) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this post document parameters unprocessable entity response a status code equal to that given
|
||||||
|
func (o *PostDocumentParametersUnprocessableEntity) IsCode(code int) bool {
|
||||||
|
return code == 422
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the post document parameters unprocessable entity response
|
||||||
|
func (o *PostDocumentParametersUnprocessableEntity) Code() int {
|
||||||
|
return 422
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersUnprocessableEntity) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[POST /documentparameters][%d] postDocumentParametersUnprocessableEntity %s", 422, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersUnprocessableEntity) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[POST /documentparameters][%d] postDocumentParametersUnprocessableEntity %s", 422, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersUnprocessableEntity) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersUnprocessableEntity) 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
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPostDocumentParametersInternalServerError creates a PostDocumentParametersInternalServerError with default headers values
|
||||||
|
func NewPostDocumentParametersInternalServerError() *PostDocumentParametersInternalServerError {
|
||||||
|
return &PostDocumentParametersInternalServerError{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PostDocumentParametersInternalServerError describes a response with status code 500, with default header values.
|
||||||
|
//
|
||||||
|
// Server Internal Error
|
||||||
|
type PostDocumentParametersInternalServerError struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this post document parameters internal server error response has a 2xx status code
|
||||||
|
func (o *PostDocumentParametersInternalServerError) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this post document parameters internal server error response has a 3xx status code
|
||||||
|
func (o *PostDocumentParametersInternalServerError) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this post document parameters internal server error response has a 4xx status code
|
||||||
|
func (o *PostDocumentParametersInternalServerError) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this post document parameters internal server error response has a 5xx status code
|
||||||
|
func (o *PostDocumentParametersInternalServerError) IsServerError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this post document parameters internal server error response a status code equal to that given
|
||||||
|
func (o *PostDocumentParametersInternalServerError) IsCode(code int) bool {
|
||||||
|
return code == 500
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the post document parameters internal server error response
|
||||||
|
func (o *PostDocumentParametersInternalServerError) Code() int {
|
||||||
|
return 500
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersInternalServerError) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[POST /documentparameters][%d] postDocumentParametersInternalServerError %s", 500, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersInternalServerError) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[POST /documentparameters][%d] postDocumentParametersInternalServerError %s", 500, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersInternalServerError) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PostDocumentParametersInternalServerError) 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
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,159 @@
|
||||||
|
// 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 document_parameters
|
||||||
|
|
||||||
|
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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewPutDocumentParametersParams creates a new PutDocumentParametersParams 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 NewPutDocumentParametersParams() *PutDocumentParametersParams {
|
||||||
|
return NewPutDocumentParametersParamsWithTimeout(cr.DefaultTimeout)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutDocumentParametersParamsWithTimeout creates a new PutDocumentParametersParams object
|
||||||
|
// with the ability to set a timeout on a request.
|
||||||
|
func NewPutDocumentParametersParamsWithTimeout(timeout time.Duration) *PutDocumentParametersParams {
|
||||||
|
return &PutDocumentParametersParams{
|
||||||
|
inner: innerParams{
|
||||||
|
timeout: timeout,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutDocumentParametersParamsWithContext creates a new PutDocumentParametersParams object
|
||||||
|
// with the ability to set a context for a request.
|
||||||
|
//
|
||||||
|
// Deprecated: use the operation call with context to pass the context instead of [PutDocumentParametersParams].
|
||||||
|
func NewPutDocumentParametersParamsWithContext(ctx context.Context) *PutDocumentParametersParams {
|
||||||
|
return &PutDocumentParametersParams{
|
||||||
|
inner: innerParams{
|
||||||
|
ctx: ctx,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutDocumentParametersParamsWithHTTPClient creates a new PutDocumentParametersParams object
|
||||||
|
// with the ability to set a custom HTTPClient for a request.
|
||||||
|
func NewPutDocumentParametersParamsWithHTTPClient(client *http.Client) *PutDocumentParametersParams {
|
||||||
|
return &PutDocumentParametersParams{
|
||||||
|
HTTPClient: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
PutDocumentParametersParams contains all the parameters to send to the API endpoint
|
||||||
|
|
||||||
|
for the put document parameters operation.
|
||||||
|
|
||||||
|
Typically these are written to a http.Request.
|
||||||
|
*/
|
||||||
|
type PutDocumentParametersParams struct {
|
||||||
|
|
||||||
|
// DocumentParameterRequest.
|
||||||
|
//
|
||||||
|
// An array of DocumentParameter records
|
||||||
|
DocumentParameterRequest *members_models.DocumentParameterRequest
|
||||||
|
|
||||||
|
HTTPClient *http.Client
|
||||||
|
|
||||||
|
inner innerParams
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDefaults hydrates default values in the put document parameters params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *PutDocumentParametersParams) WithDefaults() *PutDocumentParametersParams {
|
||||||
|
o.SetDefaults()
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults hydrates default values in the put document parameters params (not the query body).
|
||||||
|
//
|
||||||
|
// All values with no default are reset to their zero value.
|
||||||
|
func (o *PutDocumentParametersParams) SetDefaults() {
|
||||||
|
// no default values defined for this parameter
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithTimeout adds the timeout to the put document parameters params.
|
||||||
|
func (o *PutDocumentParametersParams) WithTimeout(timeout time.Duration) *PutDocumentParametersParams {
|
||||||
|
o.SetTimeout(timeout)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeout adds the timeout to the put document parameters params.
|
||||||
|
func (o *PutDocumentParametersParams) SetTimeout(timeout time.Duration) {
|
||||||
|
o.inner.timeout = timeout
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithContext adds the context to the put document parameters params.
|
||||||
|
//
|
||||||
|
// Deprecated: use the operation call with context to pass the context instead of [PutDocumentParametersParams].
|
||||||
|
func (o *PutDocumentParametersParams) WithContext(ctx context.Context) *PutDocumentParametersParams {
|
||||||
|
o.SetContext(ctx)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetContext adds the context to the put document parameters params.
|
||||||
|
//
|
||||||
|
// Deprecated: use the operation call with context to pass the context instead of [PutDocumentParametersParams].
|
||||||
|
func (o *PutDocumentParametersParams) SetContext(ctx context.Context) {
|
||||||
|
o.inner.ctx = ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHTTPClient adds the HTTPClient to the put document parameters params.
|
||||||
|
func (o *PutDocumentParametersParams) WithHTTPClient(client *http.Client) *PutDocumentParametersParams {
|
||||||
|
o.SetHTTPClient(client)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHTTPClient adds the HTTPClient to the put document parameters params.
|
||||||
|
func (o *PutDocumentParametersParams) SetHTTPClient(client *http.Client) {
|
||||||
|
o.HTTPClient = client
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDocumentParameterRequest adds the documentParameterRequest to the put document parameters params.
|
||||||
|
func (o *PutDocumentParametersParams) WithDocumentParameterRequest(documentParameterRequest *members_models.DocumentParameterRequest) *PutDocumentParametersParams {
|
||||||
|
o.SetDocumentParameterRequest(documentParameterRequest)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDocumentParameterRequest adds the documentParameterRequest to the put document parameters params.
|
||||||
|
func (o *PutDocumentParametersParams) SetDocumentParameterRequest(documentParameterRequest *members_models.DocumentParameterRequest) {
|
||||||
|
o.DocumentParameterRequest = documentParameterRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||||
|
func (o *PutDocumentParametersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||||
|
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var res []error
|
||||||
|
if o.DocumentParameterRequest != nil {
|
||||||
|
if err := r.SetBodyParam(o.DocumentParameterRequest); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,558 @@
|
||||||
|
// 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 document_parameters
|
||||||
|
|
||||||
|
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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// PutDocumentParametersReader is a Reader for the PutDocumentParameters structure.
|
||||||
|
type PutDocumentParametersReader struct {
|
||||||
|
formats strfmt.Registry
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReadResponse reads a server response into the received o.
|
||||||
|
func (o *PutDocumentParametersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||||
|
switch response.Code() {
|
||||||
|
case 200:
|
||||||
|
result := NewPutDocumentParametersOK()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result, nil
|
||||||
|
case 401:
|
||||||
|
result := NewPutDocumentParametersUnauthorized()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 403:
|
||||||
|
result := NewPutDocumentParametersForbidden()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 404:
|
||||||
|
result := NewPutDocumentParametersNotFound()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 409:
|
||||||
|
result := NewPutDocumentParametersConflict()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 422:
|
||||||
|
result := NewPutDocumentParametersUnprocessableEntity()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
case 500:
|
||||||
|
result := NewPutDocumentParametersInternalServerError()
|
||||||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return nil, result
|
||||||
|
default:
|
||||||
|
return nil, runtime.NewAPIError("[PUT /documentparameters] putDocumentParameters", response, response.Code())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutDocumentParametersOK creates a PutDocumentParametersOK with default headers values
|
||||||
|
func NewPutDocumentParametersOK() *PutDocumentParametersOK {
|
||||||
|
return &PutDocumentParametersOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PutDocumentParametersOK describes a response with status code 200, with default header values.
|
||||||
|
//
|
||||||
|
// DocumentParameter Response Object
|
||||||
|
type PutDocumentParametersOK struct {
|
||||||
|
Payload *members_models.DocumentParameterResponse
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this put document parameters o k response has a 2xx status code
|
||||||
|
func (o *PutDocumentParametersOK) IsSuccess() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this put document parameters o k response has a 3xx status code
|
||||||
|
func (o *PutDocumentParametersOK) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this put document parameters o k response has a 4xx status code
|
||||||
|
func (o *PutDocumentParametersOK) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this put document parameters o k response has a 5xx status code
|
||||||
|
func (o *PutDocumentParametersOK) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this put document parameters o k response a status code equal to that given
|
||||||
|
func (o *PutDocumentParametersOK) IsCode(code int) bool {
|
||||||
|
return code == 200
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the put document parameters o k response
|
||||||
|
func (o *PutDocumentParametersOK) Code() int {
|
||||||
|
return 200
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersOK) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /documentparameters][%d] putDocumentParametersOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersOK) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /documentparameters][%d] putDocumentParametersOK %s", 200, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersOK) GetPayload() *members_models.DocumentParameterResponse {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
o.Payload = new(members_models.DocumentParameterResponse)
|
||||||
|
|
||||||
|
// response payload
|
||||||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutDocumentParametersUnauthorized creates a PutDocumentParametersUnauthorized with default headers values
|
||||||
|
func NewPutDocumentParametersUnauthorized() *PutDocumentParametersUnauthorized {
|
||||||
|
return &PutDocumentParametersUnauthorized{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PutDocumentParametersUnauthorized describes a response with status code 401, with default header values.
|
||||||
|
//
|
||||||
|
// Access Unauthorized, invalid API-KEY was used
|
||||||
|
type PutDocumentParametersUnauthorized struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this put document parameters unauthorized response has a 2xx status code
|
||||||
|
func (o *PutDocumentParametersUnauthorized) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this put document parameters unauthorized response has a 3xx status code
|
||||||
|
func (o *PutDocumentParametersUnauthorized) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this put document parameters unauthorized response has a 4xx status code
|
||||||
|
func (o *PutDocumentParametersUnauthorized) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this put document parameters unauthorized response has a 5xx status code
|
||||||
|
func (o *PutDocumentParametersUnauthorized) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this put document parameters unauthorized response a status code equal to that given
|
||||||
|
func (o *PutDocumentParametersUnauthorized) IsCode(code int) bool {
|
||||||
|
return code == 401
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the put document parameters unauthorized response
|
||||||
|
func (o *PutDocumentParametersUnauthorized) Code() int {
|
||||||
|
return 401
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersUnauthorized) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /documentparameters][%d] putDocumentParametersUnauthorized %s", 401, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersUnauthorized) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /documentparameters][%d] putDocumentParametersUnauthorized %s", 401, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersUnauthorized) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersUnauthorized) 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
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutDocumentParametersForbidden creates a PutDocumentParametersForbidden with default headers values
|
||||||
|
func NewPutDocumentParametersForbidden() *PutDocumentParametersForbidden {
|
||||||
|
return &PutDocumentParametersForbidden{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PutDocumentParametersForbidden describes a response with status code 403, with default header values.
|
||||||
|
//
|
||||||
|
// Access forbidden, account lacks access
|
||||||
|
type PutDocumentParametersForbidden struct {
|
||||||
|
AccessControlAllowOrigin string
|
||||||
|
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this put document parameters forbidden response has a 2xx status code
|
||||||
|
func (o *PutDocumentParametersForbidden) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this put document parameters forbidden response has a 3xx status code
|
||||||
|
func (o *PutDocumentParametersForbidden) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this put document parameters forbidden response has a 4xx status code
|
||||||
|
func (o *PutDocumentParametersForbidden) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this put document parameters forbidden response has a 5xx status code
|
||||||
|
func (o *PutDocumentParametersForbidden) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this put document parameters forbidden response a status code equal to that given
|
||||||
|
func (o *PutDocumentParametersForbidden) IsCode(code int) bool {
|
||||||
|
return code == 403
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the put document parameters forbidden response
|
||||||
|
func (o *PutDocumentParametersForbidden) Code() int {
|
||||||
|
return 403
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersForbidden) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /documentparameters][%d] putDocumentParametersForbidden %s", 403, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersForbidden) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /documentparameters][%d] putDocumentParametersForbidden %s", 403, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersForbidden) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersForbidden) 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
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutDocumentParametersNotFound creates a PutDocumentParametersNotFound with default headers values
|
||||||
|
func NewPutDocumentParametersNotFound() *PutDocumentParametersNotFound {
|
||||||
|
return &PutDocumentParametersNotFound{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PutDocumentParametersNotFound describes a response with status code 404, with default header values.
|
||||||
|
//
|
||||||
|
// Resource was not found
|
||||||
|
type PutDocumentParametersNotFound struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this put document parameters not found response has a 2xx status code
|
||||||
|
func (o *PutDocumentParametersNotFound) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this put document parameters not found response has a 3xx status code
|
||||||
|
func (o *PutDocumentParametersNotFound) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this put document parameters not found response has a 4xx status code
|
||||||
|
func (o *PutDocumentParametersNotFound) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this put document parameters not found response has a 5xx status code
|
||||||
|
func (o *PutDocumentParametersNotFound) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this put document parameters not found response a status code equal to that given
|
||||||
|
func (o *PutDocumentParametersNotFound) IsCode(code int) bool {
|
||||||
|
return code == 404
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the put document parameters not found response
|
||||||
|
func (o *PutDocumentParametersNotFound) Code() int {
|
||||||
|
return 404
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersNotFound) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /documentparameters][%d] putDocumentParametersNotFound %s", 404, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersNotFound) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /documentparameters][%d] putDocumentParametersNotFound %s", 404, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersNotFound) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersNotFound) 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
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutDocumentParametersConflict creates a PutDocumentParametersConflict with default headers values
|
||||||
|
func NewPutDocumentParametersConflict() *PutDocumentParametersConflict {
|
||||||
|
return &PutDocumentParametersConflict{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PutDocumentParametersConflict describes a response with status code 409, with default header values.
|
||||||
|
//
|
||||||
|
// The supplied LastModifiedDate is stale; reload the record before retrying.
|
||||||
|
type PutDocumentParametersConflict struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this put document parameters conflict response has a 2xx status code
|
||||||
|
func (o *PutDocumentParametersConflict) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this put document parameters conflict response has a 3xx status code
|
||||||
|
func (o *PutDocumentParametersConflict) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this put document parameters conflict response has a 4xx status code
|
||||||
|
func (o *PutDocumentParametersConflict) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this put document parameters conflict response has a 5xx status code
|
||||||
|
func (o *PutDocumentParametersConflict) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this put document parameters conflict response a status code equal to that given
|
||||||
|
func (o *PutDocumentParametersConflict) IsCode(code int) bool {
|
||||||
|
return code == 409
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the put document parameters conflict response
|
||||||
|
func (o *PutDocumentParametersConflict) Code() int {
|
||||||
|
return 409
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersConflict) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /documentparameters][%d] putDocumentParametersConflict %s", 409, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersConflict) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /documentparameters][%d] putDocumentParametersConflict %s", 409, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersConflict) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersConflict) 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
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutDocumentParametersUnprocessableEntity creates a PutDocumentParametersUnprocessableEntity with default headers values
|
||||||
|
func NewPutDocumentParametersUnprocessableEntity() *PutDocumentParametersUnprocessableEntity {
|
||||||
|
return &PutDocumentParametersUnprocessableEntity{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PutDocumentParametersUnprocessableEntity describes a response with status code 422, with default header values.
|
||||||
|
//
|
||||||
|
// Unprocessable Entity, likely a bad parameter
|
||||||
|
type PutDocumentParametersUnprocessableEntity struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this put document parameters unprocessable entity response has a 2xx status code
|
||||||
|
func (o *PutDocumentParametersUnprocessableEntity) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this put document parameters unprocessable entity response has a 3xx status code
|
||||||
|
func (o *PutDocumentParametersUnprocessableEntity) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this put document parameters unprocessable entity response has a 4xx status code
|
||||||
|
func (o *PutDocumentParametersUnprocessableEntity) IsClientError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this put document parameters unprocessable entity response has a 5xx status code
|
||||||
|
func (o *PutDocumentParametersUnprocessableEntity) IsServerError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this put document parameters unprocessable entity response a status code equal to that given
|
||||||
|
func (o *PutDocumentParametersUnprocessableEntity) IsCode(code int) bool {
|
||||||
|
return code == 422
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the put document parameters unprocessable entity response
|
||||||
|
func (o *PutDocumentParametersUnprocessableEntity) Code() int {
|
||||||
|
return 422
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersUnprocessableEntity) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /documentparameters][%d] putDocumentParametersUnprocessableEntity %s", 422, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersUnprocessableEntity) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /documentparameters][%d] putDocumentParametersUnprocessableEntity %s", 422, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersUnprocessableEntity) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersUnprocessableEntity) 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
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewPutDocumentParametersInternalServerError creates a PutDocumentParametersInternalServerError with default headers values
|
||||||
|
func NewPutDocumentParametersInternalServerError() *PutDocumentParametersInternalServerError {
|
||||||
|
return &PutDocumentParametersInternalServerError{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PutDocumentParametersInternalServerError describes a response with status code 500, with default header values.
|
||||||
|
//
|
||||||
|
// Server Internal Error
|
||||||
|
type PutDocumentParametersInternalServerError struct {
|
||||||
|
Payload *members_models.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSuccess returns true when this put document parameters internal server error response has a 2xx status code
|
||||||
|
func (o *PutDocumentParametersInternalServerError) IsSuccess() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsRedirect returns true when this put document parameters internal server error response has a 3xx status code
|
||||||
|
func (o *PutDocumentParametersInternalServerError) IsRedirect() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsClientError returns true when this put document parameters internal server error response has a 4xx status code
|
||||||
|
func (o *PutDocumentParametersInternalServerError) IsClientError() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsServerError returns true when this put document parameters internal server error response has a 5xx status code
|
||||||
|
func (o *PutDocumentParametersInternalServerError) IsServerError() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsCode returns true when this put document parameters internal server error response a status code equal to that given
|
||||||
|
func (o *PutDocumentParametersInternalServerError) IsCode(code int) bool {
|
||||||
|
return code == 500
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code gets the status code for the put document parameters internal server error response
|
||||||
|
func (o *PutDocumentParametersInternalServerError) Code() int {
|
||||||
|
return 500
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersInternalServerError) Error() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /documentparameters][%d] putDocumentParametersInternalServerError %s", 500, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersInternalServerError) String() string {
|
||||||
|
payload, _ := json.Marshal(o.Payload)
|
||||||
|
return fmt.Sprintf("[PUT /documentparameters][%d] putDocumentParametersInternalServerError %s", 500, payload)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersInternalServerError) GetPayload() *members_models.Error {
|
||||||
|
return o.Payload
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *PutDocumentParametersInternalServerError) 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 = "fac8e386cb348993648644ba89c1bc14effbce679b2323ecdc332d1b4401d6ea"
|
const membersProviderSpecSHA256 = "4a5fd893c6490c18c6fa6fe3ddb234caf7cbfebb04a1c974fbf16854c2089acf"
|
||||||
|
|
||||||
var learningTestAuth = openapiruntime.ClientAuthInfoWriterFunc(func(openapiruntime.ClientRequest, strfmt.Registry) error {
|
var learningTestAuth = openapiruntime.ClientAuthInfoWriterFunc(func(openapiruntime.ClientRequest, strfmt.Registry) error {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import (
|
||||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/courses"
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/courses"
|
||||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/credentials"
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/credentials"
|
||||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/databases"
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/databases"
|
||||||
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/document_parameters"
|
||||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/documents"
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/documents"
|
||||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/emails"
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/emails"
|
||||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/enrollments"
|
"code.tnxs.net/vernonkeenan/lib/api/members/members_client/enrollments"
|
||||||
|
|
@ -93,6 +94,7 @@ func New(transport runtime.ContextualTransport, formats strfmt.Registry) *Member
|
||||||
cli.Courses = courses.New(transport, formats)
|
cli.Courses = courses.New(transport, formats)
|
||||||
cli.Credentials = credentials.New(transport, formats)
|
cli.Credentials = credentials.New(transport, formats)
|
||||||
cli.Databases = databases.New(transport, formats)
|
cli.Databases = databases.New(transport, formats)
|
||||||
|
cli.DocumentParameters = document_parameters.New(transport, formats)
|
||||||
cli.Documents = documents.New(transport, formats)
|
cli.Documents = documents.New(transport, formats)
|
||||||
cli.Emails = emails.New(transport, formats)
|
cli.Emails = emails.New(transport, formats)
|
||||||
cli.Enrollments = enrollments.New(transport, formats)
|
cli.Enrollments = enrollments.New(transport, formats)
|
||||||
|
|
@ -188,6 +190,8 @@ type Members struct {
|
||||||
|
|
||||||
Databases databases.ClientService
|
Databases databases.ClientService
|
||||||
|
|
||||||
|
DocumentParameters document_parameters.ClientService
|
||||||
|
|
||||||
Documents documents.ClientService
|
Documents documents.ClientService
|
||||||
|
|
||||||
Emails emails.ClientService
|
Emails emails.ClientService
|
||||||
|
|
@ -251,6 +255,7 @@ func (c *Members) SetTransport(transport runtime.ContextualTransport) {
|
||||||
c.Courses.SetTransport(transport)
|
c.Courses.SetTransport(transport)
|
||||||
c.Credentials.SetTransport(transport)
|
c.Credentials.SetTransport(transport)
|
||||||
c.Databases.SetTransport(transport)
|
c.Databases.SetTransport(transport)
|
||||||
|
c.DocumentParameters.SetTransport(transport)
|
||||||
c.Documents.SetTransport(transport)
|
c.Documents.SetTransport(transport)
|
||||||
c.Emails.SetTransport(transport)
|
c.Emails.SetTransport(transport)
|
||||||
c.Enrollments.SetTransport(transport)
|
c.Enrollments.SetTransport(transport)
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import (
|
||||||
"github.com/go-openapi/strfmt"
|
"github.com/go-openapi/strfmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
const membersTrackSpecSHA256 = "fac8e386cb348993648644ba89c1bc14effbce679b2323ecdc332d1b4401d6ea"
|
const membersTrackSpecSHA256 = "4a5fd893c6490c18c6fa6fe3ddb234caf7cbfebb04a1c974fbf16854c2089acf"
|
||||||
|
|
||||||
var trackTestAuth = openapiruntime.ClientAuthInfoWriterFunc(
|
var trackTestAuth = openapiruntime.ClientAuthInfoWriterFunc(
|
||||||
func(openapiruntime.ClientRequest, strfmt.Registry) error { return nil },
|
func(openapiruntime.ClientRequest, strfmt.Registry) error { return nil },
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
// 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/strfmt"
|
||||||
|
"github.com/go-openapi/swag/jsonutils"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DocumentParameter Tenant-owned document parameter
|
||||||
|
//
|
||||||
|
// swagger:model DocumentParameter
|
||||||
|
type DocumentParameter struct {
|
||||||
|
|
||||||
|
// created by ID
|
||||||
|
CreatedByID *string `json:"CreatedByID,omitempty"`
|
||||||
|
|
||||||
|
// created date
|
||||||
|
CreatedDate *string `json:"CreatedDate,omitempty"`
|
||||||
|
|
||||||
|
// deleted date
|
||||||
|
DeletedDate *string `json:"DeletedDate,omitempty"`
|
||||||
|
|
||||||
|
// document ID
|
||||||
|
DocumentID *string `json:"DocumentID,omitempty"`
|
||||||
|
|
||||||
|
// ID
|
||||||
|
ID string `json:"ID,omitempty"`
|
||||||
|
|
||||||
|
// is deleted
|
||||||
|
IsDeleted *bool `json:"IsDeleted,omitempty"`
|
||||||
|
|
||||||
|
// last modified by ID
|
||||||
|
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
|
||||||
|
|
||||||
|
// last modified date
|
||||||
|
LastModifiedDate *string `json:"LastModifiedDate,omitempty"`
|
||||||
|
|
||||||
|
// name
|
||||||
|
Name *string `json:"Name,omitempty"`
|
||||||
|
|
||||||
|
// tenant ID
|
||||||
|
TenantID *string `json:"TenantID,omitempty"`
|
||||||
|
|
||||||
|
// user ID
|
||||||
|
UserID *string `json:"UserID,omitempty"`
|
||||||
|
|
||||||
|
// value
|
||||||
|
Value *string `json:"Value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this document parameter
|
||||||
|
func (m *DocumentParameter) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ContextValidate validates this document parameter based on context it is used
|
||||||
|
func (m *DocumentParameter) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *DocumentParameter) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return jsonutils.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *DocumentParameter) UnmarshalBinary(b []byte) error {
|
||||||
|
var res DocumentParameter
|
||||||
|
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,147 @@
|
||||||
|
// 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"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DocumentParameterRequest An array of DocumentParameter objects
|
||||||
|
//
|
||||||
|
// swagger:model DocumentParameterRequest
|
||||||
|
type DocumentParameterRequest struct {
|
||||||
|
|
||||||
|
// data
|
||||||
|
// Required: true
|
||||||
|
// Max Items: 100
|
||||||
|
// Min Items: 1
|
||||||
|
Data []*DocumentParameter `json:"Data"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this document parameter request
|
||||||
|
func (m *DocumentParameterRequest) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateData(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DocumentParameterRequest) validateData(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("Data", "body", m.Data); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
iDataSize := int64(len(m.Data))
|
||||||
|
|
||||||
|
if err := validate.MinItems("Data", "body", iDataSize, 1); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := validate.MaxItems("Data", "body", iDataSize, 100); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
// ContextValidate validate this document parameter request based on the context it is used
|
||||||
|
func (m *DocumentParameterRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.contextValidateData(ctx, formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *DocumentParameterRequest) 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
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *DocumentParameterRequest) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return jsonutils.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *DocumentParameterRequest) UnmarshalBinary(b []byte) error {
|
||||||
|
var res DocumentParameterRequest
|
||||||
|
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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DocumentParameterResponse An array of DocumentParameter objects
|
||||||
|
//
|
||||||
|
// swagger:model DocumentParameterResponse
|
||||||
|
type DocumentParameterResponse struct {
|
||||||
|
|
||||||
|
// data
|
||||||
|
Data []*DocumentParameter `json:"Data"`
|
||||||
|
|
||||||
|
// meta
|
||||||
|
Meta *ResponseMeta `json:"Meta,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this document parameter response
|
||||||
|
func (m *DocumentParameterResponse) 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 *DocumentParameterResponse) 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 *DocumentParameterResponse) 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 document parameter response based on the context it is used
|
||||||
|
func (m *DocumentParameterResponse) 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 *DocumentParameterResponse) 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 *DocumentParameterResponse) 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 *DocumentParameterResponse) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return jsonutils.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *DocumentParameterResponse) UnmarshalBinary(b []byte) error {
|
||||||
|
var res DocumentParameterResponse
|
||||||
|
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
# Members DocumentParameter client
|
||||||
|
|
||||||
|
The generated `document_parameters` client exposes the governed
|
||||||
|
`GET /documentparameters`, `POST /documentparameters`, and
|
||||||
|
`PUT /documentparameters` operations.
|
||||||
|
|
||||||
|
Every call requires the caller to provide both the server-held API-key
|
||||||
|
authentication writer and the native `kvSession` cookie through the request
|
||||||
|
transport. The Members service enforces the exact
|
||||||
|
`members:document-parameter:read`, `:create`, or `:update` machine scope.
|
||||||
|
Active Contributors can read only their own records. Creates and
|
||||||
|
compare-and-swap updates require tenant Owner or Manager authority.
|
||||||
|
|
||||||
|
`DocumentID` is required and validated against the same tenant.
|
||||||
|
`LastModifiedDate` is the optimistic concurrency token; stale updates return
|
||||||
|
409. IDs, tenant ownership, and audit fields remain server-owned.
|
||||||
|
`IsDeleted` and `DeletedDate` are lifecycle-owned, and the client exposes no
|
||||||
|
generic delete operation.
|
||||||
|
|
||||||
|
Folder client generation is deferred because the authoritative Folder schema
|
||||||
|
contains `AccountID` and a polymorphic `ObjectID`/`ObjectType` pair without
|
||||||
|
governed same-tenant reference metadata. Publishing those writes would be less
|
||||||
|
safe than the unambiguous DocumentParameter-to-Document relationship.
|
||||||
|
|
@ -2367,7 +2367,7 @@ paths:
|
||||||
- Folders
|
- Folders
|
||||||
/documentparameters:
|
/documentparameters:
|
||||||
get:
|
get:
|
||||||
description: Tenant- and user-scoped DocumentParameter read. Requires members:document-parameter:read and an active human session.
|
description: Tenant- and user-scoped DocumentParameter read. Requires members:document-parameter:read and an active human session. Contributors can read only their own records; Owners and Managers can read the tenant.
|
||||||
operationId: getDocumentParameters
|
operationId: getDocumentParameters
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/parameters/idQuery"
|
- $ref: "#/parameters/idQuery"
|
||||||
|
|
@ -2393,7 +2393,7 @@ paths:
|
||||||
tags:
|
tags:
|
||||||
- Document Parameters
|
- Document Parameters
|
||||||
post:
|
post:
|
||||||
description: Tenant- and user-scoped DocumentParameter create. Requires members:document-parameter:create and an active human session.
|
description: Tenant-scoped DocumentParameter create. Requires members:document-parameter:create, an active human session, and Owner or Manager authority.
|
||||||
operationId: postDocumentParameters
|
operationId: postDocumentParameters
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/parameters/documentParameterRequest"
|
- $ref: "#/parameters/documentParameterRequest"
|
||||||
|
|
@ -2417,7 +2417,7 @@ paths:
|
||||||
tags:
|
tags:
|
||||||
- Document Parameters
|
- Document Parameters
|
||||||
put:
|
put:
|
||||||
description: Tenant- and user-scoped DocumentParameter CAS update. Requires members:document-parameter:update and an active human session.
|
description: Tenant-scoped DocumentParameter CAS update. Requires members:document-parameter:update, an active human session, and Owner or Manager authority.
|
||||||
operationId: putDocumentParameters
|
operationId: putDocumentParameters
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/parameters/documentParameterRequest"
|
- $ref: "#/parameters/documentParameterRequest"
|
||||||
|
|
@ -5745,10 +5745,14 @@ definitions:
|
||||||
type: object
|
type: object
|
||||||
DocumentParameterRequest:
|
DocumentParameterRequest:
|
||||||
description: An array of DocumentParameter objects
|
description: An array of DocumentParameter objects
|
||||||
|
required:
|
||||||
|
- Data
|
||||||
properties:
|
properties:
|
||||||
Data:
|
Data:
|
||||||
items:
|
items:
|
||||||
$ref: "#/definitions/DocumentParameter"
|
$ref: "#/definitions/DocumentParameter"
|
||||||
|
minItems: 1
|
||||||
|
maxItems: 100
|
||||||
type: array
|
type: array
|
||||||
type: object
|
type: object
|
||||||
DocumentParameterResponse:
|
DocumentParameterResponse:
|
||||||
|
|
|
||||||
|
|
@ -2367,7 +2367,7 @@ paths:
|
||||||
- Folders
|
- Folders
|
||||||
/documentparameters:
|
/documentparameters:
|
||||||
get:
|
get:
|
||||||
description: Tenant- and user-scoped DocumentParameter read. Requires members:document-parameter:read and an active human session.
|
description: Tenant- and user-scoped DocumentParameter read. Requires members:document-parameter:read and an active human session. Contributors can read only their own records; Owners and Managers can read the tenant.
|
||||||
operationId: getDocumentParameters
|
operationId: getDocumentParameters
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/parameters/idQuery"
|
- $ref: "#/parameters/idQuery"
|
||||||
|
|
@ -2393,7 +2393,7 @@ paths:
|
||||||
tags:
|
tags:
|
||||||
- Document Parameters
|
- Document Parameters
|
||||||
post:
|
post:
|
||||||
description: Tenant- and user-scoped DocumentParameter create. Requires members:document-parameter:create and an active human session.
|
description: Tenant-scoped DocumentParameter create. Requires members:document-parameter:create, an active human session, and Owner or Manager authority.
|
||||||
operationId: postDocumentParameters
|
operationId: postDocumentParameters
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/parameters/documentParameterRequest"
|
- $ref: "#/parameters/documentParameterRequest"
|
||||||
|
|
@ -2417,7 +2417,7 @@ paths:
|
||||||
tags:
|
tags:
|
||||||
- Document Parameters
|
- Document Parameters
|
||||||
put:
|
put:
|
||||||
description: Tenant- and user-scoped DocumentParameter CAS update. Requires members:document-parameter:update and an active human session.
|
description: Tenant-scoped DocumentParameter CAS update. Requires members:document-parameter:update, an active human session, and Owner or Manager authority.
|
||||||
operationId: putDocumentParameters
|
operationId: putDocumentParameters
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/parameters/documentParameterRequest"
|
- $ref: "#/parameters/documentParameterRequest"
|
||||||
|
|
@ -5745,10 +5745,14 @@ definitions:
|
||||||
type: object
|
type: object
|
||||||
DocumentParameterRequest:
|
DocumentParameterRequest:
|
||||||
description: An array of DocumentParameter objects
|
description: An array of DocumentParameter objects
|
||||||
|
required:
|
||||||
|
- Data
|
||||||
properties:
|
properties:
|
||||||
Data:
|
Data:
|
||||||
items:
|
items:
|
||||||
$ref: "#/definitions/DocumentParameter"
|
$ref: "#/definitions/DocumentParameter"
|
||||||
|
minItems: 1
|
||||||
|
maxItems: 100
|
||||||
type: array
|
type: array
|
||||||
type: object
|
type: object
|
||||||
DocumentParameterResponse:
|
DocumentParameterResponse:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue