models

package
v0.0.0-...-b9f8332 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deserialize

func Deserialize[T RestEndpoint | SmartInstance](data []byte, obj *T) error

func Serialize

func Serialize[T RestEndpoint | SmartInstance](obj T) ([]byte, error)

Types

type ApiKeyAuthCredentialsInstance

type ApiKeyAuthCredentialsInstance struct {
	KeyName  string `json:"keyName,omitempty" xml:"keyName,omitempty"`
	KeyValue string `json:"keyValue,omitempty" xml:"keyValue,omitempty"`
}

type BasicAuthCredentialsInstance

type BasicAuthCredentialsInstance struct {
	Username string `json:"username,omitempty" xml:"username,omitempty"`
	Password string `json:"password,omitempty" xml:"password,omitempty"`
}

type DefaultResponse

type DefaultResponse struct {
	Message string `json:"message,omitempty" xml:"message,omitempty"`
}

type EndpointResponse

type EndpointResponse struct {
	Path        string                                   `json:"path,omitempty" xml:"path,omitempty"`
	Method      string                                   `json:"method,omitempty" xml:"method,omitempty"`
	Description string                                   `json:"description,omitempty" xml:"description,omitempty"`
	Responses   map[string]RestEndpointResponseStructure `json:"responses,omitempty" xml:"responses,omitempty"`
}

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message,omitempty" xml:"message,omitempty"`
	Code    string `json:"code,omitempty" xml:"code,omitempty"`
}

type HealthResponse

type HealthResponse struct {
	Status string `json:"status" xml:"status"`
}

type OpenApiSwaggerSource

type OpenApiSwaggerSource struct {
	// only one of the fields should be set as the source of the OpenAPI v3 or Swagger v2 spec
	PathToFile string `json:"pathToFile,omitempty" xml:"pathToFile,omitempty"`
	Url        string `json:"url,omitempty" xml:"url,omitempty"`
	Content    string `json:"content,omitempty" xml:"content,omitempty"`
}

type ProtectedResourceResponse

type ProtectedResourceResponse struct {
	Message string `json:"message,omitempty" xml:"message,omitempty"`
}

type ProteusHints

type ProteusHints struct {
	StatusCode       int
	Body             []byte
	ContentType      string
	RedirectLocation string
	Wait             time.Duration
	ApiKey           *ProteusHintsApiKeyAuth
}

type ProteusHintsApiKeyAuth

type ProteusHintsApiKeyAuth struct {
	KeyName string
	// accepts values: "header", "query". Header is default.
	Location string
	// accepts values: "plain", "base64". Plain is default.
	ValueFormat string
	// used if the key value goes with some prefix, e.g. "ApiKey "
	ValueParserRegexp *regexp.Regexp
}

type RestEndpoint

type RestEndpoint struct {
	Path                      string                                   `json:"path,omitempty" xml:"path,omitempty"`
	Method                    string                                   `json:"method,omitempty" xml:"method,omitempty"`
	Description               string                                   `json:"description,omitempty" xml:"description,omitempty"`
	DefaultResponseStatusCode int                                      `json:"defaultResponseStatusCode,omitempty" xml:"defaultResponseStatusCode,omitempty"`
	Responses                 map[string]RestEndpointResponseStructure `json:"responses,omitempty" xml:"responses,omitempty"`
}

type RestEndpointCookie

type RestEndpointCookie struct {
	Name  string `json:"name,omitempty" xml:"name,omitempty"`
	Value string `json:"value,omitempty" xml:"value,omitempty"`
}

type RestEndpointHeader

type RestEndpointHeader struct {
	Name   string   `json:"name,omitempty" xml:"name,omitempty"`
	Values []string `json:"values,omitempty" xml:"values,omitempty"`
}

type RestEndpointResponseBody

type RestEndpointResponseBody struct {
	ContentType string `json:"contentType,omitempty" xml:"contentType,omitempty"`
	AsString    string `json:"asString,omitempty" xml:"asString,omitempty"`
	AsBase64    string `json:"asBase64,omitempty" xml:"asBase64,omitempty"`
}

func (*RestEndpointResponseBody) BodyAsString

func (rerb *RestEndpointResponseBody) BodyAsString() (string, string, error)

type RestEndpointResponseStructure

type RestEndpointResponseStructure struct {
	Body    []RestEndpointResponseBody `json:"body,omitempty" xml:"body,omitempty"`
	Headers []RestEndpointHeader       `json:"headers,omitempty" xml:"headers,omitempty"`
	Cookies []RestEndpointCookie       `json:"cookies,omitempty" xml:"cookies,omitempty"`
}

func (*RestEndpointResponseStructure) Get

func (*RestEndpointResponseStructure) GetMediaTypesAsString

func (r *RestEndpointResponseStructure) GetMediaTypesAsString() string

type SmartCreatedResponse

type SmartCreatedResponse struct {
	Id string `json:"id,omitempty" xml:"id,omitempty"`
}

type SmartInstance

type SmartInstance struct {
	Data map[string]map[string]interface{}
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL