mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat: user pin-code (#18138)
* feat: user pincode * pr feedback * chore: cleanup --------- Co-authored-by: Jason Rasmussen <jason@rasm.me>
This commit is contained in:
parent
55af925ab3
commit
3f719bd8d7
28 changed files with 1392 additions and 39 deletions
7
mobile/openapi/README.md
generated
7
mobile/openapi/README.md
generated
|
|
@ -109,8 +109,12 @@ Class | Method | HTTP request | Description
|
|||
*AssetsApi* | [**uploadAsset**](doc//AssetsApi.md#uploadasset) | **POST** /assets |
|
||||
*AssetsApi* | [**viewAsset**](doc//AssetsApi.md#viewasset) | **GET** /assets/{id}/thumbnail |
|
||||
*AuthenticationApi* | [**changePassword**](doc//AuthenticationApi.md#changepassword) | **POST** /auth/change-password |
|
||||
*AuthenticationApi* | [**changePinCode**](doc//AuthenticationApi.md#changepincode) | **PUT** /auth/pin-code |
|
||||
*AuthenticationApi* | [**getAuthStatus**](doc//AuthenticationApi.md#getauthstatus) | **GET** /auth/status |
|
||||
*AuthenticationApi* | [**login**](doc//AuthenticationApi.md#login) | **POST** /auth/login |
|
||||
*AuthenticationApi* | [**logout**](doc//AuthenticationApi.md#logout) | **POST** /auth/logout |
|
||||
*AuthenticationApi* | [**resetPinCode**](doc//AuthenticationApi.md#resetpincode) | **DELETE** /auth/pin-code |
|
||||
*AuthenticationApi* | [**setupPinCode**](doc//AuthenticationApi.md#setuppincode) | **POST** /auth/pin-code |
|
||||
*AuthenticationApi* | [**signUpAdmin**](doc//AuthenticationApi.md#signupadmin) | **POST** /auth/admin-sign-up |
|
||||
*AuthenticationApi* | [**validateAccessToken**](doc//AuthenticationApi.md#validateaccesstoken) | **POST** /auth/validateToken |
|
||||
*DeprecatedApi* | [**getRandom**](doc//DeprecatedApi.md#getrandom) | **GET** /assets/random |
|
||||
|
|
@ -304,6 +308,7 @@ Class | Method | HTTP request | Description
|
|||
- [AssetTypeEnum](doc//AssetTypeEnum.md)
|
||||
- [AssetVisibility](doc//AssetVisibility.md)
|
||||
- [AudioCodec](doc//AudioCodec.md)
|
||||
- [AuthStatusResponseDto](doc//AuthStatusResponseDto.md)
|
||||
- [AvatarUpdate](doc//AvatarUpdate.md)
|
||||
- [BulkIdResponseDto](doc//BulkIdResponseDto.md)
|
||||
- [BulkIdsDto](doc//BulkIdsDto.md)
|
||||
|
|
@ -383,6 +388,8 @@ Class | Method | HTTP request | Description
|
|||
- [PersonStatisticsResponseDto](doc//PersonStatisticsResponseDto.md)
|
||||
- [PersonUpdateDto](doc//PersonUpdateDto.md)
|
||||
- [PersonWithFacesResponseDto](doc//PersonWithFacesResponseDto.md)
|
||||
- [PinCodeChangeDto](doc//PinCodeChangeDto.md)
|
||||
- [PinCodeSetupDto](doc//PinCodeSetupDto.md)
|
||||
- [PlacesResponseDto](doc//PlacesResponseDto.md)
|
||||
- [PurchaseResponse](doc//PurchaseResponse.md)
|
||||
- [PurchaseUpdate](doc//PurchaseUpdate.md)
|
||||
|
|
|
|||
3
mobile/openapi/lib/api.dart
generated
3
mobile/openapi/lib/api.dart
generated
|
|
@ -108,6 +108,7 @@ part 'model/asset_stats_response_dto.dart';
|
|||
part 'model/asset_type_enum.dart';
|
||||
part 'model/asset_visibility.dart';
|
||||
part 'model/audio_codec.dart';
|
||||
part 'model/auth_status_response_dto.dart';
|
||||
part 'model/avatar_update.dart';
|
||||
part 'model/bulk_id_response_dto.dart';
|
||||
part 'model/bulk_ids_dto.dart';
|
||||
|
|
@ -187,6 +188,8 @@ part 'model/person_response_dto.dart';
|
|||
part 'model/person_statistics_response_dto.dart';
|
||||
part 'model/person_update_dto.dart';
|
||||
part 'model/person_with_faces_response_dto.dart';
|
||||
part 'model/pin_code_change_dto.dart';
|
||||
part 'model/pin_code_setup_dto.dart';
|
||||
part 'model/places_response_dto.dart';
|
||||
part 'model/purchase_response.dart';
|
||||
part 'model/purchase_update.dart';
|
||||
|
|
|
|||
158
mobile/openapi/lib/api/authentication_api.dart
generated
158
mobile/openapi/lib/api/authentication_api.dart
generated
|
|
@ -63,6 +63,86 @@ class AuthenticationApi {
|
|||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'PUT /auth/pin-code' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [PinCodeChangeDto] pinCodeChangeDto (required):
|
||||
Future<Response> changePinCodeWithHttpInfo(PinCodeChangeDto pinCodeChangeDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/auth/pin-code';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = pinCodeChangeDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'PUT',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [PinCodeChangeDto] pinCodeChangeDto (required):
|
||||
Future<void> changePinCode(PinCodeChangeDto pinCodeChangeDto,) async {
|
||||
final response = await changePinCodeWithHttpInfo(pinCodeChangeDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /auth/status' operation and returns the [Response].
|
||||
Future<Response> getAuthStatusWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/auth/status';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
Future<AuthStatusResponseDto?> getAuthStatus() async {
|
||||
final response = await getAuthStatusWithHttpInfo();
|
||||
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), 'AuthStatusResponseDto',) as AuthStatusResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'POST /auth/login' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
|
|
@ -151,6 +231,84 @@ class AuthenticationApi {
|
|||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'DELETE /auth/pin-code' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [PinCodeChangeDto] pinCodeChangeDto (required):
|
||||
Future<Response> resetPinCodeWithHttpInfo(PinCodeChangeDto pinCodeChangeDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/auth/pin-code';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = pinCodeChangeDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'DELETE',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [PinCodeChangeDto] pinCodeChangeDto (required):
|
||||
Future<void> resetPinCode(PinCodeChangeDto pinCodeChangeDto,) async {
|
||||
final response = await resetPinCodeWithHttpInfo(pinCodeChangeDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'POST /auth/pin-code' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [PinCodeSetupDto] pinCodeSetupDto (required):
|
||||
Future<Response> setupPinCodeWithHttpInfo(PinCodeSetupDto pinCodeSetupDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/auth/pin-code';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = pinCodeSetupDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
apiPath,
|
||||
'POST',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [PinCodeSetupDto] pinCodeSetupDto (required):
|
||||
Future<void> setupPinCode(PinCodeSetupDto pinCodeSetupDto,) async {
|
||||
final response = await setupPinCodeWithHttpInfo(pinCodeSetupDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'POST /auth/admin-sign-up' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
|
|
|
|||
6
mobile/openapi/lib/api_client.dart
generated
6
mobile/openapi/lib/api_client.dart
generated
|
|
@ -272,6 +272,8 @@ class ApiClient {
|
|||
return AssetVisibilityTypeTransformer().decode(value);
|
||||
case 'AudioCodec':
|
||||
return AudioCodecTypeTransformer().decode(value);
|
||||
case 'AuthStatusResponseDto':
|
||||
return AuthStatusResponseDto.fromJson(value);
|
||||
case 'AvatarUpdate':
|
||||
return AvatarUpdate.fromJson(value);
|
||||
case 'BulkIdResponseDto':
|
||||
|
|
@ -430,6 +432,10 @@ class ApiClient {
|
|||
return PersonUpdateDto.fromJson(value);
|
||||
case 'PersonWithFacesResponseDto':
|
||||
return PersonWithFacesResponseDto.fromJson(value);
|
||||
case 'PinCodeChangeDto':
|
||||
return PinCodeChangeDto.fromJson(value);
|
||||
case 'PinCodeSetupDto':
|
||||
return PinCodeSetupDto.fromJson(value);
|
||||
case 'PlacesResponseDto':
|
||||
return PlacesResponseDto.fromJson(value);
|
||||
case 'PurchaseResponse':
|
||||
|
|
|
|||
107
mobile/openapi/lib/model/auth_status_response_dto.dart
generated
Normal file
107
mobile/openapi/lib/model/auth_status_response_dto.dart
generated
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.18
|
||||
|
||||
// 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 AuthStatusResponseDto {
|
||||
/// Returns a new [AuthStatusResponseDto] instance.
|
||||
AuthStatusResponseDto({
|
||||
required this.password,
|
||||
required this.pinCode,
|
||||
});
|
||||
|
||||
bool password;
|
||||
|
||||
bool pinCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AuthStatusResponseDto &&
|
||||
other.password == password &&
|
||||
other.pinCode == pinCode;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(password.hashCode) +
|
||||
(pinCode.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AuthStatusResponseDto[password=$password, pinCode=$pinCode]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'password'] = this.password;
|
||||
json[r'pinCode'] = this.pinCode;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AuthStatusResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static AuthStatusResponseDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "AuthStatusResponseDto");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return AuthStatusResponseDto(
|
||||
password: mapValueOfType<bool>(json, r'password')!,
|
||||
pinCode: mapValueOfType<bool>(json, r'pinCode')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AuthStatusResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AuthStatusResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AuthStatusResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AuthStatusResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, AuthStatusResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AuthStatusResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of AuthStatusResponseDto-objects as value to a dart map
|
||||
static Map<String, List<AuthStatusResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AuthStatusResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = AuthStatusResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'password',
|
||||
'pinCode',
|
||||
};
|
||||
}
|
||||
|
||||
133
mobile/openapi/lib/model/pin_code_change_dto.dart
generated
Normal file
133
mobile/openapi/lib/model/pin_code_change_dto.dart
generated
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.18
|
||||
|
||||
// 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 PinCodeChangeDto {
|
||||
/// Returns a new [PinCodeChangeDto] instance.
|
||||
PinCodeChangeDto({
|
||||
required this.newPinCode,
|
||||
this.password,
|
||||
this.pinCode,
|
||||
});
|
||||
|
||||
String newPinCode;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
String? password;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
String? pinCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is PinCodeChangeDto &&
|
||||
other.newPinCode == newPinCode &&
|
||||
other.password == password &&
|
||||
other.pinCode == pinCode;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(newPinCode.hashCode) +
|
||||
(password == null ? 0 : password!.hashCode) +
|
||||
(pinCode == null ? 0 : pinCode!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'PinCodeChangeDto[newPinCode=$newPinCode, password=$password, pinCode=$pinCode]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'newPinCode'] = this.newPinCode;
|
||||
if (this.password != null) {
|
||||
json[r'password'] = this.password;
|
||||
} else {
|
||||
// json[r'password'] = null;
|
||||
}
|
||||
if (this.pinCode != null) {
|
||||
json[r'pinCode'] = this.pinCode;
|
||||
} else {
|
||||
// json[r'pinCode'] = null;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [PinCodeChangeDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static PinCodeChangeDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "PinCodeChangeDto");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return PinCodeChangeDto(
|
||||
newPinCode: mapValueOfType<String>(json, r'newPinCode')!,
|
||||
password: mapValueOfType<String>(json, r'password'),
|
||||
pinCode: mapValueOfType<String>(json, r'pinCode'),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<PinCodeChangeDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <PinCodeChangeDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = PinCodeChangeDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, PinCodeChangeDto> mapFromJson(dynamic json) {
|
||||
final map = <String, PinCodeChangeDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = PinCodeChangeDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of PinCodeChangeDto-objects as value to a dart map
|
||||
static Map<String, List<PinCodeChangeDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<PinCodeChangeDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = PinCodeChangeDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'newPinCode',
|
||||
};
|
||||
}
|
||||
|
||||
99
mobile/openapi/lib/model/pin_code_setup_dto.dart
generated
Normal file
99
mobile/openapi/lib/model/pin_code_setup_dto.dart
generated
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.18
|
||||
|
||||
// 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 PinCodeSetupDto {
|
||||
/// Returns a new [PinCodeSetupDto] instance.
|
||||
PinCodeSetupDto({
|
||||
required this.pinCode,
|
||||
});
|
||||
|
||||
String pinCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is PinCodeSetupDto &&
|
||||
other.pinCode == pinCode;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(pinCode.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'PinCodeSetupDto[pinCode=$pinCode]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'pinCode'] = this.pinCode;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [PinCodeSetupDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static PinCodeSetupDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "PinCodeSetupDto");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return PinCodeSetupDto(
|
||||
pinCode: mapValueOfType<String>(json, r'pinCode')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<PinCodeSetupDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <PinCodeSetupDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = PinCodeSetupDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, PinCodeSetupDto> mapFromJson(dynamic json) {
|
||||
final map = <String, PinCodeSetupDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = PinCodeSetupDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of PinCodeSetupDto-objects as value to a dart map
|
||||
static Map<String, List<PinCodeSetupDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<PinCodeSetupDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = PinCodeSetupDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'pinCode',
|
||||
};
|
||||
}
|
||||
|
||||
13
mobile/openapi/lib/model/user_admin_update_dto.dart
generated
13
mobile/openapi/lib/model/user_admin_update_dto.dart
generated
|
|
@ -17,6 +17,7 @@ class UserAdminUpdateDto {
|
|||
this.email,
|
||||
this.name,
|
||||
this.password,
|
||||
this.pinCode,
|
||||
this.quotaSizeInBytes,
|
||||
this.shouldChangePassword,
|
||||
this.storageLabel,
|
||||
|
|
@ -48,6 +49,8 @@ class UserAdminUpdateDto {
|
|||
///
|
||||
String? password;
|
||||
|
||||
String? pinCode;
|
||||
|
||||
/// Minimum value: 0
|
||||
int? quotaSizeInBytes;
|
||||
|
||||
|
|
@ -67,6 +70,7 @@ class UserAdminUpdateDto {
|
|||
other.email == email &&
|
||||
other.name == name &&
|
||||
other.password == password &&
|
||||
other.pinCode == pinCode &&
|
||||
other.quotaSizeInBytes == quotaSizeInBytes &&
|
||||
other.shouldChangePassword == shouldChangePassword &&
|
||||
other.storageLabel == storageLabel;
|
||||
|
|
@ -78,12 +82,13 @@ class UserAdminUpdateDto {
|
|||
(email == null ? 0 : email!.hashCode) +
|
||||
(name == null ? 0 : name!.hashCode) +
|
||||
(password == null ? 0 : password!.hashCode) +
|
||||
(pinCode == null ? 0 : pinCode!.hashCode) +
|
||||
(quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) +
|
||||
(shouldChangePassword == null ? 0 : shouldChangePassword!.hashCode) +
|
||||
(storageLabel == null ? 0 : storageLabel!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'UserAdminUpdateDto[avatarColor=$avatarColor, email=$email, name=$name, password=$password, quotaSizeInBytes=$quotaSizeInBytes, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel]';
|
||||
String toString() => 'UserAdminUpdateDto[avatarColor=$avatarColor, email=$email, name=$name, password=$password, pinCode=$pinCode, quotaSizeInBytes=$quotaSizeInBytes, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
|
|
@ -107,6 +112,11 @@ class UserAdminUpdateDto {
|
|||
} else {
|
||||
// json[r'password'] = null;
|
||||
}
|
||||
if (this.pinCode != null) {
|
||||
json[r'pinCode'] = this.pinCode;
|
||||
} else {
|
||||
// json[r'pinCode'] = null;
|
||||
}
|
||||
if (this.quotaSizeInBytes != null) {
|
||||
json[r'quotaSizeInBytes'] = this.quotaSizeInBytes;
|
||||
} else {
|
||||
|
|
@ -138,6 +148,7 @@ class UserAdminUpdateDto {
|
|||
email: mapValueOfType<String>(json, r'email'),
|
||||
name: mapValueOfType<String>(json, r'name'),
|
||||
password: mapValueOfType<String>(json, r'password'),
|
||||
pinCode: mapValueOfType<String>(json, r'pinCode'),
|
||||
quotaSizeInBytes: mapValueOfType<int>(json, r'quotaSizeInBytes'),
|
||||
shouldChangePassword: mapValueOfType<bool>(json, r'shouldChangePassword'),
|
||||
storageLabel: mapValueOfType<String>(json, r'storageLabel'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue