4.2 KiB
4.2 KiB
\CollectionAPI
All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| AnswerApiV1CollectionSwitchPost | Post /answer/api/v1/collection/switch | add collection |
| AnswerApiV1PersonalCollectionPageGet | Get /answer/api/v1/personal/collection/page | list personal collections |
AnswerApiV1CollectionSwitchPost
AnswerApiV1CollectionSwitchPost200Response AnswerApiV1CollectionSwitchPost(ctx).Data(data).Execute()
add collection
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "git.ncc.cx/package/openapi-go-answer"
)
func main() {
data := *openapiclient.NewSchemaCollectionSwitchReq("GroupId_example", "ObjectId_example") // SchemaCollectionSwitchReq | collection
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CollectionAPI.AnswerApiV1CollectionSwitchPost(context.Background()).Data(data).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CollectionAPI.AnswerApiV1CollectionSwitchPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AnswerApiV1CollectionSwitchPost`: AnswerApiV1CollectionSwitchPost200Response
fmt.Fprintf(os.Stdout, "Response from `CollectionAPI.AnswerApiV1CollectionSwitchPost`: %v\n", resp)
}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiAnswerApiV1CollectionSwitchPostRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| data | SchemaCollectionSwitchReq | collection |
Return type
AnswerApiV1CollectionSwitchPost200Response
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AnswerApiV1PersonalCollectionPageGet
HandlerRespBody AnswerApiV1PersonalCollectionPageGet(ctx).Page(page).PageSize(pageSize).Execute()
list personal collections
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "git.ncc.cx/package/openapi-go-answer"
)
func main() {
page := "page_example" // string | page (default to "0")
pageSize := "pageSize_example" // string | page_size (default to "20")
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.CollectionAPI.AnswerApiV1PersonalCollectionPageGet(context.Background()).Page(page).PageSize(pageSize).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `CollectionAPI.AnswerApiV1PersonalCollectionPageGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AnswerApiV1PersonalCollectionPageGet`: HandlerRespBody
fmt.Fprintf(os.Stdout, "Response from `CollectionAPI.AnswerApiV1PersonalCollectionPageGet`: %v\n", resp)
}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiAnswerApiV1PersonalCollectionPageGetRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| page | string | page | [default to "0"] |
| pageSize | string | page_size | [default to "20"] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]