models

package
v0.0.0-...-1a7c710 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APICollectionMetadata

type APICollectionMetadata struct {

	// ts when the collection was created
	// Format: date-time
	CreatedAt strfmt.DateTime `json:"CreatedAt,omitempty"`

	// ts when the collection was deleted
	// Format: date-time
	DeletedAt strfmt.DateTime `json:"DeletedAt,omitempty"`

	// cid (aka collectionId) would be used to naming ${collectionId} field, that field should be url safe
	// otherwise an error would be returned.
	// leave it empty would generate a random uuid for ${collectionId}
	CollectionID string `json:"collectionId,omitempty"`

	// pid is used to isolate resources (by projects), making the collections are belonged to a specific project
	ProjectID string `json:"projectId,omitempty"`
}

APICollectionMetadata api collection metadata

swagger:model apiCollectionMetadata

func (*APICollectionMetadata) ContextValidate

func (m *APICollectionMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validates this api collection metadata based on context it is used

func (*APICollectionMetadata) MarshalBinary

func (m *APICollectionMetadata) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*APICollectionMetadata) UnmarshalBinary

func (m *APICollectionMetadata) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*APICollectionMetadata) Validate

func (m *APICollectionMetadata) Validate(formats strfmt.Registry) error

Validate validates this api collection metadata

type APICollectionType

type APICollectionType string

APICollectionType api collection type

swagger:model apiCollectionType

const (

	// APICollectionTypeCOLLECTIONTYPENONE captures enum value "COLLECTION_TYPE_NONE"
	APICollectionTypeCOLLECTIONTYPENONE APICollectionType = "COLLECTION_TYPE_NONE"

	// APICollectionTypeCOLLECTIONTYPEREGULARFILES captures enum value "COLLECTION_TYPE_REGULAR_FILES"
	APICollectionTypeCOLLECTIONTYPEREGULARFILES APICollectionType = "COLLECTION_TYPE_REGULAR_FILES"

	// APICollectionTypeCOLLECTIONTYPETIMESERIES captures enum value "COLLECTION_TYPE_TIMESERIES"
	APICollectionTypeCOLLECTIONTYPETIMESERIES APICollectionType = "COLLECTION_TYPE_TIMESERIES"

	// APICollectionTypeCOLLECTIONTYPETRANSACTION captures enum value "COLLECTION_TYPE_TRANSACTION"
	APICollectionTypeCOLLECTIONTYPETRANSACTION APICollectionType = "COLLECTION_TYPE_TRANSACTION"

	// APICollectionTypeCOLLECTIONTYPEVECTOR captures enum value "COLLECTION_TYPE_VECTOR"
	APICollectionTypeCOLLECTIONTYPEVECTOR APICollectionType = "COLLECTION_TYPE_VECTOR"

	// APICollectionTypeCOLLECTIONTYPEPROXY captures enum value "COLLECTION_TYPE_PROXY"
	APICollectionTypeCOLLECTIONTYPEPROXY APICollectionType = "COLLECTION_TYPE_PROXY"
)

func NewAPICollectionType

func NewAPICollectionType(value APICollectionType) *APICollectionType

func (APICollectionType) ContextValidate

func (m APICollectionType) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validates this api collection type based on context it is used

func (APICollectionType) Pointer

func (m APICollectionType) Pointer() *APICollectionType

Pointer returns a pointer to a freshly-allocated APICollectionType.

func (APICollectionType) Validate

func (m APICollectionType) Validate(formats strfmt.Registry) error

Validate validates this api collection type

type APICreateCollectionResponse

type APICreateCollectionResponse struct {

	// metadata
	Metadata *APICollectionMetadata `json:"Metadata,omitempty"`

	// collection type
	CollectionType *APICollectionType `json:"collectionType,omitempty"`

	// description
	Description string `json:"description,omitempty"`

	// schemas
	Schemas []*APISchemaField `json:"schemas"`
}

APICreateCollectionResponse api create collection response

swagger:model apiCreateCollectionResponse

func (*APICreateCollectionResponse) ContextValidate

func (m *APICreateCollectionResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validate this api create collection response based on the context it is used

func (*APICreateCollectionResponse) MarshalBinary

func (m *APICreateCollectionResponse) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*APICreateCollectionResponse) UnmarshalBinary

func (m *APICreateCollectionResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*APICreateCollectionResponse) Validate

func (m *APICreateCollectionResponse) Validate(formats strfmt.Registry) error

Validate validates this api create collection response

type APICreateDocumentResponse

type APICreateDocumentResponse struct {

	// metadata
	Metadata *APIDataMetadata `json:"Metadata,omitempty"`
}

APICreateDocumentResponse api create document response

swagger:model apiCreateDocumentResponse

func (*APICreateDocumentResponse) ContextValidate

func (m *APICreateDocumentResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validate this api create document response based on the context it is used

func (*APICreateDocumentResponse) MarshalBinary

func (m *APICreateDocumentResponse) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*APICreateDocumentResponse) UnmarshalBinary

func (m *APICreateDocumentResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*APICreateDocumentResponse) Validate

func (m *APICreateDocumentResponse) Validate(formats strfmt.Registry) error

Validate validates this api create document response

type APIDataFormat

type APIDataFormat string

APIDataFormat api data format

swagger:model apiDataFormat

const (

	// APIDataFormatDATAFORMATUNKNOWN captures enum value "DATA_FORMAT_UNKNOWN"
	APIDataFormatDATAFORMATUNKNOWN APIDataFormat = "DATA_FORMAT_UNKNOWN"

	// APIDataFormatDATAFORMATAUTO captures enum value "DATA_FORMAT_AUTO"
	APIDataFormatDATAFORMATAUTO APIDataFormat = "DATA_FORMAT_AUTO"

	// APIDataFormatDATAFORMATJSON captures enum value "DATA_FORMAT_JSON"
	APIDataFormatDATAFORMATJSON APIDataFormat = "DATA_FORMAT_JSON"

	// APIDataFormatDATAFORMATCSV captures enum value "DATA_FORMAT_CSV"
	APIDataFormatDATAFORMATCSV APIDataFormat = "DATA_FORMAT_CSV"

	// APIDataFormatDATAFORMATXML captures enum value "DATA_FORMAT_XML"
	APIDataFormatDATAFORMATXML APIDataFormat = "DATA_FORMAT_XML"

	// APIDataFormatDATAFORMATURL captures enum value "DATA_FORMAT_URL"
	APIDataFormatDATAFORMATURL APIDataFormat = "DATA_FORMAT_URL"

	// APIDataFormatDATAFORMATMEDIA captures enum value "DATA_FORMAT_MEDIA"
	APIDataFormatDATAFORMATMEDIA APIDataFormat = "DATA_FORMAT_MEDIA"
)

func NewAPIDataFormat

func NewAPIDataFormat(value APIDataFormat) *APIDataFormat

func (APIDataFormat) ContextValidate

func (m APIDataFormat) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validates this api data format based on context it is used

func (APIDataFormat) Pointer

func (m APIDataFormat) Pointer() *APIDataFormat

Pointer returns a pointer to a freshly-allocated APIDataFormat.

func (APIDataFormat) Validate

func (m APIDataFormat) Validate(formats strfmt.Registry) error

Validate validates this api data format

type APIDataMetadata

type APIDataMetadata struct {

	// ts when the record was created
	// Format: date-time
	CreatedAt strfmt.DateTime `json:"CreatedAt,omitempty"`

	// Who created the document, and who last wrote it.
	//
	// Two fields rather than one because writing an existing documentId is an
	// UPSERT: with only a creator, a document overwritten by a DIFFERENT
	// principal would still report the original author and the second write
	// would be invisible. "A created this, B replaced its contents" is the
	// question these exist to answer.
	//
	// _createdBy is set once, on insert, and never moves - it pairs with
	// _createdAt. _updatedBy is rewritten on every write, pairing with
	// _updatedAt. The two move independently for the same reason the two
	// timestamps do.
	//
	// EMPTY MEANS UNATTRIBUTED, not anonymous-and-fine. A deployment whose
	// caller resolver is not wired records no writer, and an empty value here
	// says exactly that rather than inventing a principal.
	CreatedBy string `json:"CreatedBy,omitempty"`

	// ts when the record was deleted
	// Format: date-time
	DeletedAt strfmt.DateTime `json:"DeletedAt,omitempty"`

	// ts when the record was last written.
	//
	// Writing a document that already exists is an UPSERT - CreateDocument with
	// an existing documentId replaces the payload - and there is no separate
	// Update rpc. Without this field an overwritten document is
	// indistinguishable from one written once, in both content and metadata, so
	// a caller cannot tell that its data was replaced or when.
	//
	// NOT a new column: ModelDocument has carried `updated_at` all along and
	// gorm has been maintaining it on every write. This only surfaces what the
	// database already records.
	//
	// Non-optional, matching _createdAt rather than _deletedAt: gorm sets
	// updated_at on create as well as on update, so every document has one. On
	// a document that has never been rewritten it equals _createdAt.
	// Format: date-time
	UpdatedAt strfmt.DateTime `json:"UpdatedAt,omitempty"`

	// updated by
	UpdatedBy string `json:"UpdatedBy,omitempty"`

	// collectionId is collection id from collection data
	CollectionID string `json:"collectionId,omitempty"`

	// dataformat
	Dataformat *APIDataFormat `json:"dataformat,omitempty"`

	// did (aka dataid) would be used to naming ${documentId} field, that field should be url safe
	DocumentID string `json:"documentId,omitempty"`

	// projectId is project id
	ProjectID string `json:"projectId,omitempty"`

	// schemaId is the schema index stored in collection
	SchemaID string `json:"schemaId,omitempty"`
}

APIDataMetadata api data metadata

swagger:model apiDataMetadata

func (*APIDataMetadata) ContextValidate

func (m *APIDataMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validate this api data metadata based on the context it is used

func (*APIDataMetadata) MarshalBinary

func (m *APIDataMetadata) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*APIDataMetadata) UnmarshalBinary

func (m *APIDataMetadata) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*APIDataMetadata) Validate

func (m *APIDataMetadata) Validate(formats strfmt.Registry) error

Validate validates this api data metadata

type APIDeleteCollectionResponse

type APIDeleteCollectionResponse any

APIDeleteCollectionResponse api delete collection response

swagger:model apiDeleteCollectionResponse

type APIDeleteDocumentResponse

type APIDeleteDocumentResponse any

APIDeleteDocumentResponse api delete document response

swagger:model apiDeleteDocumentResponse

type APIGetCollectionResponse

type APIGetCollectionResponse struct {

	// metadata
	Metadata *APICollectionMetadata `json:"Metadata,omitempty"`

	// collection type
	CollectionType *APICollectionType `json:"collectionType,omitempty"`

	// description
	Description string `json:"description,omitempty"`

	// schemas
	Schemas []*APISchemaField `json:"schemas"`
}

APIGetCollectionResponse api get collection response

swagger:model apiGetCollectionResponse

func (*APIGetCollectionResponse) ContextValidate

func (m *APIGetCollectionResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validate this api get collection response based on the context it is used

func (*APIGetCollectionResponse) MarshalBinary

func (m *APIGetCollectionResponse) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*APIGetCollectionResponse) UnmarshalBinary

func (m *APIGetCollectionResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*APIGetCollectionResponse) Validate

func (m *APIGetCollectionResponse) Validate(formats strfmt.Registry) error

Validate validates this api get collection response

type APIGetDocumentResponse

type APIGetDocumentResponse struct {

	// metadata
	Metadata *APIDataMetadata `json:"Metadata,omitempty"`

	// data
	Data any `json:"data,omitempty"`
}

APIGetDocumentResponse api get document response

swagger:model apiGetDocumentResponse

func (*APIGetDocumentResponse) ContextValidate

func (m *APIGetDocumentResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validate this api get document response based on the context it is used

func (*APIGetDocumentResponse) MarshalBinary

func (m *APIGetDocumentResponse) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*APIGetDocumentResponse) UnmarshalBinary

func (m *APIGetDocumentResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*APIGetDocumentResponse) Validate

func (m *APIGetDocumentResponse) Validate(formats strfmt.Registry) error

Validate validates this api get document response

type APIHTTPBody

type APIHTTPBody struct {

	// The HTTP Content-Type header value specifying the content type of the body.
	ContentType string `json:"contentType,omitempty"`

	// The HTTP request/response body as raw binary.
	// Format: byte
	Data strfmt.Base64 `json:"data,omitempty"`

	// Application specific response metadata. Must be set in the first response
	// for streaming APIs.
	Extensions []*ProtobufAny `json:"extensions"`
}

APIHTTPBody Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page.

This message can be used both in streaming and non-streaming API methods in the request as well as the response.

It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body.

Example:

message GetResourceRequest {
  // A unique request id.
  string request_id = 1;

  // The raw HTTP body is bound to this field.
  google.api.HttpBody http_body = 2;

}

service ResourceService {
  rpc GetResource(GetResourceRequest)
    returns (google.api.HttpBody);
  rpc UpdateResource(google.api.HttpBody)
    returns (google.protobuf.Empty);

}

Example with streaming methods:

service CaldavService {
  rpc GetCalendar(stream google.api.HttpBody)
    returns (stream google.api.HttpBody);
  rpc UpdateCalendar(stream google.api.HttpBody)
    returns (stream google.api.HttpBody);

}

Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.

swagger:model apiHttpBody

func (*APIHTTPBody) ContextValidate

func (m *APIHTTPBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validate this api Http body based on the context it is used

func (*APIHTTPBody) MarshalBinary

func (m *APIHTTPBody) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*APIHTTPBody) UnmarshalBinary

func (m *APIHTTPBody) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*APIHTTPBody) Validate

func (m *APIHTTPBody) Validate(formats strfmt.Registry) error

Validate validates this api Http body

type APIListCollectionsResponse

type APIListCollectionsResponse struct {

	// The project's collections, newest first.
	//
	// Deliberately the SAME message the single-collection GET returns, rather
	// than a slimmer summary type. ListByProjectID already preloads each
	// collection's latest schema and its fields - a summary type would throw
	// away data that has already been read, and would give a client two shapes
	// to parse for one resource, which is how the two drift.
	//
	// "Latest schema" is also what makes this a list of COLLECTIONS and not of
	// collection-versions: the storage query limits the preload to one schema
	// per collection.
	//
	// No pagination fields yet. Adding them later is backwards-compatible in
	// proto3; shipping page_size and page_token that nothing honours is not -
	// it tells a client the endpoint is paginated when it is not.
	Collections []*APIGetCollectionResponse `json:"collections"`
}

APIListCollectionsResponse api list collections response

swagger:model apiListCollectionsResponse

func (*APIListCollectionsResponse) ContextValidate

func (m *APIListCollectionsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validate this api list collections response based on the context it is used

func (*APIListCollectionsResponse) MarshalBinary

func (m *APIListCollectionsResponse) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*APIListCollectionsResponse) UnmarshalBinary

func (m *APIListCollectionsResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*APIListCollectionsResponse) Validate

func (m *APIListCollectionsResponse) Validate(formats strfmt.Registry) error

Validate validates this api list collections response

type APIQueryDocumentResponse

type APIQueryDocumentResponse struct {

	// docs
	Docs []*APIGetDocumentResponse `json:"docs"`
}

APIQueryDocumentResponse api query document response

swagger:model apiQueryDocumentResponse

func (*APIQueryDocumentResponse) ContextValidate

func (m *APIQueryDocumentResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validate this api query document response based on the context it is used

func (*APIQueryDocumentResponse) MarshalBinary

func (m *APIQueryDocumentResponse) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*APIQueryDocumentResponse) UnmarshalBinary

func (m *APIQueryDocumentResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*APIQueryDocumentResponse) Validate

func (m *APIQueryDocumentResponse) Validate(formats strfmt.Registry) error

Validate validates this api query document response

type APISchemaField

type APISchemaField struct {

	// datatype
	Datatype *APISchemaFieldDataType `json:"datatype,omitempty"`

	// example
	Example any `json:"example,omitempty"`

	// name
	Name string `json:"name,omitempty"`
}

APISchemaField api schema field

swagger:model apiSchemaField

func (*APISchemaField) ContextValidate

func (m *APISchemaField) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validate this api schema field based on the context it is used

func (*APISchemaField) MarshalBinary

func (m *APISchemaField) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*APISchemaField) UnmarshalBinary

func (m *APISchemaField) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*APISchemaField) Validate

func (m *APISchemaField) Validate(formats strfmt.Registry) error

Validate validates this api schema field

type APISchemaFieldDataType

type APISchemaFieldDataType string

APISchemaFieldDataType api schema field data type

swagger:model apiSchemaFieldDataType

const (

	// APISchemaFieldDataTypeSCHEMAFIELDDATATYPENONE captures enum value "SCHEMA_FIELD_DATA_TYPE_NONE"
	APISchemaFieldDataTypeSCHEMAFIELDDATATYPENONE APISchemaFieldDataType = "SCHEMA_FIELD_DATA_TYPE_NONE"

	// APISchemaFieldDataTypeSCHEMAFIELDDATATYPESTRING captures enum value "SCHEMA_FIELD_DATA_TYPE_STRING"
	APISchemaFieldDataTypeSCHEMAFIELDDATATYPESTRING APISchemaFieldDataType = "SCHEMA_FIELD_DATA_TYPE_STRING"

	// APISchemaFieldDataTypeSCHEMAFIELDDATATYPENUMBER captures enum value "SCHEMA_FIELD_DATA_TYPE_NUMBER"
	APISchemaFieldDataTypeSCHEMAFIELDDATATYPENUMBER APISchemaFieldDataType = "SCHEMA_FIELD_DATA_TYPE_NUMBER"

	// APISchemaFieldDataTypeSCHEMAFIELDDATATYPEINTEGER captures enum value "SCHEMA_FIELD_DATA_TYPE_INTEGER"
	APISchemaFieldDataTypeSCHEMAFIELDDATATYPEINTEGER APISchemaFieldDataType = "SCHEMA_FIELD_DATA_TYPE_INTEGER"

	// APISchemaFieldDataTypeSCHEMAFIELDDATATYPEBOOL captures enum value "SCHEMA_FIELD_DATA_TYPE_BOOL"
	APISchemaFieldDataTypeSCHEMAFIELDDATATYPEBOOL APISchemaFieldDataType = "SCHEMA_FIELD_DATA_TYPE_BOOL"

	// APISchemaFieldDataTypeSCHEMAFIELDDATATYPEOBJECT captures enum value "SCHEMA_FIELD_DATA_TYPE_OBJECT"
	APISchemaFieldDataTypeSCHEMAFIELDDATATYPEOBJECT APISchemaFieldDataType = "SCHEMA_FIELD_DATA_TYPE_OBJECT"

	// APISchemaFieldDataTypeSCHEMAFIELDDATATYPEARRAY captures enum value "SCHEMA_FIELD_DATA_TYPE_ARRAY"
	APISchemaFieldDataTypeSCHEMAFIELDDATATYPEARRAY APISchemaFieldDataType = "SCHEMA_FIELD_DATA_TYPE_ARRAY"
)

func NewAPISchemaFieldDataType

func NewAPISchemaFieldDataType(value APISchemaFieldDataType) *APISchemaFieldDataType

func (APISchemaFieldDataType) ContextValidate

func (m APISchemaFieldDataType) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validates this api schema field data type based on context it is used

func (APISchemaFieldDataType) Pointer

Pointer returns a pointer to a freshly-allocated APISchemaFieldDataType.

func (APISchemaFieldDataType) Validate

func (m APISchemaFieldDataType) Validate(formats strfmt.Registry) error

Validate validates this api schema field data type

type ProtobufAny

type ProtobufAny struct {

	// A URL/resource name that uniquely identifies the type of the serialized
	// protocol buffer message. This string must contain at least
	// one "/" character. The last segment of the URL's path must represent
	// the fully qualified name of the type (as in
	// `path/google.protobuf.Duration`). The name should be in a canonical form
	// (e.g., leading "." is not accepted).
	//
	// In practice, teams usually precompile into the binary all types that they
	// expect it to use in the context of Any. However, for URLs which use the
	// scheme `http`, `https`, or no scheme, one can optionally set up a type
	// server that maps type URLs to message definitions as follows:
	//
	// * If no scheme is provided, `https` is assumed.
	// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
	//   value in binary format, or produce an error.
	// * Applications are allowed to cache lookup results based on the
	//   URL, or have them precompiled into a binary to avoid any
	//   lookup. Therefore, binary compatibility needs to be preserved
	//   on changes to types. (Use versioned type names to manage
	//   breaking changes.)
	//
	// Note: this functionality is not currently available in the official
	// protobuf release, and it is not used for type URLs beginning with
	// type.googleapis.com. As of May 2023, there are no widely used type server
	// implementations and no plans to implement one.
	//
	// Schemes other than `http`, `https` (or the empty scheme) might be
	// used with implementation specific semantics.
	AtType string `json:"@type,omitempty"`

	// protobuf any
	ProtobufAny map[string]any `json:"-"`
}

ProtobufAny `Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message.

Protobuf library provides support to pack/unpack Any values in the form of utility functions or additional generated methods of the Any type.

Example 1: Pack and unpack a message in C++.

Foo foo = ...;
Any any;
any.PackFrom(foo);
...
if (any.UnpackTo(&foo)) {
  ...
}

Example 2: Pack and unpack a message in Java.

   Foo foo = ...;
   Any any = Any.pack(foo);
   ...
   if (any.is(Foo.class)) {
     foo = any.unpack(Foo.class);
   }
   // or ...
   if (any.isSameTypeAs(Foo.getDefaultInstance())) {
     foo = any.unpack(Foo.getDefaultInstance());
   }

Example 3: Pack and unpack a message in Python.

   foo = Foo(...)
   any = Any()
   any.Pack(foo)
   ...
   if any.Is(Foo.DESCRIPTOR):
     any.Unpack(foo)
     ...

Example 4: Pack and unpack a message in Go

    foo := &pb.Foo{...}
    any, err := anypb.New(foo)
    if err != nil {
      ...
    }
    ...
    foo := &pb.Foo{}
    if err := any.UnmarshalTo(foo); err != nil {
      ...
    }

The pack methods provided by protobuf library will by default use 'type.googleapis.com/full.type.name' as the type URL and the unpack methods only use the fully qualified type name after the last '/' in the type URL, for example "foo.bar.com/x/y.z" will yield type name "y.z".

JSON ==== The JSON representation of an `Any` value uses the regular representation of the deserialized, embedded message, with an additional field `@type` which contains the type URL. Example:

package google.profile;
message Person {
  string first_name = 1;
  string last_name = 2;
}

{
  "@type": "type.googleapis.com/google.profile.Person",
  "firstName": <string>,
  "lastName": <string>
}

If the embedded message type is well-known and has a custom JSON representation, that representation will be embedded adding a field `value` which holds the custom JSON in addition to the `@type` field. Example (for message [google.protobuf.Duration][]):

{
  "@type": "type.googleapis.com/google.protobuf.Duration",
  "value": "1.212s"
}

swagger:model protobufAny

func (*ProtobufAny) ContextValidate

func (m *ProtobufAny) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validates this protobuf any based on context it is used

func (*ProtobufAny) MarshalBinary

func (m *ProtobufAny) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (ProtobufAny) MarshalJSON

func (m ProtobufAny) MarshalJSON() ([]byte, error)

MarshalJSON marshals this object with additional properties into a JSON object

func (*ProtobufAny) UnmarshalBinary

func (m *ProtobufAny) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*ProtobufAny) UnmarshalJSON

func (m *ProtobufAny) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals this object with additional properties from JSON

func (*ProtobufAny) Validate

func (m *ProtobufAny) Validate(formats strfmt.Registry) error

Validate validates this protobuf any

type ProtobufNullValue

type ProtobufNullValue string

ProtobufNullValue `NullValue` is a singleton enumeration to represent the null value for the `Value` type union.

The JSON representation for `NullValue` is JSON `null`.

  • NULL_VALUE: Null value.

swagger:model protobufNullValue

const (

	// ProtobufNullValueNULLVALUE captures enum value "NULL_VALUE"
	ProtobufNullValueNULLVALUE ProtobufNullValue = "NULL_VALUE"
)

func NewProtobufNullValue

func NewProtobufNullValue(value ProtobufNullValue) *ProtobufNullValue

func (ProtobufNullValue) ContextValidate

func (m ProtobufNullValue) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validates this protobuf null value based on context it is used

func (ProtobufNullValue) Pointer

func (m ProtobufNullValue) Pointer() *ProtobufNullValue

Pointer returns a pointer to a freshly-allocated ProtobufNullValue.

func (ProtobufNullValue) Validate

func (m ProtobufNullValue) Validate(formats strfmt.Registry) error

Validate validates this protobuf null value

type RPCStatus

type RPCStatus struct {

	// code
	Code int32 `json:"code,omitempty"`

	// details
	Details []*ProtobufAny `json:"details"`

	// message
	Message string `json:"message,omitempty"`
}

RPCStatus rpc status

swagger:model rpcStatus

func (*RPCStatus) ContextValidate

func (m *RPCStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validate this rpc status based on the context it is used

func (*RPCStatus) MarshalBinary

func (m *RPCStatus) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*RPCStatus) UnmarshalBinary

func (m *RPCStatus) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*RPCStatus) Validate

func (m *RPCStatus) Validate(formats strfmt.Registry) error

Validate validates this rpc status

type RestColServiceCreateCollectionBody

type RestColServiceCreateCollectionBody struct {

	// collection Id
	CollectionID string `json:"collectionId,omitempty"`

	// collection type
	CollectionType *APICollectionType `json:"collectionType,omitempty"`

	// description
	Description string `json:"description,omitempty"`

	// schemas
	Schemas []*APISchemaField `json:"schemas"`
}

RestColServiceCreateCollectionBody rest col service create collection body

swagger:model RestColServiceCreateCollectionBody

func (*RestColServiceCreateCollectionBody) ContextValidate

func (m *RestColServiceCreateCollectionBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validate this rest col service create collection body based on the context it is used

func (*RestColServiceCreateCollectionBody) MarshalBinary

func (m *RestColServiceCreateCollectionBody) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*RestColServiceCreateCollectionBody) UnmarshalBinary

func (m *RestColServiceCreateCollectionBody) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*RestColServiceCreateCollectionBody) Validate

Validate validates this rest col service create collection body

type RestColServiceCreateDocumentBody

type RestColServiceCreateDocumentBody struct {

	// data represents rawdata for any kind of formating
	// Format: byte
	Data strfmt.Base64 `json:"data,omitempty"`

	// dataformat
	Dataformat *APIDataFormat `json:"dataformat,omitempty"`

	// document Id
	DocumentID string `json:"documentId,omitempty"`
}

RestColServiceCreateDocumentBody rest col service create document body

swagger:model RestColServiceCreateDocumentBody

func (*RestColServiceCreateDocumentBody) ContextValidate

func (m *RestColServiceCreateDocumentBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validate this rest col service create document body based on the context it is used

func (*RestColServiceCreateDocumentBody) MarshalBinary

func (m *RestColServiceCreateDocumentBody) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*RestColServiceCreateDocumentBody) UnmarshalBinary

func (m *RestColServiceCreateDocumentBody) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*RestColServiceCreateDocumentBody) Validate

Validate validates this rest col service create document body

Jump to

Keyboard shortcuts

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