Skip to content

Latest commit

 

History

History
456 lines (307 loc) · 14.4 KB

PostV1alpha1UcApi.md

File metadata and controls

456 lines (307 loc) · 14.4 KB

halo_client.api.PostV1alpha1UcApi

Load the API package

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

createMyPost

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.

Example

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');
}

Parameters

Name Type Description Notes
post Post [optional]

Return type

Post

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getMyPost

Post getMyPost(name)

Get post that belongs to the current user.

Example

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');
}

Parameters

Name Type Description Notes
name String Post name

Return type

Post

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getMyPostDraft

Snapshot getMyPostDraft(name, patched)

Get my post draft.

Example

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');
}

Parameters

Name Type Description Notes
name String Post name
patched bool Should include patched content and raw or not. [optional]

Return type

Snapshot

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listMyPosts

ListedPostList listMyPosts(page, size, labelSelector, fieldSelector, sort, publishPhase, keyword, categoryWithChildren)

List posts owned by the current user.

Example

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');
}

Parameters

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]

Return type

ListedPostList

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

publishMyPost

Post publishMyPost(name)

Publish my post.

Example

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');
}

Parameters

Name Type Description Notes
name String Post name

Return type

Post

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

recycleMyPost

Post recycleMyPost(name)

Move my post to recycle bin.

Example

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');
}

Parameters

Name Type Description Notes
name String Post name

Return type

Post

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

unpublishMyPost

Post unpublishMyPost(name)

Unpublish my post.

Example

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');
}

Parameters

Name Type Description Notes
name String Post name

Return type

Post

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateMyPost

Post updateMyPost(name, post)

Update my post.

Example

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');
}

Parameters

Name Type Description Notes
name String Post name
post Post [optional]

Return type

Post

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateMyPostDraft

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.

Example

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');
}

Parameters

Name Type Description Notes
name String Post name
snapshot Snapshot [optional]

Return type

Snapshot

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]