This commit is contained in:
Alex Tran 2023-08-13 10:35:07 -05:00
parent e2ad4ac5b3
commit 1eb3cdca42
22 changed files with 1971 additions and 7 deletions

View file

@ -933,6 +933,33 @@ export interface CreateProfileImageResponseDto {
*/
'userId': string;
}
/**
*
* @export
* @interface CreateRuleDto
*/
export interface CreateRuleDto {
/**
*
* @type {string}
* @memberof CreateRuleDto
*/
'albumId': string;
/**
*
* @type {RuleKey}
* @memberof CreateRuleDto
*/
'key': RuleKey;
/**
*
* @type {string}
* @memberof CreateRuleDto
*/
'value': string;
}
/**
*
* @export
@ -3036,6 +3063,27 @@ export interface UpdateAssetDto {
*/
'tagIds'?: Array<string>;
}
/**
*
* @export
* @interface UpdateRuleDto
*/
export interface UpdateRuleDto {
/**
*
* @type {RuleKey}
* @memberof UpdateRuleDto
*/
'key'?: RuleKey;
/**
*
* @type {object}
* @memberof UpdateRuleDto
*/
'value'?: object;
}
/**
*
* @export
@ -9666,6 +9714,404 @@ export class PersonApi extends BaseAPI {
}
/**
* RuleApi - axios parameter creator
* @export
*/
export const RuleApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @param {CreateRuleDto} createRuleDto
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createRule: async (createRuleDto: CreateRuleDto, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'createRuleDto' is not null or undefined
assertParamExists('createRule', 'createRuleDto', createRuleDto)
const localVarPath = `/rule`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication cookie required
// authentication api_key required
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration)
// authentication bearer required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(createRuleDto, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getRule: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('getRule', 'id', id)
const localVarPath = `/rule/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication cookie required
// authentication api_key required
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration)
// authentication bearer required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
removeRule: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('removeRule', 'id', id)
const localVarPath = `/rule/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication cookie required
// authentication api_key required
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration)
// authentication bearer required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} id
* @param {UpdateRuleDto} updateRuleDto
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateRule: async (id: string, updateRuleDto: UpdateRuleDto, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('updateRule', 'id', id)
// verify required parameter 'updateRuleDto' is not null or undefined
assertParamExists('updateRule', 'updateRuleDto', updateRuleDto)
const localVarPath = `/rule/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication cookie required
// authentication api_key required
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration)
// authentication bearer required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(updateRuleDto, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* RuleApi - functional programming interface
* @export
*/
export const RuleApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = RuleApiAxiosParamCreator(configuration)
return {
/**
*
* @param {CreateRuleDto} createRuleDto
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createRule(createRuleDto: CreateRuleDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RuleResponseDto>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createRule(createRuleDto, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getRule(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RuleResponseDto>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getRule(id, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async removeRule(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.removeRule(id, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} id
* @param {UpdateRuleDto} updateRuleDto
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateRule(id: string, updateRuleDto: UpdateRuleDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RuleResponseDto>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateRule(id, updateRuleDto, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};
/**
* RuleApi - factory interface
* @export
*/
export const RuleApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = RuleApiFp(configuration)
return {
/**
*
* @param {RuleApiCreateRuleRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createRule(requestParameters: RuleApiCreateRuleRequest, options?: AxiosRequestConfig): AxiosPromise<RuleResponseDto> {
return localVarFp.createRule(requestParameters.createRuleDto, options).then((request) => request(axios, basePath));
},
/**
*
* @param {RuleApiGetRuleRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getRule(requestParameters: RuleApiGetRuleRequest, options?: AxiosRequestConfig): AxiosPromise<RuleResponseDto> {
return localVarFp.getRule(requestParameters.id, options).then((request) => request(axios, basePath));
},
/**
*
* @param {RuleApiRemoveRuleRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
removeRule(requestParameters: RuleApiRemoveRuleRequest, options?: AxiosRequestConfig): AxiosPromise<void> {
return localVarFp.removeRule(requestParameters.id, options).then((request) => request(axios, basePath));
},
/**
*
* @param {RuleApiUpdateRuleRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateRule(requestParameters: RuleApiUpdateRuleRequest, options?: AxiosRequestConfig): AxiosPromise<RuleResponseDto> {
return localVarFp.updateRule(requestParameters.id, requestParameters.updateRuleDto, options).then((request) => request(axios, basePath));
},
};
};
/**
* Request parameters for createRule operation in RuleApi.
* @export
* @interface RuleApiCreateRuleRequest
*/
export interface RuleApiCreateRuleRequest {
/**
*
* @type {CreateRuleDto}
* @memberof RuleApiCreateRule
*/
readonly createRuleDto: CreateRuleDto
}
/**
* Request parameters for getRule operation in RuleApi.
* @export
* @interface RuleApiGetRuleRequest
*/
export interface RuleApiGetRuleRequest {
/**
*
* @type {string}
* @memberof RuleApiGetRule
*/
readonly id: string
}
/**
* Request parameters for removeRule operation in RuleApi.
* @export
* @interface RuleApiRemoveRuleRequest
*/
export interface RuleApiRemoveRuleRequest {
/**
*
* @type {string}
* @memberof RuleApiRemoveRule
*/
readonly id: string
}
/**
* Request parameters for updateRule operation in RuleApi.
* @export
* @interface RuleApiUpdateRuleRequest
*/
export interface RuleApiUpdateRuleRequest {
/**
*
* @type {string}
* @memberof RuleApiUpdateRule
*/
readonly id: string
/**
*
* @type {UpdateRuleDto}
* @memberof RuleApiUpdateRule
*/
readonly updateRuleDto: UpdateRuleDto
}
/**
* RuleApi - object-oriented interface
* @export
* @class RuleApi
* @extends {BaseAPI}
*/
export class RuleApi extends BaseAPI {
/**
*
* @param {RuleApiCreateRuleRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof RuleApi
*/
public createRule(requestParameters: RuleApiCreateRuleRequest, options?: AxiosRequestConfig) {
return RuleApiFp(this.configuration).createRule(requestParameters.createRuleDto, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {RuleApiGetRuleRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof RuleApi
*/
public getRule(requestParameters: RuleApiGetRuleRequest, options?: AxiosRequestConfig) {
return RuleApiFp(this.configuration).getRule(requestParameters.id, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {RuleApiRemoveRuleRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof RuleApi
*/
public removeRule(requestParameters: RuleApiRemoveRuleRequest, options?: AxiosRequestConfig) {
return RuleApiFp(this.configuration).removeRule(requestParameters.id, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {RuleApiUpdateRuleRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof RuleApi
*/
public updateRule(requestParameters: RuleApiUpdateRuleRequest, options?: AxiosRequestConfig) {
return RuleApiFp(this.configuration).updateRule(requestParameters.id, requestParameters.updateRuleDto, options).then((request) => request(this.axios, this.basePath));
}
}
/**
* SearchApi - axios parameter creator
* @export

View file

@ -37,6 +37,7 @@ doc/CheckExistingAssetsDto.md
doc/CheckExistingAssetsResponseDto.md
doc/CreateAlbumDto.md
doc/CreateProfileImageResponseDto.md
doc/CreateRuleDto.md
doc/CreateTagDto.md
doc/CreateUserDto.md
doc/CuratedLocationsResponseDto.md
@ -73,6 +74,7 @@ doc/PersonApi.md
doc/PersonResponseDto.md
doc/PersonUpdateDto.md
doc/QueueStatusDto.md
doc/RuleApi.md
doc/RuleKey.md
doc/RuleResponseDto.md
doc/SearchAlbumResponseDto.md
@ -118,6 +120,7 @@ doc/TranscodeHWAccel.md
doc/TranscodePolicy.md
doc/UpdateAlbumDto.md
doc/UpdateAssetDto.md
doc/UpdateRuleDto.md
doc/UpdateTagDto.md
doc/UpdateUserDto.md
doc/UsageByUserDto.md
@ -136,6 +139,7 @@ lib/api/job_api.dart
lib/api/o_auth_api.dart
lib/api/partner_api.dart
lib/api/person_api.dart
lib/api/rule_api.dart
lib/api/search_api.dart
lib/api/server_info_api.dart
lib/api/shared_link_api.dart
@ -180,6 +184,7 @@ lib/model/check_existing_assets_dto.dart
lib/model/check_existing_assets_response_dto.dart
lib/model/create_album_dto.dart
lib/model/create_profile_image_response_dto.dart
lib/model/create_rule_dto.dart
lib/model/create_tag_dto.dart
lib/model/create_user_dto.dart
lib/model/curated_locations_response_dto.dart
@ -252,6 +257,7 @@ lib/model/transcode_hw_accel.dart
lib/model/transcode_policy.dart
lib/model/update_album_dto.dart
lib/model/update_asset_dto.dart
lib/model/update_rule_dto.dart
lib/model/update_tag_dto.dart
lib/model/update_user_dto.dart
lib/model/usage_by_user_dto.dart
@ -294,6 +300,7 @@ test/check_existing_assets_dto_test.dart
test/check_existing_assets_response_dto_test.dart
test/create_album_dto_test.dart
test/create_profile_image_response_dto_test.dart
test/create_rule_dto_test.dart
test/create_tag_dto_test.dart
test/create_user_dto_test.dart
test/curated_locations_response_dto_test.dart
@ -330,6 +337,7 @@ test/person_api_test.dart
test/person_response_dto_test.dart
test/person_update_dto_test.dart
test/queue_status_dto_test.dart
test/rule_api_test.dart
test/rule_key_test.dart
test/rule_response_dto_test.dart
test/search_album_response_dto_test.dart
@ -375,6 +383,7 @@ test/transcode_hw_accel_test.dart
test/transcode_policy_test.dart
test/update_album_dto_test.dart
test/update_asset_dto_test.dart
test/update_rule_dto_test.dart
test/update_tag_dto_test.dart
test/update_user_dto_test.dart
test/usage_by_user_dto_test.dart

View file

@ -136,6 +136,10 @@ Class | Method | HTTP request | Description
*PersonApi* | [**mergePerson**](doc//PersonApi.md#mergeperson) | **POST** /person/{id}/merge |
*PersonApi* | [**updatePeople**](doc//PersonApi.md#updatepeople) | **PUT** /person |
*PersonApi* | [**updatePerson**](doc//PersonApi.md#updateperson) | **PUT** /person/{id} |
*RuleApi* | [**createRule**](doc//RuleApi.md#createrule) | **POST** /rule |
*RuleApi* | [**getRule**](doc//RuleApi.md#getrule) | **GET** /rule/{id} |
*RuleApi* | [**removeRule**](doc//RuleApi.md#removerule) | **DELETE** /rule/{id} |
*RuleApi* | [**updateRule**](doc//RuleApi.md#updaterule) | **PUT** /rule/{id} |
*SearchApi* | [**getExploreData**](doc//SearchApi.md#getexploredata) | **GET** /search/explore |
*SearchApi* | [**getSearchConfig**](doc//SearchApi.md#getsearchconfig) | **GET** /search/config |
*SearchApi* | [**search**](doc//SearchApi.md#search) | **GET** /search |
@ -208,6 +212,7 @@ Class | Method | HTTP request | Description
- [CheckExistingAssetsResponseDto](doc//CheckExistingAssetsResponseDto.md)
- [CreateAlbumDto](doc//CreateAlbumDto.md)
- [CreateProfileImageResponseDto](doc//CreateProfileImageResponseDto.md)
- [CreateRuleDto](doc//CreateRuleDto.md)
- [CreateTagDto](doc//CreateTagDto.md)
- [CreateUserDto](doc//CreateUserDto.md)
- [CuratedLocationsResponseDto](doc//CuratedLocationsResponseDto.md)
@ -280,6 +285,7 @@ Class | Method | HTTP request | Description
- [TranscodePolicy](doc//TranscodePolicy.md)
- [UpdateAlbumDto](doc//UpdateAlbumDto.md)
- [UpdateAssetDto](doc//UpdateAssetDto.md)
- [UpdateRuleDto](doc//UpdateRuleDto.md)
- [UpdateTagDto](doc//UpdateTagDto.md)
- [UpdateUserDto](doc//UpdateUserDto.md)
- [UsageByUserDto](doc//UsageByUserDto.md)

17
mobile/openapi/doc/CreateRuleDto.md generated Normal file
View file

@ -0,0 +1,17 @@
# openapi.model.CreateRuleDto
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**albumId** | **String** | |
**key** | [**RuleKey**](RuleKey.md) | |
**value** | **String** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

238
mobile/openapi/doc/RuleApi.md generated Normal file
View file

@ -0,0 +1,238 @@
# openapi.api.RuleApi
## Load the API package
```dart
import 'package:openapi/api.dart';
```
All URIs are relative to */api*
Method | HTTP request | Description
------------- | ------------- | -------------
[**createRule**](RuleApi.md#createrule) | **POST** /rule |
[**getRule**](RuleApi.md#getrule) | **GET** /rule/{id} |
[**removeRule**](RuleApi.md#removerule) | **DELETE** /rule/{id} |
[**updateRule**](RuleApi.md#updaterule) | **PUT** /rule/{id} |
# **createRule**
> RuleResponseDto createRule(createRuleDto)
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure API key authorization: cookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = RuleApi();
final createRuleDto = CreateRuleDto(); // CreateRuleDto |
try {
final result = api_instance.createRule(createRuleDto);
print(result);
} catch (e) {
print('Exception when calling RuleApi->createRule: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**createRuleDto** | [**CreateRuleDto**](CreateRuleDto.md)| |
### Return type
[**RuleResponseDto**](RuleResponseDto.md)
### Authorization
[cookie](../README.md#cookie), [api_key](../README.md#api_key), [bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **getRule**
> RuleResponseDto getRule(id)
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure API key authorization: cookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = RuleApi();
final id = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String |
try {
final result = api_instance.getRule(id);
print(result);
} catch (e) {
print('Exception when calling RuleApi->getRule: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| |
### Return type
[**RuleResponseDto**](RuleResponseDto.md)
### Authorization
[cookie](../README.md#cookie), [api_key](../README.md#api_key), [bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **removeRule**
> removeRule(id)
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure API key authorization: cookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = RuleApi();
final id = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String |
try {
api_instance.removeRule(id);
} catch (e) {
print('Exception when calling RuleApi->removeRule: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| |
### Return type
void (empty response body)
### Authorization
[cookie](../README.md#cookie), [api_key](../README.md#api_key), [bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **updateRule**
> RuleResponseDto updateRule(id, updateRuleDto)
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure API key authorization: cookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = RuleApi();
final id = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String |
final updateRuleDto = UpdateRuleDto(); // UpdateRuleDto |
try {
final result = api_instance.updateRule(id, updateRuleDto);
print(result);
} catch (e) {
print('Exception when calling RuleApi->updateRule: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| |
**updateRuleDto** | [**UpdateRuleDto**](UpdateRuleDto.md)| |
### Return type
[**RuleResponseDto**](RuleResponseDto.md)
### Authorization
[cookie](../README.md#cookie), [api_key](../README.md#api_key), [bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

16
mobile/openapi/doc/UpdateRuleDto.md generated Normal file
View file

@ -0,0 +1,16 @@
# openapi.model.UpdateRuleDto
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**key** | [**RuleKey**](RuleKey.md) | | [optional]
**value** | [**Object**](.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -36,6 +36,7 @@ part 'api/job_api.dart';
part 'api/o_auth_api.dart';
part 'api/partner_api.dart';
part 'api/person_api.dart';
part 'api/rule_api.dart';
part 'api/search_api.dart';
part 'api/server_info_api.dart';
part 'api/shared_link_api.dart';
@ -73,6 +74,7 @@ part 'model/check_existing_assets_dto.dart';
part 'model/check_existing_assets_response_dto.dart';
part 'model/create_album_dto.dart';
part 'model/create_profile_image_response_dto.dart';
part 'model/create_rule_dto.dart';
part 'model/create_tag_dto.dart';
part 'model/create_user_dto.dart';
part 'model/curated_locations_response_dto.dart';
@ -145,6 +147,7 @@ part 'model/transcode_hw_accel.dart';
part 'model/transcode_policy.dart';
part 'model/update_album_dto.dart';
part 'model/update_asset_dto.dart';
part 'model/update_rule_dto.dart';
part 'model/update_tag_dto.dart';
part 'model/update_user_dto.dart';
part 'model/usage_by_user_dto.dart';

205
mobile/openapi/lib/api/rule_api.dart generated Normal file
View file

@ -0,0 +1,205 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class RuleApi {
RuleApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'POST /rule' operation and returns the [Response].
/// Parameters:
///
/// * [CreateRuleDto] createRuleDto (required):
Future<Response> createRuleWithHttpInfo(CreateRuleDto createRuleDto,) async {
// ignore: prefer_const_declarations
final path = r'/rule';
// ignore: prefer_final_locals
Object? postBody = createRuleDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [CreateRuleDto] createRuleDto (required):
Future<RuleResponseDto?> createRule(CreateRuleDto createRuleDto,) async {
final response = await createRuleWithHttpInfo(createRuleDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'RuleResponseDto',) as RuleResponseDto;
}
return null;
}
/// Performs an HTTP 'GET /rule/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> getRuleWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final path = r'/rule/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<RuleResponseDto?> getRule(String id,) async {
final response = await getRuleWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'RuleResponseDto',) as RuleResponseDto;
}
return null;
}
/// Performs an HTTP 'DELETE /rule/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> removeRuleWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final path = r'/rule/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<void> removeRule(String id,) async {
final response = await removeRuleWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Performs an HTTP 'PUT /rule/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
///
/// * [UpdateRuleDto] updateRuleDto (required):
Future<Response> updateRuleWithHttpInfo(String id, UpdateRuleDto updateRuleDto,) async {
// ignore: prefer_const_declarations
final path = r'/rule/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = updateRuleDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
///
/// * [UpdateRuleDto] updateRuleDto (required):
Future<RuleResponseDto?> updateRule(String id, UpdateRuleDto updateRuleDto,) async {
final response = await updateRuleWithHttpInfo(id, updateRuleDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'RuleResponseDto',) as RuleResponseDto;
}
return null;
}
}

View file

@ -241,6 +241,8 @@ class ApiClient {
return CreateAlbumDto.fromJson(value);
case 'CreateProfileImageResponseDto':
return CreateProfileImageResponseDto.fromJson(value);
case 'CreateRuleDto':
return CreateRuleDto.fromJson(value);
case 'CreateTagDto':
return CreateTagDto.fromJson(value);
case 'CreateUserDto':
@ -385,6 +387,8 @@ class ApiClient {
return UpdateAlbumDto.fromJson(value);
case 'UpdateAssetDto':
return UpdateAssetDto.fromJson(value);
case 'UpdateRuleDto':
return UpdateRuleDto.fromJson(value);
case 'UpdateTagDto':
return UpdateTagDto.fromJson(value);
case 'UpdateUserDto':

View file

@ -0,0 +1,114 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class CreateRuleDto {
/// Returns a new [CreateRuleDto] instance.
CreateRuleDto({
required this.albumId,
required this.key,
required this.value,
});
String albumId;
RuleKey key;
String value;
@override
bool operator ==(Object other) => identical(this, other) || other is CreateRuleDto &&
other.albumId == albumId &&
other.key == key &&
other.value == value;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(albumId.hashCode) +
(key.hashCode) +
(value.hashCode);
@override
String toString() => 'CreateRuleDto[albumId=$albumId, key=$key, value=$value]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'albumId'] = this.albumId;
json[r'key'] = this.key;
json[r'value'] = this.value;
return json;
}
/// Returns a new [CreateRuleDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static CreateRuleDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return CreateRuleDto(
albumId: mapValueOfType<String>(json, r'albumId')!,
key: RuleKey.fromJson(json[r'key'])!,
value: mapValueOfType<String>(json, r'value')!,
);
}
return null;
}
static List<CreateRuleDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <CreateRuleDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = CreateRuleDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, CreateRuleDto> mapFromJson(dynamic json) {
final map = <String, CreateRuleDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = CreateRuleDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of CreateRuleDto-objects as value to a dart map
static Map<String, List<CreateRuleDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<CreateRuleDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = CreateRuleDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'albumId',
'key',
'value',
};
}

View file

@ -0,0 +1,124 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class UpdateRuleDto {
/// Returns a new [UpdateRuleDto] instance.
UpdateRuleDto({
this.key,
this.value,
});
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
RuleKey? key;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
Object? value;
@override
bool operator ==(Object other) => identical(this, other) || other is UpdateRuleDto &&
other.key == key &&
other.value == value;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(key == null ? 0 : key!.hashCode) +
(value == null ? 0 : value!.hashCode);
@override
String toString() => 'UpdateRuleDto[key=$key, value=$value]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.key != null) {
json[r'key'] = this.key;
} else {
// json[r'key'] = null;
}
if (this.value != null) {
json[r'value'] = this.value;
} else {
// json[r'value'] = null;
}
return json;
}
/// Returns a new [UpdateRuleDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static UpdateRuleDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return UpdateRuleDto(
key: RuleKey.fromJson(json[r'key']),
value: mapValueOfType<Object>(json, r'value'),
);
}
return null;
}
static List<UpdateRuleDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <UpdateRuleDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = UpdateRuleDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, UpdateRuleDto> mapFromJson(dynamic json) {
final map = <String, UpdateRuleDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = UpdateRuleDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of UpdateRuleDto-objects as value to a dart map
static Map<String, List<UpdateRuleDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<UpdateRuleDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = UpdateRuleDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

View file

@ -0,0 +1,37 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
import 'package:openapi/api.dart';
import 'package:test/test.dart';
// tests for CreateRuleDto
void main() {
// final instance = CreateRuleDto();
group('test CreateRuleDto', () {
// String albumId
test('to test the property `albumId`', () async {
// TODO
});
// RuleKey key
test('to test the property `key`', () async {
// TODO
});
// String value
test('to test the property `value`', () async {
// TODO
});
});
}

41
mobile/openapi/test/rule_api_test.dart generated Normal file
View file

@ -0,0 +1,41 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
import 'package:openapi/api.dart';
import 'package:test/test.dart';
/// tests for RuleApi
void main() {
// final instance = RuleApi();
group('tests for RuleApi', () {
//Future<RuleResponseDto> createRule(CreateRuleDto createRuleDto) async
test('test createRule', () async {
// TODO
});
//Future<RuleResponseDto> getRule(String id) async
test('test getRule', () async {
// TODO
});
//Future removeRule(String id) async
test('test removeRule', () async {
// TODO
});
//Future<RuleResponseDto> updateRule(String id, UpdateRuleDto updateRuleDto) async
test('test updateRule', () async {
// TODO
});
});
}

View file

@ -0,0 +1,32 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
import 'package:openapi/api.dart';
import 'package:test/test.dart';
// tests for UpdateRuleDto
void main() {
// final instance = UpdateRuleDto();
group('test UpdateRuleDto', () {
// RuleKey key
test('to test the property `key`', () async {
// TODO
});
// Object value
test('to test the property `value`', () async {
// TODO
});
});
}

View file

@ -2969,6 +2969,173 @@
]
}
},
"/rule": {
"post": {
"operationId": "createRule",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateRuleDto"
}
}
},
"required": true
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RuleResponseDto"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Rule"
]
}
},
"/rule/{id}": {
"delete": {
"operationId": "removeRule",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"type": "string"
}
}
],
"responses": {
"200": {
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Rule"
]
},
"get": {
"operationId": "getRule",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RuleResponseDto"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Rule"
]
},
"put": {
"operationId": "updateRule",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateRuleDto"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RuleResponseDto"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Rule"
]
}
},
"/search": {
"get": {
"operationId": "search",
@ -5397,6 +5564,26 @@
],
"type": "object"
},
"CreateRuleDto": {
"properties": {
"albumId": {
"format": "uuid",
"type": "string"
},
"key": {
"$ref": "#/components/schemas/RuleKey"
},
"value": {
"type": "string"
}
},
"required": [
"albumId",
"key",
"value"
],
"type": "object"
},
"CreateTagDto": {
"properties": {
"name": {
@ -7050,6 +7237,17 @@
},
"type": "object"
},
"UpdateRuleDto": {
"properties": {
"key": {
"$ref": "#/components/schemas/RuleKey"
},
"value": {
"type": "object"
}
},
"type": "object"
},
"UpdateTagDto": {
"properties": {
"name": {

View file

@ -18,6 +18,7 @@ import { StorageTemplateService } from './storage-template';
import { INITIAL_SYSTEM_CONFIG, SystemConfigService } from './system-config';
import { TagService } from './tag';
import { UserService } from './user';
import { RuleService } from './rule';
const providers: Provider[] = [
AlbumService,
@ -30,6 +31,7 @@ const providers: Provider[] = [
MetadataService,
PersonService,
PartnerService,
RuleService,
SearchService,
ServerInfoService,
SharedLinkService,

View file

@ -12,7 +12,7 @@ export class CreateRuleDto {
key!: RuleKey;
@IsNotEmpty()
value!: any;
value!: string;
}
export class UpdateRuleDto {

View file

@ -21,6 +21,7 @@ import {
OAuthController,
PartnerController,
PersonController,
RuleController,
SearchController,
ServerInfoController,
SharedLinkController,
@ -46,6 +47,7 @@ import {
JobController,
OAuthController,
PartnerController,
RuleController,
SearchController,
ServerInfoController,
SharedLinkController,

View file

@ -11,6 +11,7 @@ import {
OAuthApi,
PartnerApi,
PersonApi,
RuleApi,
SearchApi,
ServerInfoApi,
SharedLinkApi,
@ -30,13 +31,14 @@ export class ImmichApi {
public keyApi: APIKeyApi;
public oauthApi: OAuthApi;
public partnerApi: PartnerApi;
public ruleApi: RuleApi;
public searchApi: SearchApi;
public serverInfoApi: ServerInfoApi;
public sharedLinkApi: SharedLinkApi;
public personApi: PersonApi;
public systemConfigApi: SystemConfigApi;
public userApi: UserApi;
private config: Configuration;
constructor(params: ConfigurationParameters) {
@ -49,6 +51,7 @@ export class ImmichApi {
this.keyApi = new APIKeyApi(this.config);
this.oauthApi = new OAuthApi(this.config);
this.partnerApi = new PartnerApi(this.config);
this.ruleApi = new RuleApi(this.config);
this.searchApi = new SearchApi(this.config);
this.serverInfoApi = new ServerInfoApi(this.config);
this.sharedLinkApi = new SharedLinkApi(this.config);
@ -116,6 +119,7 @@ export class ImmichApi {
[JobName.StorageTemplateMigration]: 'Storage Template Migration',
[JobName.BackgroundTask]: 'Background Tasks',
[JobName.Search]: 'Search',
[JobName.SmartAlbum]: 'Smart Albums',
};
return names[jobName];

View file

@ -933,6 +933,33 @@ export interface CreateProfileImageResponseDto {
*/
'userId': string;
}
/**
*
* @export
* @interface CreateRuleDto
*/
export interface CreateRuleDto {
/**
*
* @type {string}
* @memberof CreateRuleDto
*/
'albumId': string;
/**
*
* @type {RuleKey}
* @memberof CreateRuleDto
*/
'key': RuleKey;
/**
*
* @type {string}
* @memberof CreateRuleDto
*/
'value': string;
}
/**
*
* @export
@ -3036,6 +3063,27 @@ export interface UpdateAssetDto {
*/
'tagIds'?: Array<string>;
}
/**
*
* @export
* @interface UpdateRuleDto
*/
export interface UpdateRuleDto {
/**
*
* @type {RuleKey}
* @memberof UpdateRuleDto
*/
'key'?: RuleKey;
/**
*
* @type {object}
* @memberof UpdateRuleDto
*/
'value'?: object;
}
/**
*
* @export
@ -9666,6 +9714,404 @@ export class PersonApi extends BaseAPI {
}
/**
* RuleApi - axios parameter creator
* @export
*/
export const RuleApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @param {CreateRuleDto} createRuleDto
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createRule: async (createRuleDto: CreateRuleDto, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'createRuleDto' is not null or undefined
assertParamExists('createRule', 'createRuleDto', createRuleDto)
const localVarPath = `/rule`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication cookie required
// authentication api_key required
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration)
// authentication bearer required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(createRuleDto, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getRule: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('getRule', 'id', id)
const localVarPath = `/rule/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication cookie required
// authentication api_key required
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration)
// authentication bearer required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
removeRule: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('removeRule', 'id', id)
const localVarPath = `/rule/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication cookie required
// authentication api_key required
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration)
// authentication bearer required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} id
* @param {UpdateRuleDto} updateRuleDto
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateRule: async (id: string, updateRuleDto: UpdateRuleDto, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('updateRule', 'id', id)
// verify required parameter 'updateRuleDto' is not null or undefined
assertParamExists('updateRule', 'updateRuleDto', updateRuleDto)
const localVarPath = `/rule/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication cookie required
// authentication api_key required
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration)
// authentication bearer required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(updateRuleDto, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* RuleApi - functional programming interface
* @export
*/
export const RuleApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = RuleApiAxiosParamCreator(configuration)
return {
/**
*
* @param {CreateRuleDto} createRuleDto
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createRule(createRuleDto: CreateRuleDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RuleResponseDto>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createRule(createRuleDto, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getRule(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RuleResponseDto>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getRule(id, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async removeRule(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.removeRule(id, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} id
* @param {UpdateRuleDto} updateRuleDto
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateRule(id: string, updateRuleDto: UpdateRuleDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RuleResponseDto>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateRule(id, updateRuleDto, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};
/**
* RuleApi - factory interface
* @export
*/
export const RuleApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = RuleApiFp(configuration)
return {
/**
*
* @param {RuleApiCreateRuleRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createRule(requestParameters: RuleApiCreateRuleRequest, options?: AxiosRequestConfig): AxiosPromise<RuleResponseDto> {
return localVarFp.createRule(requestParameters.createRuleDto, options).then((request) => request(axios, basePath));
},
/**
*
* @param {RuleApiGetRuleRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getRule(requestParameters: RuleApiGetRuleRequest, options?: AxiosRequestConfig): AxiosPromise<RuleResponseDto> {
return localVarFp.getRule(requestParameters.id, options).then((request) => request(axios, basePath));
},
/**
*
* @param {RuleApiRemoveRuleRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
removeRule(requestParameters: RuleApiRemoveRuleRequest, options?: AxiosRequestConfig): AxiosPromise<void> {
return localVarFp.removeRule(requestParameters.id, options).then((request) => request(axios, basePath));
},
/**
*
* @param {RuleApiUpdateRuleRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateRule(requestParameters: RuleApiUpdateRuleRequest, options?: AxiosRequestConfig): AxiosPromise<RuleResponseDto> {
return localVarFp.updateRule(requestParameters.id, requestParameters.updateRuleDto, options).then((request) => request(axios, basePath));
},
};
};
/**
* Request parameters for createRule operation in RuleApi.
* @export
* @interface RuleApiCreateRuleRequest
*/
export interface RuleApiCreateRuleRequest {
/**
*
* @type {CreateRuleDto}
* @memberof RuleApiCreateRule
*/
readonly createRuleDto: CreateRuleDto
}
/**
* Request parameters for getRule operation in RuleApi.
* @export
* @interface RuleApiGetRuleRequest
*/
export interface RuleApiGetRuleRequest {
/**
*
* @type {string}
* @memberof RuleApiGetRule
*/
readonly id: string
}
/**
* Request parameters for removeRule operation in RuleApi.
* @export
* @interface RuleApiRemoveRuleRequest
*/
export interface RuleApiRemoveRuleRequest {
/**
*
* @type {string}
* @memberof RuleApiRemoveRule
*/
readonly id: string
}
/**
* Request parameters for updateRule operation in RuleApi.
* @export
* @interface RuleApiUpdateRuleRequest
*/
export interface RuleApiUpdateRuleRequest {
/**
*
* @type {string}
* @memberof RuleApiUpdateRule
*/
readonly id: string
/**
*
* @type {UpdateRuleDto}
* @memberof RuleApiUpdateRule
*/
readonly updateRuleDto: UpdateRuleDto
}
/**
* RuleApi - object-oriented interface
* @export
* @class RuleApi
* @extends {BaseAPI}
*/
export class RuleApi extends BaseAPI {
/**
*
* @param {RuleApiCreateRuleRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof RuleApi
*/
public createRule(requestParameters: RuleApiCreateRuleRequest, options?: AxiosRequestConfig) {
return RuleApiFp(this.configuration).createRule(requestParameters.createRuleDto, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {RuleApiGetRuleRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof RuleApi
*/
public getRule(requestParameters: RuleApiGetRuleRequest, options?: AxiosRequestConfig) {
return RuleApiFp(this.configuration).getRule(requestParameters.id, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {RuleApiRemoveRuleRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof RuleApi
*/
public removeRule(requestParameters: RuleApiRemoveRuleRequest, options?: AxiosRequestConfig) {
return RuleApiFp(this.configuration).removeRule(requestParameters.id, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {RuleApiUpdateRuleRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof RuleApi
*/
public updateRule(requestParameters: RuleApiUpdateRuleRequest, options?: AxiosRequestConfig) {
return RuleApiFp(this.configuration).updateRule(requestParameters.id, requestParameters.updateRuleDto, options).then((request) => request(this.axios, this.basePath));
}
}
/**
* SearchApi - axios parameter creator
* @export

View file

@ -1,7 +1,7 @@
<script lang="ts">
import BaseModal from '$lib/components/shared-components/base-modal.svelte';
import { createEventDispatcher } from 'svelte';
import { RuleKey, type AlbumResponseDto, type PersonResponseDto } from '@api';
import { RuleKey, type AlbumResponseDto, type PersonResponseDto, api } from '@api';
import Plus from 'svelte-material-icons/Plus.svelte';
import Button from '../../elements/buttons/button.svelte';
import Portal from '../../shared-components/portal/portal.svelte';
@ -20,8 +20,24 @@
const dispatch = createEventDispatcher<{ close: void }>();
const handleFaceSelected = (e: CustomEvent<{ people: PersonResponseDto[] }>) => {
const handleFaceSelected = async (e: CustomEvent<{ people: PersonResponseDto[] }>) => {
peopleSelection = false;
const people = e.detail.people;
selectedFaces = people.map((p) => p.id);
};
const updateRule = async () => {
// for (const person of people) {
// const { data } = await api.ruleApi.createRule({
// createRuleDto: {
// albumId: album.id,
// key: RuleKey.Person,
// value: person.id,
// },
// });
// album.rules = [...album.rules, data];
// }
};
</script>
@ -49,6 +65,10 @@
<Plus size="24" />
</button>
</div>
{#each selectedFaces as person (person)}
<div>id: {person}</div>
{/each}
</div>
<!-- Location Selection -->

View file

@ -37,9 +37,9 @@
<div
use:clickOutside
on:outclick={() => !ignoreClickOutside && dispatch('close')}
class="bg-immich-bg dark:bg-immich-dark-gray dark:text-immich-dark-fg max-h-[600px] min-h-[200px] w-[450px] rounded-lg shadow-md"
class="bg-immich-bg dark:bg-immich-dark-gray dark:text-immich-dark-fg min-h-[200px] w-[450px] overflow-y-auto rounded-lg shadow-md"
>
<div class="flex place-items-center justify-between px-5 py-3">
<div class="dark:bg-immich-dark-gray bg-immich-bg sticky top-0 flex place-items-center justify-between px-5 py-3">
<div>
<slot name="title">
<p>Modal Title</p>
@ -49,7 +49,7 @@
<CircleIconButton on:click={() => dispatch('close')} logo={Close} size={'20'} />
</div>
<div class="">
<div class="max-h-[600px]">
<slot />
</div>
</div>