2023-08-11 16:48:23 +02:00

7.0 KiB

mycore_api.api.UserApi

Load the API package

import 'package:mycore_api/api.dart';

All URIs are relative to https://localhost:5001

Method HTTP request Description
userCreateUser POST /api/user Create an user
userDeleteUser DELETE /api/user/{id} Delete an user
userGet GET /api/user/{id} Get a specific user
userGetAll GET /api/user Get a list of user
userGetByEmail GET /api/user/email/{email} Get a specific user by email
userUpdateUser PUT /api/user Update an user

userCreateUser

UserInfoDetailDTO userCreateUser(userInfo)

Create an user

Example

import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';

final api_instance = UserApi();
final userInfo = UserInfo(); // UserInfo | New user info

try {
    final result = api_instance.userCreateUser(userInfo);
    print(result);
} catch (e) {
    print('Exception when calling UserApi->userCreateUser: $e\n');
}

Parameters

Name Type Description Notes
userInfo UserInfo New user info

Return type

UserInfoDetailDTO

Authorization

bearer

HTTP request headers

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

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

userDeleteUser

String userDeleteUser(id)

Delete an user

Example

import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';

final api_instance = UserApi();
final id = id_example; // String | Id of user to delete

try {
    final result = api_instance.userDeleteUser(id);
    print(result);
} catch (e) {
    print('Exception when calling UserApi->userDeleteUser: $e\n');
}

Parameters

Name Type Description Notes
id String Id of user to delete

Return type

String

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

userGet

UserInfoDetailDTO userGet(id)

Get a specific user

Example

import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';

final api_instance = UserApi();
final id = id_example; // String | id user

try {
    final result = api_instance.userGet(id);
    print(result);
} catch (e) {
    print('Exception when calling UserApi->userGet: $e\n');
}

Parameters

Name Type Description Notes
id String id user

Return type

UserInfoDetailDTO

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

userGetAll

List userGetAll()

Get a list of user

Example

import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';

final api_instance = UserApi();

try {
    final result = api_instance.userGetAll();
    print(result);
} catch (e) {
    print('Exception when calling UserApi->userGetAll: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

List

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

userGetByEmail

UserInfoDetailDTO userGetByEmail(email)

Get a specific user by email

Example

import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';

final api_instance = UserApi();
final email = email_example; // String | user email

try {
    final result = api_instance.userGetByEmail(email);
    print(result);
} catch (e) {
    print('Exception when calling UserApi->userGetByEmail: $e\n');
}

Parameters

Name Type Description Notes
email String user email

Return type

UserInfoDetailDTO

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

userUpdateUser

UserInfoDetailDTO userUpdateUser(userInfo)

Update an user

Example

import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';

final api_instance = UserApi();
final userInfo = UserInfo(); // UserInfo | User to update

try {
    final result = api_instance.userUpdateUser(userInfo);
    print(result);
} catch (e) {
    print('Exception when calling UserApi->userUpdateUser: $e\n');
}

Parameters

Name Type Description Notes
userInfo UserInfo User to update

Return type

UserInfoDetailDTO

Authorization

bearer

HTTP request headers

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

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