import 'package:halo_client/api.dart';
All URIs are relative to http://localhost:8091
Method | HTTP request | Description |
---|---|---|
createMyPost | POST /apis/uc.api.content.halo.run/v1alpha1/posts | |
getMyPost | GET /apis/uc.api.content.halo.run/v1alpha1/posts/{name} | |
getMyPostDraft | GET /apis/uc.api.content.halo.run/v1alpha1/posts/{name}/draft | |
listMyPosts | GET /apis/uc.api.content.halo.run/v1alpha1/posts | |
publishMyPost | PUT /apis/uc.api.content.halo.run/v1alpha1/posts/{name}/publish | |
recycleMyPost | DELETE /apis/uc.api.content.halo.run/v1alpha1/posts/{name}/recycle | |
unpublishMyPost | PUT /apis/uc.api.content.halo.run/v1alpha1/posts/{name}/unpublish | |
updateMyPost | PUT /apis/uc.api.content.halo.run/v1alpha1/posts/{name} | |
updateMyPostDraft | PUT /apis/uc.api.content.halo.run/v1alpha1/posts/{name}/draft |
Post createMyPost(post)
Create my post. If you want to create a post with content, please set annotation: "content.halo.run/content-json" into annotations and refer to Content for corresponding data type.
import 'package:halo_client/api.dart';
// TODO Configure HTTP basic authorization: basicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').password = 'YOUR_PASSWORD';
final api = HaloClient().getPostV1alpha1UcApi();
final Post post = ; // Post |
try {
final response = api.createMyPost(post);
print(response);
} catch on DioException (e) {
print('Exception when calling PostV1alpha1UcApi->createMyPost: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
post | Post | [optional] |
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Post getMyPost(name)
Get post that belongs to the current user.
import 'package:halo_client/api.dart';
// TODO Configure HTTP basic authorization: basicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').password = 'YOUR_PASSWORD';
final api = HaloClient().getPostV1alpha1UcApi();
final String name = name_example; // String | Post name
try {
final response = api.getMyPost(name);
print(response);
} catch on DioException (e) {
print('Exception when calling PostV1alpha1UcApi->getMyPost: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | Post name |
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Snapshot getMyPostDraft(name, patched)
Get my post draft.
import 'package:halo_client/api.dart';
// TODO Configure HTTP basic authorization: basicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').password = 'YOUR_PASSWORD';
final api = HaloClient().getPostV1alpha1UcApi();
final String name = name_example; // String | Post name
final bool patched = true; // bool | Should include patched content and raw or not.
try {
final response = api.getMyPostDraft(name, patched);
print(response);
} catch on DioException (e) {
print('Exception when calling PostV1alpha1UcApi->getMyPostDraft: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | Post name | |
patched | bool | Should include patched content and raw or not. | [optional] |
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListedPostList listMyPosts(page, size, labelSelector, fieldSelector, sort, publishPhase, keyword, categoryWithChildren)
List posts owned by the current user.
import 'package:halo_client/api.dart';
// TODO Configure HTTP basic authorization: basicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').password = 'YOUR_PASSWORD';
final api = HaloClient().getPostV1alpha1UcApi();
final int page = 56; // int | Page number. Default is 0.
final int size = 56; // int | Size number. Default is 0.
final BuiltList<String> labelSelector = ; // BuiltList<String> | Label selector. e.g.: hidden!=true
final BuiltList<String> fieldSelector = ; // BuiltList<String> | Field selector. e.g.: metadata.name==halo
final BuiltList<String> sort = ; // BuiltList<String> | Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
final String publishPhase = publishPhase_example; // String | Posts filtered by publish phase.
final String keyword = keyword_example; // String | Posts filtered by keyword.
final String categoryWithChildren = categoryWithChildren_example; // String | Posts filtered by category including sub-categories.
try {
final response = api.listMyPosts(page, size, labelSelector, fieldSelector, sort, publishPhase, keyword, categoryWithChildren);
print(response);
} catch on DioException (e) {
print('Exception when calling PostV1alpha1UcApi->listMyPosts: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
page | int | Page number. Default is 0. | [optional] |
size | int | Size number. Default is 0. | [optional] |
labelSelector | BuiltList<String> | Label selector. e.g.: hidden!=true | [optional] |
fieldSelector | BuiltList<String> | Field selector. e.g.: metadata.name==halo | [optional] |
sort | BuiltList<String> | Sorting criteria in the format: property,(asc | desc). Default sort order is ascending. Multiple sort criteria are supported. |
publishPhase | String | Posts filtered by publish phase. | [optional] |
keyword | String | Posts filtered by keyword. | [optional] |
categoryWithChildren | String | Posts filtered by category including sub-categories. | [optional] |
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Post publishMyPost(name)
Publish my post.
import 'package:halo_client/api.dart';
// TODO Configure HTTP basic authorization: basicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').password = 'YOUR_PASSWORD';
final api = HaloClient().getPostV1alpha1UcApi();
final String name = name_example; // String | Post name
try {
final response = api.publishMyPost(name);
print(response);
} catch on DioException (e) {
print('Exception when calling PostV1alpha1UcApi->publishMyPost: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | Post name |
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Post recycleMyPost(name)
Move my post to recycle bin.
import 'package:halo_client/api.dart';
// TODO Configure HTTP basic authorization: basicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').password = 'YOUR_PASSWORD';
final api = HaloClient().getPostV1alpha1UcApi();
final String name = name_example; // String | Post name
try {
final response = api.recycleMyPost(name);
print(response);
} catch on DioException (e) {
print('Exception when calling PostV1alpha1UcApi->recycleMyPost: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | Post name |
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Post unpublishMyPost(name)
Unpublish my post.
import 'package:halo_client/api.dart';
// TODO Configure HTTP basic authorization: basicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').password = 'YOUR_PASSWORD';
final api = HaloClient().getPostV1alpha1UcApi();
final String name = name_example; // String | Post name
try {
final response = api.unpublishMyPost(name);
print(response);
} catch on DioException (e) {
print('Exception when calling PostV1alpha1UcApi->unpublishMyPost: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | Post name |
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Post updateMyPost(name, post)
Update my post.
import 'package:halo_client/api.dart';
// TODO Configure HTTP basic authorization: basicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').password = 'YOUR_PASSWORD';
final api = HaloClient().getPostV1alpha1UcApi();
final String name = name_example; // String | Post name
final Post post = ; // Post |
try {
final response = api.updateMyPost(name, post);
print(response);
} catch on DioException (e) {
print('Exception when calling PostV1alpha1UcApi->updateMyPost: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | Post name | |
post | Post | [optional] |
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Snapshot updateMyPostDraft(name, snapshot)
Update draft of my post. Please make sure set annotation: "content.halo.run/content-json" into annotations and refer to Content for corresponding data type.
import 'package:halo_client/api.dart';
// TODO Configure HTTP basic authorization: basicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').password = 'YOUR_PASSWORD';
final api = HaloClient().getPostV1alpha1UcApi();
final String name = name_example; // String | Post name
final Snapshot snapshot = ; // Snapshot |
try {
final response = api.updateMyPostDraft(name, snapshot);
print(response);
} catch on DioException (e) {
print('Exception when calling PostV1alpha1UcApi->updateMyPostDraft: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | Post name | |
snapshot | Snapshot | [optional] |
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]