mirror of
https://bitbucket.org/myhomie/mycorerepository.git
synced 2025-12-06 01:31:19 +00:00
5.4 KiB
5.4 KiB
mycoreapi.api.BooksApi
Load the API package
import 'package:mycoreapi/api.dart';
All URIs are relative to http://localhost:25049
| Method | HTTP request | Description |
|---|---|---|
| booksCreate | POST /api/books | |
| booksDelete | DELETE /api/books/{id} | |
| booksGet | GET /api/books/{id} | |
| booksGetAll | GET /api/books | |
| booksUpdate | PUT /api/books/{id} |
booksCreate
Book booksCreate(book)
Example
import 'package:mycoreapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = BooksApi();
final book = Book(); // Book |
try {
final result = api_instance.booksCreate(book);
print(result);
} catch (e) {
print('Exception when calling BooksApi->booksCreate: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| book | Book |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
booksDelete
MultipartFile booksDelete(id)
Example
import 'package:mycoreapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = BooksApi();
final id = id_example; // String |
try {
final result = api_instance.booksDelete(id);
print(result);
} catch (e) {
print('Exception when calling BooksApi->booksDelete: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | String |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/octet-stream
[Back to top] [Back to API list] [Back to Model list] [Back to README]
booksGet
Book booksGet(id)
Example
import 'package:mycoreapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = BooksApi();
final id = id_example; // String |
try {
final result = api_instance.booksGet(id);
print(result);
} catch (e) {
print('Exception when calling BooksApi->booksGet: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | String |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
booksGetAll
List booksGetAll()
Example
import 'package:mycoreapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = BooksApi();
try {
final result = api_instance.booksGetAll();
print(result);
} catch (e) {
print('Exception when calling BooksApi->booksGetAll: $e\n');
}
Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
booksUpdate
MultipartFile booksUpdate(id, book)
Example
import 'package:mycoreapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = BooksApi();
final id = id_example; // String |
final book = Book(); // Book |
try {
final result = api_instance.booksUpdate(id, book);
print(result);
} catch (e) {
print('Exception when calling BooksApi->booksUpdate: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | ||
| book | Book |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/octet-stream
[Back to top] [Back to API list] [Back to Model list] [Back to README]