Documentation ¶
Index ¶
- type APIError
- type Api
- type DefaultApi
- type DefaultSavedObjectApi
- func (h DefaultSavedObjectApi) BulkCreate(tenantId string, overwrite bool, bulks []Object) (createdObjects []Object, err error)
- func (h DefaultSavedObjectApi) BulkGet(tenantId string, bulks []SavedObjectBulkGetOption) (objects []Object, err error)
- func (h DefaultSavedObjectApi) Create(tenantId string, object *Object, overwrite bool) (createdObject *Object, err error)
- func (h DefaultSavedObjectApi) Delete(tenantId string, objectType string, objectId string, force bool) (err error)
- func (h DefaultSavedObjectApi) Export(tenantId string, option SavedObjectExportOption) (data []byte, err error)
- func (h DefaultSavedObjectApi) Find(tenantId string, option SavedObjectFindOption) (objects []Object, err error)
- func (h DefaultSavedObjectApi) Get(tenantId string, objectType string, objectId string) (object *Object, err error)
- func (h DefaultSavedObjectApi) Import(tenantId string, option SavedObjectImportOption, data []byte) (res map[string]any, err error)
- func (h DefaultSavedObjectApi) Update(tenantId string, object *Object) (updatedObject *Object, err error)
- type DefaultShortenUrlApi
- type DefaultStatusApi
- type Object
- type SavedObjectApi
- type SavedObjectBulkGetOption
- type SavedObjectBulkResponse
- type SavedObjectExportOption
- type SavedObjectFindOption
- type SavedObjectFindResponse
- type SavedObjectImportOption
- type ShortenUrlApi
- type ShortenUrlApiCreatePayload
- type ShortenUrlApiCreateResponse
- type StatusApi
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
APIError is the error object
func NewAPIError ¶
NewAPIError create new API error with code and message
type Api ¶
type Api interface { SavedObject() SavedObjectApi ShortenUrl() ShortenUrlApi Status() StatusApi Client() *resty.Client }
Api is the main API interface
type DefaultApi ¶
type DefaultApi struct {
// contains filtered or unexported fields
}
DefaultApi is the default implementation of Api interface
func (DefaultApi) Client ¶
func (h DefaultApi) Client() *resty.Client
func (DefaultApi) SavedObject ¶
func (h DefaultApi) SavedObject() SavedObjectApi
func (DefaultApi) ShortenUrl ¶
func (h DefaultApi) ShortenUrl() ShortenUrlApi
func (DefaultApi) Status ¶
func (h DefaultApi) Status() StatusApi
type DefaultSavedObjectApi ¶
type DefaultSavedObjectApi struct {
// contains filtered or unexported fields
}
DefaultSavedObjectApi is the default implementation of SavedObjectApi interface
func (DefaultSavedObjectApi) BulkCreate ¶
func (DefaultSavedObjectApi) BulkGet ¶
func (h DefaultSavedObjectApi) BulkGet(tenantId string, bulks []SavedObjectBulkGetOption) (objects []Object, err error)
func (DefaultSavedObjectApi) Export ¶
func (h DefaultSavedObjectApi) Export(tenantId string, option SavedObjectExportOption) (data []byte, err error)
func (DefaultSavedObjectApi) Find ¶
func (h DefaultSavedObjectApi) Find(tenantId string, option SavedObjectFindOption) (objects []Object, err error)
func (DefaultSavedObjectApi) Import ¶
func (h DefaultSavedObjectApi) Import(tenantId string, option SavedObjectImportOption, data []byte) (res map[string]any, err error)
type DefaultShortenUrlApi ¶
type DefaultShortenUrlApi struct {
// contains filtered or unexported fields
}
DefaultShortenUrlApi is the default implementation of ShortenUrlApi interface
type DefaultStatusApi ¶
type DefaultStatusApi struct {
// contains filtered or unexported fields
}
DefaultStatusApi is the default implementation of StatusApi interface
type Object ¶
type Object struct { Type string `json:"type,omitempty"` Id string `json:"id,omitempty"` Attributes map[string]any `json:"attributes"` References []map[string]any `json:"references,omitempty"` Version string `json:"version,omitempty"` CoreMigrationVersion string `json:"coreMigrationVersion,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` MigrationVersion map[string]any `json:"migrationVersion,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` OriginId string `json:"originId,omitempty"` }
Object is the object data
type SavedObjectApi ¶
type SavedObjectApi interface { Get(tenantId string, objectType string, objectId string) (object *Object, err error) BulkGet(tenantId string, bulks []SavedObjectBulkGetOption) (objects []Object, err error) Find(tenantId string, option SavedObjectFindOption) (objects []Object, err error) Create(tenantId string, object *Object, overwrite bool) (createdObject *Object, err error) BulkCreate(tenantId string, overwrite bool, bulks []Object) (createdObjects []Object, err error) Update(tenantId string, object *Object) (updatedObject *Object, err error) Delete(tenantId string, objectType string, objectId string, force bool) (err error) Export(tenantId string, option SavedObjectExportOption) (data []byte, err error) Import(tenantId string, option SavedObjectImportOption, data []byte) (res map[string]any, err error) }
SavedObjectApi is the interface to call with saved object API
func NewSavedObjectApi ¶
func NewSavedObjectApi(client *resty.Client) SavedObjectApi
NewSavedObjectApi permit to get default implementation of SavedObjectApi interface
type SavedObjectBulkGetOption ¶
type SavedObjectBulkGetOption struct { Type string `json:"type"` Id string `json:"id"` Fields []string `json:"fields,omitempty"` }
SavedObjectBulkGetOption is the option when call bulk get API
type SavedObjectBulkResponse ¶
type SavedObjectBulkResponse struct {
SavedObjects []Object `json:"saved_objects"`
}
SavedObjectBulkCreateResponse is the repsonse when call bulk create API
type SavedObjectExportOption ¶
type SavedObjectExportOption struct { Type string `json:"type,omitempty"` Objects []SavedObjectBulkGetOption `json:"objects,omitempty"` IncludeReferencesDeep *bool `json:"includeReferencesDeep,omitempty"` ExcludeExportDetails *bool `json:"excludeExportDetails,omitempty"` }
SavedObjectExportOption the option when call export API
type SavedObjectFindOption ¶
type SavedObjectFindOption struct { Type string `json:"type"` PerPage int `json:"per_page,omitempty"` Page int `json:"page,omitempty"` Search string `json:"search,omitempty"` DefaultSearchOperator string `json:"default_search_operator,omitempty"` SearchFields []string `json:"search_fields,omitempty"` Fields []string `json:"fields,omitempty"` SortField string `json:"sort_field,omitempty"` HasReference string `json:"has_reference,omitempty"` Filter string `json:"filter,omitempty"` }
SavedObjectFindOption is the option when call find API
type SavedObjectFindResponse ¶
type SavedObjectFindResponse struct { Total int64 `json:"total"` SavedObjects []Object `json:"saved_objects"` }
SavedObjectFindResponse is the response when cal find API
type SavedObjectImportOption ¶
type SavedObjectImportOption struct { CreateNewCopies bool `json:"createNewCopies,omitempty"` Overwrite bool `json:"overwrite,omitempty"` }
SavedObjectImportOption is the option when call import API
type ShortenUrlApi ¶
ShortenUrlApi is the interface to call with shorten API
func NewShortenUrlApi ¶
func NewShortenUrlApi(client *resty.Client) ShortenUrlApi
NewShortenUrlApi permit to get default implementation of ShortenUrlApi interface
type ShortenUrlApiCreatePayload ¶
type ShortenUrlApiCreatePayload struct {
Url string `json:"url"`
}
ShortenUrlApiCreatePayload is the payload to send when create shorten URL
type ShortenUrlApiCreateResponse ¶
type ShortenUrlApiCreateResponse struct {
UrlId string `json:"urlId"`
}
ShortenUrlApiCreateResponse is the response when create shorten URL