Skip to content

Latest commit

 

History

History
636 lines (424 loc) · 19.8 KB

UserV1alpha1ConsoleApi.md

File metadata and controls

636 lines (424 loc) · 19.8 KB

halo_client.api.UserV1alpha1ConsoleApi

Load the API package

import 'package:halo_client/api.dart';

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

Method HTTP request Description
changeAnyonePassword PUT /apis/api.console.halo.run/v1alpha1/users/{name}/password
changeOwnPassword PUT /apis/api.console.halo.run/v1alpha1/users/-/password
createUser POST /apis/api.console.halo.run/v1alpha1/users
deleteUserAvatar DELETE /apis/api.console.halo.run/v1alpha1/users/{name}/avatar
getCurrentUserDetail GET /apis/api.console.halo.run/v1alpha1/users/-
getPermissions GET /apis/api.console.halo.run/v1alpha1/users/{name}/permissions
getUserDetail GET /apis/api.console.halo.run/v1alpha1/users/{name}
grantPermission POST /apis/api.console.halo.run/v1alpha1/users/{name}/permissions
listUsers GET /apis/api.console.halo.run/v1alpha1/users
sendEmailVerificationCode POST /apis/api.console.halo.run/v1alpha1/users/-/send-email-verification-code
updateCurrentUser PUT /apis/api.console.halo.run/v1alpha1/users/-
uploadUserAvatar POST /apis/api.console.halo.run/v1alpha1/users/{name}/avatar
verifyEmail POST /apis/api.console.halo.run/v1alpha1/users/-/verify-email

changeAnyonePassword

User changeAnyonePassword(name, changePasswordRequest)

Change anyone password of user for admin.

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().getUserV1alpha1ConsoleApi();
final String name = name_example; // String | Name of user. If the name is equal to '-', it will change the password of current user.
final ChangePasswordRequest changePasswordRequest = ; // ChangePasswordRequest | 

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

Parameters

Name Type Description Notes
name String Name of user. If the name is equal to '-', it will change the password of current user.
changePasswordRequest ChangePasswordRequest

Return type

User

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]

changeOwnPassword

User changeOwnPassword(changeOwnPasswordRequest)

Change own password of 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().getUserV1alpha1ConsoleApi();
final ChangeOwnPasswordRequest changeOwnPasswordRequest = ; // ChangeOwnPasswordRequest | 

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

Parameters

Name Type Description Notes
changeOwnPasswordRequest ChangeOwnPasswordRequest

Return type

User

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]

createUser

User createUser(createUserRequest)

Creates a new 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().getUserV1alpha1ConsoleApi();
final CreateUserRequest createUserRequest = ; // CreateUserRequest | 

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

Parameters

Name Type Description Notes
createUserRequest CreateUserRequest

Return type

User

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]

deleteUserAvatar

User deleteUserAvatar(name)

delete user avatar

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().getUserV1alpha1ConsoleApi();
final String name = name_example; // String | User name

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

Parameters

Name Type Description Notes
name String User name

Return type

User

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]

getCurrentUserDetail

DetailedUser getCurrentUserDetail()

Get current user detail

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

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

Parameters

This endpoint does not need any parameter.

Return type

DetailedUser

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]

getPermissions

UserPermission getPermissions(name)

Get permissions of 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().getUserV1alpha1ConsoleApi();
final String name = name_example; // String | User name

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

Parameters

Name Type Description Notes
name String User name

Return type

UserPermission

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]

getUserDetail

DetailedUser getUserDetail(name)

Get user detail by name

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().getUserV1alpha1ConsoleApi();
final String name = name_example; // String | User name

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

Parameters

Name Type Description Notes
name String User name

Return type

DetailedUser

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]

grantPermission

User grantPermission(name, grantRequest)

Grant permissions to 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().getUserV1alpha1ConsoleApi();
final String name = name_example; // String | User name
final GrantRequest grantRequest = ; // GrantRequest | 

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

Parameters

Name Type Description Notes
name String User name
grantRequest GrantRequest

Return type

User

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]

listUsers

UserEndpointListedUserList listUsers(page, size, labelSelector, fieldSelector, sort, keyword, role)

List users

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().getUserV1alpha1ConsoleApi();
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 keyword = keyword_example; // String | Keyword to search
final String role = role_example; // String | Role name

try {
    final response = api.listUsers(page, size, labelSelector, fieldSelector, sort, keyword, role);
    print(response);
} catch on DioException (e) {
    print('Exception when calling UserV1alpha1ConsoleApi->listUsers: $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.
keyword String Keyword to search [optional]
role String Role name [optional]

Return type

UserEndpointListedUserList

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]

sendEmailVerificationCode

sendEmailVerificationCode(emailVerifyRequest)

Send email verification code for 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().getUserV1alpha1ConsoleApi();
final EmailVerifyRequest emailVerifyRequest = ; // EmailVerifyRequest | 

try {
    api.sendEmailVerificationCode(emailVerifyRequest);
} catch on DioException (e) {
    print('Exception when calling UserV1alpha1ConsoleApi->sendEmailVerificationCode: $e\n');
}

Parameters

Name Type Description Notes
emailVerifyRequest EmailVerifyRequest

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]

updateCurrentUser

User updateCurrentUser(user)

Update current user profile, but password.

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().getUserV1alpha1ConsoleApi();
final User user = ; // User | 

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

Parameters

Name Type Description Notes
user User

Return type

User

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]

uploadUserAvatar

User uploadUserAvatar(name, file)

upload user avatar

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().getUserV1alpha1ConsoleApi();
final String name = name_example; // String | User name
final MultipartFile file = BINARY_DATA_HERE; // MultipartFile | 

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

Parameters

Name Type Description Notes
name String User name
file MultipartFile

Return type

User

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: /

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

verifyEmail

verifyEmail(verifyCodeRequest)

Verify email for user by code.

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().getUserV1alpha1ConsoleApi();
final VerifyCodeRequest verifyCodeRequest = ; // VerifyCodeRequest | 

try {
    api.verifyEmail(verifyCodeRequest);
} catch on DioException (e) {
    print('Exception when calling UserV1alpha1ConsoleApi->verifyEmail: $e\n');
}

Parameters

Name Type Description Notes
verifyCodeRequest VerifyCodeRequest

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]