Skip to content

Latest commit

 

History

History
306 lines (205 loc) · 9.1 KB

PostV1alpha1Api.md

File metadata and controls

306 lines (205 loc) · 9.1 KB

halo_client.api.PostV1alpha1Api

Load the API package

import 'package:halo_client/api.dart';

All URIs are relative to http://localhost:8091

Method HTTP request Description
createPost POST /apis/content.halo.run/v1alpha1/posts
deletePost DELETE /apis/content.halo.run/v1alpha1/posts/{name}
getPost GET /apis/content.halo.run/v1alpha1/posts/{name}
listPost GET /apis/content.halo.run/v1alpha1/posts
patchPost PATCH /apis/content.halo.run/v1alpha1/posts/{name}
updatePost PUT /apis/content.halo.run/v1alpha1/posts/{name}

createPost

Post createPost(post)

Create 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().getPostV1alpha1Api();
final Post post = ; // Post | Fresh post

try {
    final response = api.createPost(post);
    print(response);
} catch on DioException (e) {
    print('Exception when calling PostV1alpha1Api->createPost: $e\n');
}

Parameters

Name Type Description Notes
post Post Fresh 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]

deletePost

deletePost(name)

Delete 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().getPostV1alpha1Api();
final String name = name_example; // String | Name of post

try {
    api.deletePost(name);
} catch on DioException (e) {
    print('Exception when calling PostV1alpha1Api->deletePost: $e\n');
}

Parameters

Name Type Description Notes
name String Name of post

Return type

void (empty response body)

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

getPost

Post getPost(name)

Get 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().getPostV1alpha1Api();
final String name = name_example; // String | Name of post

try {
    final response = api.getPost(name);
    print(response);
} catch on DioException (e) {
    print('Exception when calling PostV1alpha1Api->getPost: $e\n');
}

Parameters

Name Type Description Notes
name String Name of post

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]

listPost

PostList listPost(page, size, labelSelector, fieldSelector, sort)

List 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().getPostV1alpha1Api();
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.

try {
    final response = api.listPost(page, size, labelSelector, fieldSelector, sort);
    print(response);
} catch on DioException (e) {
    print('Exception when calling PostV1alpha1Api->listPost: $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.

Return type

PostList

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]

patchPost

Post patchPost(name, jsonPatchInner)

Patch 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().getPostV1alpha1Api();
final String name = name_example; // String | Name of post
final BuiltSet<JsonPatchInner> jsonPatchInner = ; // BuiltSet<JsonPatchInner> | 

try {
    final response = api.patchPost(name, jsonPatchInner);
    print(response);
} catch on DioException (e) {
    print('Exception when calling PostV1alpha1Api->patchPost: $e\n');
}

Parameters

Name Type Description Notes
name String Name of post
jsonPatchInner BuiltSet<JsonPatchInner> [optional]

Return type

Post

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: application/json-patch+json
  • Accept: /

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

updatePost

Post updatePost(name, post)

Update 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().getPostV1alpha1Api();
final String name = name_example; // String | Name of post
final Post post = ; // Post | Updated post

try {
    final response = api.updatePost(name, post);
    print(response);
} catch on DioException (e) {
    print('Exception when calling PostV1alpha1Api->updatePost: $e\n');
}

Parameters

Name Type Description Notes
name String Name of post
post Post Updated 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]