diff --git a/.gitmodules b/.gitmodules index 9000d5b618a..76cac63a6bd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -31,3 +31,6 @@ [submodule "external/emoji-metadata"] path = external/emoji-metadata url = https://github.com/googlefonts/emoji-metadata +[submodule "external/nextcloud-password_policy"] + path = external/nextcloud-password_policy + url = https://github.com/nextcloud/password_policy.git diff --git a/external/nextcloud-password_policy b/external/nextcloud-password_policy new file mode 160000 index 00000000000..1ce1ceaceb6 --- /dev/null +++ b/external/nextcloud-password_policy @@ -0,0 +1 @@ +Subproject commit 1ce1ceaceb62cdb53d9f8248d11d2577addc0404 diff --git a/packages/neon_framework/packages/talk_app/test/message_test.dart b/packages/neon_framework/packages/talk_app/test/message_test.dart index e2eed60d849..eee2f51cdc7 100644 --- a/packages/neon_framework/packages/talk_app/test/message_test.dart +++ b/packages/neon_framework/packages/talk_app/test/message_test.dart @@ -61,6 +61,7 @@ core.OcsGetCapabilitiesResponseApplicationJson_Ocs_Data buildCapabilities(core.S filesVersionsCapabilities: null, notesCapabilities: null, notificationsCapabilities: null, + passwordPolicyCapabilities: null, provisioningApiCapabilities: null, sharebymailCapabilities: null, spreedCapabilities: null, diff --git a/packages/neon_framework/test/apps_bloc_test.dart b/packages/neon_framework/test/apps_bloc_test.dart index b8749efeb34..fbbe9d9d8bc 100644 --- a/packages/neon_framework/test/apps_bloc_test.dart +++ b/packages/neon_framework/test/apps_bloc_test.dart @@ -98,6 +98,7 @@ core.OcsGetCapabilitiesResponseApplicationJson_Ocs_Data buildCapabilities( filesVersionsCapabilities: null, notesCapabilities: null, notificationsCapabilities: capabilities, + passwordPolicyCapabilities: null, provisioningApiCapabilities: null, sharebymailCapabilities: null, spreedCapabilities: null, diff --git a/packages/neon_framework/test/dialog_test.dart b/packages/neon_framework/test/dialog_test.dart index 5e21dd83fbf..31d9ca0a1ab 100644 --- a/packages/neon_framework/test/dialog_test.dart +++ b/packages/neon_framework/test/dialog_test.dart @@ -386,6 +386,7 @@ void main() { filesVersionsCapabilities: null, notesCapabilities: null, notificationsCapabilities: null, + passwordPolicyCapabilities: null, provisioningApiCapabilities: null, sharebymailCapabilities: null, spreedCapabilities: null, diff --git a/packages/neon_framework/test/references_bloc_test.dart b/packages/neon_framework/test/references_bloc_test.dart index b7785156c6d..aa076f0ee0d 100644 --- a/packages/neon_framework/test/references_bloc_test.dart +++ b/packages/neon_framework/test/references_bloc_test.dart @@ -82,6 +82,7 @@ core.OcsGetCapabilitiesResponseApplicationJson_Ocs_Data buildCapabilities() => filesVersionsCapabilities: null, notesCapabilities: null, notificationsCapabilities: null, + passwordPolicyCapabilities: null, provisioningApiCapabilities: null, sharebymailCapabilities: null, spreedCapabilities: null, diff --git a/packages/neon_framework/test/weather_status_bloc_test.dart b/packages/neon_framework/test/weather_status_bloc_test.dart index 637ecf43097..2c1e093e523 100644 --- a/packages/neon_framework/test/weather_status_bloc_test.dart +++ b/packages/neon_framework/test/weather_status_bloc_test.dart @@ -121,6 +121,7 @@ core.OcsGetCapabilitiesResponseApplicationJson_Ocs_Data buildCapabilities({requi filesVersionsCapabilities: null, notesCapabilities: null, notificationsCapabilities: null, + passwordPolicyCapabilities: null, provisioningApiCapabilities: null, sharebymailCapabilities: null, spreedCapabilities: null, diff --git a/packages/nextcloud/README.md b/packages/nextcloud/README.md index 32c9aa682a9..dd9129cfa20 100644 --- a/packages/nextcloud/README.md +++ b/packages/nextcloud/README.md @@ -65,7 +65,7 @@ For an example checkout the [example](https://github.com/nextcloud/neon/blob/mai [Do not edit manually above]: # 1: Other versions might be supported too or at least mostly working, but we do not test against those. -2: Server includes the following apps: comments, core, dashboard, dav, files, files_external, files_reminders, files_sharing, files_trashbin, files_versions, provisioning_api, settings, sharebymail, systemtags, theming, updatenotification, user_ldap, user_status, weather_status, webhook_listeners and WebDAV. +2: Server includes the following apps: comments, core, dashboard, dav, files, files_external, files_reminders, files_sharing, files_trashbin, files_versions, password_policy, provisioning_api, settings, sharebymail, systemtags, theming, updatenotification, user_ldap, user_status, weather_status, webhook_listeners and WebDAV. We aim to support all currently maintained server versions and all app versions that support those server versions. The currently maintained server versions can be found here: https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule. diff --git a/packages/nextcloud/lib/password_policy.dart b/packages/nextcloud/lib/password_policy.dart new file mode 100644 index 00000000000..2a801643859 --- /dev/null +++ b/packages/nextcloud/lib/password_policy.dart @@ -0,0 +1,15 @@ +import 'package:nextcloud/src/api/password_policy/password_policy.openapi.dart'; +import 'package:nextcloud/src/nextcloud_client.dart'; + +export 'package:nextcloud/src/api/password_policy/password_policy.openapi.dart'; + +/// ID for the password_policy app. +const String appID = 'password_policy'; + +/// Client for the password_policy APIs. +extension PasswordPolicyExtension on NextcloudClient { + static final _passwordPolicy = Expando<$Client>(); + + /// Client for the password_policy APIs. + $Client get passwordPolicy => _passwordPolicy[this] ??= $Client.fromClient(this); +} diff --git a/packages/nextcloud/lib/src/api/core/core.openapi.dart b/packages/nextcloud/lib/src/api/core/core.openapi.dart index 1f85d1dd179..8d471f84a3e 100644 --- a/packages/nextcloud/lib/src/api/core/core.openapi.dart +++ b/packages/nextcloud/lib/src/api/core/core.openapi.dart @@ -14030,6 +14030,204 @@ abstract class NotificationsCapabilities } } +@BuiltValue(instantiable: false) +sealed class $PasswordPolicyCapabilities_PasswordPolicy_ApiInterface { + String get generate; + String get validate; + + /// Rebuilds the instance. + /// + /// The result is the same as this instance but with [updates] applied. + /// [updates] is a function that takes a builder [$PasswordPolicyCapabilities_PasswordPolicy_ApiInterfaceBuilder]. + $PasswordPolicyCapabilities_PasswordPolicy_ApiInterface rebuild( + void Function($PasswordPolicyCapabilities_PasswordPolicy_ApiInterfaceBuilder) updates, + ); + + /// Converts the instance to a builder [$PasswordPolicyCapabilities_PasswordPolicy_ApiInterfaceBuilder]. + $PasswordPolicyCapabilities_PasswordPolicy_ApiInterfaceBuilder toBuilder(); + @BuiltValueHook(initializeBuilder: true) + static void _defaults($PasswordPolicyCapabilities_PasswordPolicy_ApiInterfaceBuilder b) {} + @BuiltValueHook(finalizeBuilder: true) + static void _validate($PasswordPolicyCapabilities_PasswordPolicy_ApiInterfaceBuilder b) {} +} + +abstract class PasswordPolicyCapabilities_PasswordPolicy_Api + implements + $PasswordPolicyCapabilities_PasswordPolicy_ApiInterface, + Built { + /// Creates a new PasswordPolicyCapabilities_PasswordPolicy_Api object using the builder pattern. + factory PasswordPolicyCapabilities_PasswordPolicy_Api([ + void Function(PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder)? b, + ]) = _$PasswordPolicyCapabilities_PasswordPolicy_Api; + + // coverage:ignore-start + const PasswordPolicyCapabilities_PasswordPolicy_Api._(); + // coverage:ignore-end + + /// Creates a new object from the given [json] data. + /// + /// Use [toJson] to serialize it back into json. + // coverage:ignore-start + factory PasswordPolicyCapabilities_PasswordPolicy_Api.fromJson(Map json) => + _$jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + /// Parses this object into a json like map. + /// + /// Use the fromJson factory to revive it again. + // coverage:ignore-start + Map toJson() => _$jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + + /// Serializer for PasswordPolicyCapabilities_PasswordPolicy_Api. + static Serializer get serializer => + _$passwordPolicyCapabilitiesPasswordPolicyApiSerializer; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder b) { + $PasswordPolicyCapabilities_PasswordPolicy_ApiInterface._defaults(b); + } + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder b) { + $PasswordPolicyCapabilities_PasswordPolicy_ApiInterface._validate(b); + } +} + +@BuiltValue(instantiable: false) +sealed class $PasswordPolicyCapabilities_PasswordPolicyInterface { + int get minLength; + bool get enforceNonCommonPassword; + bool get enforceNumericCharacters; + bool get enforceSpecialCharacters; + bool get enforceUpperLowerCase; + PasswordPolicyCapabilities_PasswordPolicy_Api get api; + + /// Rebuilds the instance. + /// + /// The result is the same as this instance but with [updates] applied. + /// [updates] is a function that takes a builder [$PasswordPolicyCapabilities_PasswordPolicyInterfaceBuilder]. + $PasswordPolicyCapabilities_PasswordPolicyInterface rebuild( + void Function($PasswordPolicyCapabilities_PasswordPolicyInterfaceBuilder) updates, + ); + + /// Converts the instance to a builder [$PasswordPolicyCapabilities_PasswordPolicyInterfaceBuilder]. + $PasswordPolicyCapabilities_PasswordPolicyInterfaceBuilder toBuilder(); + @BuiltValueHook(initializeBuilder: true) + static void _defaults($PasswordPolicyCapabilities_PasswordPolicyInterfaceBuilder b) {} + @BuiltValueHook(finalizeBuilder: true) + static void _validate($PasswordPolicyCapabilities_PasswordPolicyInterfaceBuilder b) { + _i5.checkNumber( + b.minLength, + 'minLength', + minimum: 0, + ); + } +} + +abstract class PasswordPolicyCapabilities_PasswordPolicy + implements + $PasswordPolicyCapabilities_PasswordPolicyInterface, + Built { + /// Creates a new PasswordPolicyCapabilities_PasswordPolicy object using the builder pattern. + factory PasswordPolicyCapabilities_PasswordPolicy([ + void Function(PasswordPolicyCapabilities_PasswordPolicyBuilder)? b, + ]) = _$PasswordPolicyCapabilities_PasswordPolicy; + + // coverage:ignore-start + const PasswordPolicyCapabilities_PasswordPolicy._(); + // coverage:ignore-end + + /// Creates a new object from the given [json] data. + /// + /// Use [toJson] to serialize it back into json. + // coverage:ignore-start + factory PasswordPolicyCapabilities_PasswordPolicy.fromJson(Map json) => + _$jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + /// Parses this object into a json like map. + /// + /// Use the fromJson factory to revive it again. + // coverage:ignore-start + Map toJson() => _$jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + + /// Serializer for PasswordPolicyCapabilities_PasswordPolicy. + static Serializer get serializer => + _$passwordPolicyCapabilitiesPasswordPolicySerializer; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PasswordPolicyCapabilities_PasswordPolicyBuilder b) { + $PasswordPolicyCapabilities_PasswordPolicyInterface._defaults(b); + } + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(PasswordPolicyCapabilities_PasswordPolicyBuilder b) { + $PasswordPolicyCapabilities_PasswordPolicyInterface._validate(b); + } +} + +@BuiltValue(instantiable: false) +sealed class $PasswordPolicyCapabilitiesInterface { + @BuiltValueField(wireName: 'password_policy') + PasswordPolicyCapabilities_PasswordPolicy get passwordPolicy; + + /// Rebuilds the instance. + /// + /// The result is the same as this instance but with [updates] applied. + /// [updates] is a function that takes a builder [$PasswordPolicyCapabilitiesInterfaceBuilder]. + $PasswordPolicyCapabilitiesInterface rebuild(void Function($PasswordPolicyCapabilitiesInterfaceBuilder) updates); + + /// Converts the instance to a builder [$PasswordPolicyCapabilitiesInterfaceBuilder]. + $PasswordPolicyCapabilitiesInterfaceBuilder toBuilder(); + @BuiltValueHook(initializeBuilder: true) + static void _defaults($PasswordPolicyCapabilitiesInterfaceBuilder b) {} + @BuiltValueHook(finalizeBuilder: true) + static void _validate($PasswordPolicyCapabilitiesInterfaceBuilder b) {} +} + +abstract class PasswordPolicyCapabilities + implements + $PasswordPolicyCapabilitiesInterface, + Built { + /// Creates a new PasswordPolicyCapabilities object using the builder pattern. + factory PasswordPolicyCapabilities([void Function(PasswordPolicyCapabilitiesBuilder)? b]) = + _$PasswordPolicyCapabilities; + + // coverage:ignore-start + const PasswordPolicyCapabilities._(); + // coverage:ignore-end + + /// Creates a new object from the given [json] data. + /// + /// Use [toJson] to serialize it back into json. + // coverage:ignore-start + factory PasswordPolicyCapabilities.fromJson(Map json) => + _$jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + /// Parses this object into a json like map. + /// + /// Use the fromJson factory to revive it again. + // coverage:ignore-start + Map toJson() => _$jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + + /// Serializer for PasswordPolicyCapabilities. + static Serializer get serializer => _$passwordPolicyCapabilitiesSerializer; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PasswordPolicyCapabilitiesBuilder b) { + $PasswordPolicyCapabilitiesInterface._defaults(b); + } + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(PasswordPolicyCapabilitiesBuilder b) { + $PasswordPolicyCapabilitiesInterface._validate(b); + } +} + @BuiltValue(instantiable: false) sealed class $ProvisioningApiCapabilities_ProvisioningApiInterface { String get version; @@ -16000,6 +16198,7 @@ typedef OcsGetCapabilitiesResponseApplicationJson_Ocs_Data_Capabilities = ({ FilesVersionsCapabilities? filesVersionsCapabilities, NotesCapabilities? notesCapabilities, NotificationsCapabilities? notificationsCapabilities, + PasswordPolicyCapabilities? passwordPolicyCapabilities, ProvisioningApiCapabilities? provisioningApiCapabilities, SharebymailCapabilities? sharebymailCapabilities, SpreedCapabilities? spreedCapabilities, @@ -27064,13 +27263,13 @@ extension $OcsGetCapabilitiesResponseApplicationJson_Ocs_Data_CapabilitiesExtens /// Serializer for OcsGetCapabilitiesResponseApplicationJson_Ocs_Data_Capabilities. @BuiltValueSerializer(custom: true) static Serializer get serializer => - $ff3cbb941adc0f0f38f18ba5aabd7f48Extension._serializer; + $f800ec38bc53f35ef8f05fc4ee2dc2b1Extension._serializer; /// Creates a new object from the given [json] data. /// /// Use `toJson` to serialize it back into json. static OcsGetCapabilitiesResponseApplicationJson_Ocs_Data_Capabilities fromJson(Object? json) => - $ff3cbb941adc0f0f38f18ba5aabd7f48Extension._fromJson(json); + $f800ec38bc53f35ef8f05fc4ee2dc2b1Extension._fromJson(json); } /// Serialization extension for `TaskProcessingTaskType_InputShapeDefaults`. @@ -27474,7 +27673,7 @@ class _$06c2e47196a84ebc3718dccf9eb4b29dSerializer implements PrimitiveSerialize } } -typedef _$ff3cbb941adc0f0f38f18ba5aabd7f48 = ({ +typedef _$f800ec38bc53f35ef8f05fc4ee2dc2b1 = ({ CommentsCapabilities? commentsCapabilities, CoreCapabilities? coreCapabilities, CorePublicCapabilities? corePublicCapabilities, @@ -27486,6 +27685,7 @@ typedef _$ff3cbb941adc0f0f38f18ba5aabd7f48 = ({ FilesVersionsCapabilities? filesVersionsCapabilities, NotesCapabilities? notesCapabilities, NotificationsCapabilities? notificationsCapabilities, + PasswordPolicyCapabilities? passwordPolicyCapabilities, ProvisioningApiCapabilities? provisioningApiCapabilities, SharebymailCapabilities? sharebymailCapabilities, SpreedCapabilities? spreedCapabilities, @@ -27499,7 +27699,7 @@ typedef _$ff3cbb941adc0f0f38f18ba5aabd7f48 = ({ /// @nodoc // ignore: library_private_types_in_public_api -extension $ff3cbb941adc0f0f38f18ba5aabd7f48Extension on _$ff3cbb941adc0f0f38f18ba5aabd7f48 { +extension $f800ec38bc53f35ef8f05fc4ee2dc2b1Extension on _$f800ec38bc53f35ef8f05fc4ee2dc2b1 { List get _values => [ commentsCapabilities, coreCapabilities, @@ -27512,6 +27712,7 @@ extension $ff3cbb941adc0f0f38f18ba5aabd7f48Extension on _$ff3cbb941adc0f0f38f18b filesVersionsCapabilities, notesCapabilities, notificationsCapabilities, + passwordPolicyCapabilities, provisioningApiCapabilities, sharebymailCapabilities, spreedCapabilities, @@ -27534,6 +27735,7 @@ extension $ff3cbb941adc0f0f38f18ba5aabd7f48Extension on _$ff3cbb941adc0f0f38f18b 'filesVersionsCapabilities', 'notesCapabilities', 'notificationsCapabilities', + 'passwordPolicyCapabilities', 'provisioningApiCapabilities', 'sharebymailCapabilities', 'spreedCapabilities', @@ -27556,9 +27758,9 @@ extension $ff3cbb941adc0f0f38f18ba5aabd7f48Extension on _$ff3cbb941adc0f0f38f18b _values, _names, ); - static Serializer<_$ff3cbb941adc0f0f38f18ba5aabd7f48> get _serializer => - const _$ff3cbb941adc0f0f38f18ba5aabd7f48Serializer(); - static _$ff3cbb941adc0f0f38f18ba5aabd7f48 _fromJson(Object? json) => + static Serializer<_$f800ec38bc53f35ef8f05fc4ee2dc2b1> get _serializer => + const _$f800ec38bc53f35ef8f05fc4ee2dc2b1Serializer(); + static _$f800ec38bc53f35ef8f05fc4ee2dc2b1 _fromJson(Object? json) => _$jsonSerializers.deserializeWith(_serializer, json)!; /// Parses this object into a json like map. @@ -27567,19 +27769,19 @@ extension $ff3cbb941adc0f0f38f18ba5aabd7f48Extension on _$ff3cbb941adc0f0f38f18b Object? toJson() => _$jsonSerializers.serializeWith(_serializer, this); } -class _$ff3cbb941adc0f0f38f18ba5aabd7f48Serializer implements PrimitiveSerializer<_$ff3cbb941adc0f0f38f18ba5aabd7f48> { - const _$ff3cbb941adc0f0f38f18ba5aabd7f48Serializer(); +class _$f800ec38bc53f35ef8f05fc4ee2dc2b1Serializer implements PrimitiveSerializer<_$f800ec38bc53f35ef8f05fc4ee2dc2b1> { + const _$f800ec38bc53f35ef8f05fc4ee2dc2b1Serializer(); @override - Iterable get types => const [_$ff3cbb941adc0f0f38f18ba5aabd7f48]; + Iterable get types => const [_$f800ec38bc53f35ef8f05fc4ee2dc2b1]; @override - String get wireName => r'_$ff3cbb941adc0f0f38f18ba5aabd7f48'; + String get wireName => r'_$f800ec38bc53f35ef8f05fc4ee2dc2b1'; @override Object serialize( Serializers serializers, - _$ff3cbb941adc0f0f38f18ba5aabd7f48 object, { + _$f800ec38bc53f35ef8f05fc4ee2dc2b1 object, { FullType specifiedType = FullType.unspecified, }) { dynamic value; @@ -27627,6 +27829,10 @@ class _$ff3cbb941adc0f0f38f18ba5aabd7f48Serializer implements PrimitiveSerialize if (value != null) { return serializers.serialize(value, specifiedType: const FullType(NotificationsCapabilities))!; } + value = object.passwordPolicyCapabilities; + if (value != null) { + return serializers.serialize(value, specifiedType: const FullType(PasswordPolicyCapabilities))!; + } value = object.provisioningApiCapabilities; if (value != null) { return serializers.serialize(value, specifiedType: const FullType(ProvisioningApiCapabilities))!; @@ -27668,7 +27874,7 @@ class _$ff3cbb941adc0f0f38f18ba5aabd7f48Serializer implements PrimitiveSerialize } @override - _$ff3cbb941adc0f0f38f18ba5aabd7f48 deserialize( + _$f800ec38bc53f35ef8f05fc4ee2dc2b1 deserialize( Serializers serializers, Object data, { FullType specifiedType = FullType.unspecified, @@ -27750,6 +27956,13 @@ class _$ff3cbb941adc0f0f38f18ba5aabd7f48Serializer implements PrimitiveSerialize specifiedType: const FullType(NotificationsCapabilities), )! as NotificationsCapabilities; } catch (_) {} + PasswordPolicyCapabilities? passwordPolicyCapabilities; + try { + passwordPolicyCapabilities = serializers.deserialize( + data, + specifiedType: const FullType(PasswordPolicyCapabilities), + )! as PasswordPolicyCapabilities; + } catch (_) {} ProvisioningApiCapabilities? provisioningApiCapabilities; try { provisioningApiCapabilities = serializers.deserialize( @@ -27827,6 +28040,7 @@ class _$ff3cbb941adc0f0f38f18ba5aabd7f48Serializer implements PrimitiveSerialize filesVersionsCapabilities: filesVersionsCapabilities, notesCapabilities: notesCapabilities, notificationsCapabilities: notificationsCapabilities, + passwordPolicyCapabilities: passwordPolicyCapabilities, provisioningApiCapabilities: provisioningApiCapabilities, sharebymailCapabilities: sharebymailCapabilities, spreedCapabilities: spreedCapabilities, @@ -28488,6 +28702,18 @@ final Serializers _$serializers = (Serializers().toBuilder() NotificationsCapabilities_NotificationsBuilder.new, ) ..add(NotificationsCapabilities_Notifications.serializer) + ..addBuilderFactory(const FullType(PasswordPolicyCapabilities), PasswordPolicyCapabilitiesBuilder.new) + ..add(PasswordPolicyCapabilities.serializer) + ..addBuilderFactory( + const FullType(PasswordPolicyCapabilities_PasswordPolicy), + PasswordPolicyCapabilities_PasswordPolicyBuilder.new, + ) + ..add(PasswordPolicyCapabilities_PasswordPolicy.serializer) + ..addBuilderFactory( + const FullType(PasswordPolicyCapabilities_PasswordPolicy_Api), + PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder.new, + ) + ..add(PasswordPolicyCapabilities_PasswordPolicy_Api.serializer) ..addBuilderFactory(const FullType(ProvisioningApiCapabilities), ProvisioningApiCapabilitiesBuilder.new) ..add(ProvisioningApiCapabilities.serializer) ..addBuilderFactory( @@ -28604,7 +28830,7 @@ final Serializers _$serializers = (Serializers().toBuilder() ..add(NotesCapabilities.serializer) ..addBuilderFactory(const FullType(NotesCapabilities_Notes), NotesCapabilities_NotesBuilder.new) ..add(NotesCapabilities_Notes.serializer) - ..add($ff3cbb941adc0f0f38f18ba5aabd7f48Extension._serializer) + ..add($f800ec38bc53f35ef8f05fc4ee2dc2b1Extension._serializer) ..add(PreviewGetPreviewA.serializer) ..add(PreviewGetPreviewForceIcon.serializer) ..add(PreviewGetPreviewMode.serializer) @@ -29432,7 +29658,7 @@ final Serializers _$jsonSerializers = (_$serializers.toBuilder() _$b2c4857c0136baea42828d89c87c757d, _$46564992d3ed3482aa6c1162698aac99, _$06c2e47196a84ebc3718dccf9eb4b29d, - _$ff3cbb941adc0f0f38f18ba5aabd7f48, + _$f800ec38bc53f35ef8f05fc4ee2dc2b1, _$b6d67dc2a96424d2f407f8e51557f3de, _$17b504aaa197cb55522acb1f128f183a, }, diff --git a/packages/nextcloud/lib/src/api/core/core.openapi.g.dart b/packages/nextcloud/lib/src/api/core/core.openapi.g.dart index 09f298b42af..ccb79f9b3b8 100644 --- a/packages/nextcloud/lib/src/api/core/core.openapi.g.dart +++ b/packages/nextcloud/lib/src/api/core/core.openapi.g.dart @@ -875,6 +875,12 @@ Serializer _$filesVersionsCapabilitiesSerializer = _$ Serializer _$notificationsCapabilitiesNotificationsSerializer = _$NotificationsCapabilities_NotificationsSerializer(); Serializer _$notificationsCapabilitiesSerializer = _$NotificationsCapabilitiesSerializer(); +Serializer _$passwordPolicyCapabilitiesPasswordPolicyApiSerializer = + _$PasswordPolicyCapabilities_PasswordPolicy_ApiSerializer(); +Serializer _$passwordPolicyCapabilitiesPasswordPolicySerializer = + _$PasswordPolicyCapabilities_PasswordPolicySerializer(); +Serializer _$passwordPolicyCapabilitiesSerializer = + _$PasswordPolicyCapabilitiesSerializer(); Serializer _$provisioningApiCapabilitiesProvisioningApiSerializer = _$ProvisioningApiCapabilities_ProvisioningApiSerializer(); Serializer _$provisioningApiCapabilitiesSerializer = @@ -6278,6 +6284,166 @@ class _$NotificationsCapabilitiesSerializer implements StructuredSerializer { + @override + final Iterable types = const [ + PasswordPolicyCapabilities_PasswordPolicy_Api, + _$PasswordPolicyCapabilities_PasswordPolicy_Api + ]; + @override + final String wireName = 'PasswordPolicyCapabilities_PasswordPolicy_Api'; + + @override + Iterable serialize(Serializers serializers, PasswordPolicyCapabilities_PasswordPolicy_Api object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'generate', + serializers.serialize(object.generate, specifiedType: const FullType(String)), + 'validate', + serializers.serialize(object.validate, specifiedType: const FullType(String)), + ]; + + return result; + } + + @override + PasswordPolicyCapabilities_PasswordPolicy_Api deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'generate': + result.generate = serializers.deserialize(value, specifiedType: const FullType(String))! as String; + break; + case 'validate': + result.validate = serializers.deserialize(value, specifiedType: const FullType(String))! as String; + break; + } + } + + return result.build(); + } +} + +class _$PasswordPolicyCapabilities_PasswordPolicySerializer + implements StructuredSerializer { + @override + final Iterable types = const [ + PasswordPolicyCapabilities_PasswordPolicy, + _$PasswordPolicyCapabilities_PasswordPolicy + ]; + @override + final String wireName = 'PasswordPolicyCapabilities_PasswordPolicy'; + + @override + Iterable serialize(Serializers serializers, PasswordPolicyCapabilities_PasswordPolicy object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'minLength', + serializers.serialize(object.minLength, specifiedType: const FullType(int)), + 'enforceNonCommonPassword', + serializers.serialize(object.enforceNonCommonPassword, specifiedType: const FullType(bool)), + 'enforceNumericCharacters', + serializers.serialize(object.enforceNumericCharacters, specifiedType: const FullType(bool)), + 'enforceSpecialCharacters', + serializers.serialize(object.enforceSpecialCharacters, specifiedType: const FullType(bool)), + 'enforceUpperLowerCase', + serializers.serialize(object.enforceUpperLowerCase, specifiedType: const FullType(bool)), + 'api', + serializers.serialize(object.api, specifiedType: const FullType(PasswordPolicyCapabilities_PasswordPolicy_Api)), + ]; + + return result; + } + + @override + PasswordPolicyCapabilities_PasswordPolicy deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = PasswordPolicyCapabilities_PasswordPolicyBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'minLength': + result.minLength = serializers.deserialize(value, specifiedType: const FullType(int))! as int; + break; + case 'enforceNonCommonPassword': + result.enforceNonCommonPassword = + serializers.deserialize(value, specifiedType: const FullType(bool))! as bool; + break; + case 'enforceNumericCharacters': + result.enforceNumericCharacters = + serializers.deserialize(value, specifiedType: const FullType(bool))! as bool; + break; + case 'enforceSpecialCharacters': + result.enforceSpecialCharacters = + serializers.deserialize(value, specifiedType: const FullType(bool))! as bool; + break; + case 'enforceUpperLowerCase': + result.enforceUpperLowerCase = serializers.deserialize(value, specifiedType: const FullType(bool))! as bool; + break; + case 'api': + result.api.replace(serializers.deserialize(value, + specifiedType: const FullType(PasswordPolicyCapabilities_PasswordPolicy_Api))! + as PasswordPolicyCapabilities_PasswordPolicy_Api); + break; + } + } + + return result.build(); + } +} + +class _$PasswordPolicyCapabilitiesSerializer implements StructuredSerializer { + @override + final Iterable types = const [PasswordPolicyCapabilities, _$PasswordPolicyCapabilities]; + @override + final String wireName = 'PasswordPolicyCapabilities'; + + @override + Iterable serialize(Serializers serializers, PasswordPolicyCapabilities object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'password_policy', + serializers.serialize(object.passwordPolicy, + specifiedType: const FullType(PasswordPolicyCapabilities_PasswordPolicy)), + ]; + + return result; + } + + @override + PasswordPolicyCapabilities deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = PasswordPolicyCapabilitiesBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'password_policy': + result.passwordPolicy.replace( + serializers.deserialize(value, specifiedType: const FullType(PasswordPolicyCapabilities_PasswordPolicy))! + as PasswordPolicyCapabilities_PasswordPolicy); + break; + } + } + + return result.build(); + } +} + class _$ProvisioningApiCapabilities_ProvisioningApiSerializer implements StructuredSerializer { @override @@ -28099,6 +28265,437 @@ class NotificationsCapabilitiesBuilder } } +abstract mixin class $PasswordPolicyCapabilities_PasswordPolicy_ApiInterfaceBuilder { + void replace($PasswordPolicyCapabilities_PasswordPolicy_ApiInterface other); + void update(void Function($PasswordPolicyCapabilities_PasswordPolicy_ApiInterfaceBuilder) updates); + String? get generate; + set generate(String? generate); + + String? get validate; + set validate(String? validate); +} + +class _$PasswordPolicyCapabilities_PasswordPolicy_Api extends PasswordPolicyCapabilities_PasswordPolicy_Api { + @override + final String generate; + @override + final String validate; + + factory _$PasswordPolicyCapabilities_PasswordPolicy_Api( + [void Function(PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder)? updates]) => + (PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder()..update(updates))._build(); + + _$PasswordPolicyCapabilities_PasswordPolicy_Api._({required this.generate, required this.validate}) : super._() { + BuiltValueNullFieldError.checkNotNull(generate, r'PasswordPolicyCapabilities_PasswordPolicy_Api', 'generate'); + BuiltValueNullFieldError.checkNotNull(validate, r'PasswordPolicyCapabilities_PasswordPolicy_Api', 'validate'); + } + + @override + PasswordPolicyCapabilities_PasswordPolicy_Api rebuild( + void Function(PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder toBuilder() => + PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is PasswordPolicyCapabilities_PasswordPolicy_Api && + generate == other.generate && + validate == other.validate; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, generate.hashCode); + _$hash = $jc(_$hash, validate.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'PasswordPolicyCapabilities_PasswordPolicy_Api') + ..add('generate', generate) + ..add('validate', validate)) + .toString(); + } +} + +class PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder + implements + Builder, + $PasswordPolicyCapabilities_PasswordPolicy_ApiInterfaceBuilder { + _$PasswordPolicyCapabilities_PasswordPolicy_Api? _$v; + + String? _generate; + String? get generate => _$this._generate; + set generate(covariant String? generate) => _$this._generate = generate; + + String? _validate; + String? get validate => _$this._validate; + set validate(covariant String? validate) => _$this._validate = validate; + + PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder() { + PasswordPolicyCapabilities_PasswordPolicy_Api._defaults(this); + } + + PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder get _$this { + final $v = _$v; + if ($v != null) { + _generate = $v.generate; + _validate = $v.validate; + _$v = null; + } + return this; + } + + @override + void replace(covariant PasswordPolicyCapabilities_PasswordPolicy_Api other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$PasswordPolicyCapabilities_PasswordPolicy_Api; + } + + @override + void update(void Function(PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + PasswordPolicyCapabilities_PasswordPolicy_Api build() => _build(); + + _$PasswordPolicyCapabilities_PasswordPolicy_Api _build() { + PasswordPolicyCapabilities_PasswordPolicy_Api._validate(this); + final _$result = _$v ?? + _$PasswordPolicyCapabilities_PasswordPolicy_Api._( + generate: BuiltValueNullFieldError.checkNotNull( + generate, r'PasswordPolicyCapabilities_PasswordPolicy_Api', 'generate'), + validate: BuiltValueNullFieldError.checkNotNull( + validate, r'PasswordPolicyCapabilities_PasswordPolicy_Api', 'validate'), + ); + replace(_$result); + return _$result; + } +} + +abstract mixin class $PasswordPolicyCapabilities_PasswordPolicyInterfaceBuilder { + void replace($PasswordPolicyCapabilities_PasswordPolicyInterface other); + void update(void Function($PasswordPolicyCapabilities_PasswordPolicyInterfaceBuilder) updates); + int? get minLength; + set minLength(int? minLength); + + bool? get enforceNonCommonPassword; + set enforceNonCommonPassword(bool? enforceNonCommonPassword); + + bool? get enforceNumericCharacters; + set enforceNumericCharacters(bool? enforceNumericCharacters); + + bool? get enforceSpecialCharacters; + set enforceSpecialCharacters(bool? enforceSpecialCharacters); + + bool? get enforceUpperLowerCase; + set enforceUpperLowerCase(bool? enforceUpperLowerCase); + + PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder get api; + set api(PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder? api); +} + +class _$PasswordPolicyCapabilities_PasswordPolicy extends PasswordPolicyCapabilities_PasswordPolicy { + @override + final int minLength; + @override + final bool enforceNonCommonPassword; + @override + final bool enforceNumericCharacters; + @override + final bool enforceSpecialCharacters; + @override + final bool enforceUpperLowerCase; + @override + final PasswordPolicyCapabilities_PasswordPolicy_Api api; + + factory _$PasswordPolicyCapabilities_PasswordPolicy( + [void Function(PasswordPolicyCapabilities_PasswordPolicyBuilder)? updates]) => + (PasswordPolicyCapabilities_PasswordPolicyBuilder()..update(updates))._build(); + + _$PasswordPolicyCapabilities_PasswordPolicy._( + {required this.minLength, + required this.enforceNonCommonPassword, + required this.enforceNumericCharacters, + required this.enforceSpecialCharacters, + required this.enforceUpperLowerCase, + required this.api}) + : super._() { + BuiltValueNullFieldError.checkNotNull(minLength, r'PasswordPolicyCapabilities_PasswordPolicy', 'minLength'); + BuiltValueNullFieldError.checkNotNull( + enforceNonCommonPassword, r'PasswordPolicyCapabilities_PasswordPolicy', 'enforceNonCommonPassword'); + BuiltValueNullFieldError.checkNotNull( + enforceNumericCharacters, r'PasswordPolicyCapabilities_PasswordPolicy', 'enforceNumericCharacters'); + BuiltValueNullFieldError.checkNotNull( + enforceSpecialCharacters, r'PasswordPolicyCapabilities_PasswordPolicy', 'enforceSpecialCharacters'); + BuiltValueNullFieldError.checkNotNull( + enforceUpperLowerCase, r'PasswordPolicyCapabilities_PasswordPolicy', 'enforceUpperLowerCase'); + BuiltValueNullFieldError.checkNotNull(api, r'PasswordPolicyCapabilities_PasswordPolicy', 'api'); + } + + @override + PasswordPolicyCapabilities_PasswordPolicy rebuild( + void Function(PasswordPolicyCapabilities_PasswordPolicyBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + PasswordPolicyCapabilities_PasswordPolicyBuilder toBuilder() => + PasswordPolicyCapabilities_PasswordPolicyBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is PasswordPolicyCapabilities_PasswordPolicy && + minLength == other.minLength && + enforceNonCommonPassword == other.enforceNonCommonPassword && + enforceNumericCharacters == other.enforceNumericCharacters && + enforceSpecialCharacters == other.enforceSpecialCharacters && + enforceUpperLowerCase == other.enforceUpperLowerCase && + api == other.api; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, minLength.hashCode); + _$hash = $jc(_$hash, enforceNonCommonPassword.hashCode); + _$hash = $jc(_$hash, enforceNumericCharacters.hashCode); + _$hash = $jc(_$hash, enforceSpecialCharacters.hashCode); + _$hash = $jc(_$hash, enforceUpperLowerCase.hashCode); + _$hash = $jc(_$hash, api.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'PasswordPolicyCapabilities_PasswordPolicy') + ..add('minLength', minLength) + ..add('enforceNonCommonPassword', enforceNonCommonPassword) + ..add('enforceNumericCharacters', enforceNumericCharacters) + ..add('enforceSpecialCharacters', enforceSpecialCharacters) + ..add('enforceUpperLowerCase', enforceUpperLowerCase) + ..add('api', api)) + .toString(); + } +} + +class PasswordPolicyCapabilities_PasswordPolicyBuilder + implements + Builder, + $PasswordPolicyCapabilities_PasswordPolicyInterfaceBuilder { + _$PasswordPolicyCapabilities_PasswordPolicy? _$v; + + int? _minLength; + int? get minLength => _$this._minLength; + set minLength(covariant int? minLength) => _$this._minLength = minLength; + + bool? _enforceNonCommonPassword; + bool? get enforceNonCommonPassword => _$this._enforceNonCommonPassword; + set enforceNonCommonPassword(covariant bool? enforceNonCommonPassword) => + _$this._enforceNonCommonPassword = enforceNonCommonPassword; + + bool? _enforceNumericCharacters; + bool? get enforceNumericCharacters => _$this._enforceNumericCharacters; + set enforceNumericCharacters(covariant bool? enforceNumericCharacters) => + _$this._enforceNumericCharacters = enforceNumericCharacters; + + bool? _enforceSpecialCharacters; + bool? get enforceSpecialCharacters => _$this._enforceSpecialCharacters; + set enforceSpecialCharacters(covariant bool? enforceSpecialCharacters) => + _$this._enforceSpecialCharacters = enforceSpecialCharacters; + + bool? _enforceUpperLowerCase; + bool? get enforceUpperLowerCase => _$this._enforceUpperLowerCase; + set enforceUpperLowerCase(covariant bool? enforceUpperLowerCase) => + _$this._enforceUpperLowerCase = enforceUpperLowerCase; + + PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder? _api; + PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder get api => + _$this._api ??= PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder(); + set api(covariant PasswordPolicyCapabilities_PasswordPolicy_ApiBuilder? api) => _$this._api = api; + + PasswordPolicyCapabilities_PasswordPolicyBuilder() { + PasswordPolicyCapabilities_PasswordPolicy._defaults(this); + } + + PasswordPolicyCapabilities_PasswordPolicyBuilder get _$this { + final $v = _$v; + if ($v != null) { + _minLength = $v.minLength; + _enforceNonCommonPassword = $v.enforceNonCommonPassword; + _enforceNumericCharacters = $v.enforceNumericCharacters; + _enforceSpecialCharacters = $v.enforceSpecialCharacters; + _enforceUpperLowerCase = $v.enforceUpperLowerCase; + _api = $v.api.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(covariant PasswordPolicyCapabilities_PasswordPolicy other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$PasswordPolicyCapabilities_PasswordPolicy; + } + + @override + void update(void Function(PasswordPolicyCapabilities_PasswordPolicyBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + PasswordPolicyCapabilities_PasswordPolicy build() => _build(); + + _$PasswordPolicyCapabilities_PasswordPolicy _build() { + PasswordPolicyCapabilities_PasswordPolicy._validate(this); + _$PasswordPolicyCapabilities_PasswordPolicy _$result; + try { + _$result = _$v ?? + _$PasswordPolicyCapabilities_PasswordPolicy._( + minLength: BuiltValueNullFieldError.checkNotNull( + minLength, r'PasswordPolicyCapabilities_PasswordPolicy', 'minLength'), + enforceNonCommonPassword: BuiltValueNullFieldError.checkNotNull( + enforceNonCommonPassword, r'PasswordPolicyCapabilities_PasswordPolicy', 'enforceNonCommonPassword'), + enforceNumericCharacters: BuiltValueNullFieldError.checkNotNull( + enforceNumericCharacters, r'PasswordPolicyCapabilities_PasswordPolicy', 'enforceNumericCharacters'), + enforceSpecialCharacters: BuiltValueNullFieldError.checkNotNull( + enforceSpecialCharacters, r'PasswordPolicyCapabilities_PasswordPolicy', 'enforceSpecialCharacters'), + enforceUpperLowerCase: BuiltValueNullFieldError.checkNotNull( + enforceUpperLowerCase, r'PasswordPolicyCapabilities_PasswordPolicy', 'enforceUpperLowerCase'), + api: api.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'api'; + api.build(); + } catch (e) { + throw BuiltValueNestedFieldError(r'PasswordPolicyCapabilities_PasswordPolicy', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +abstract mixin class $PasswordPolicyCapabilitiesInterfaceBuilder { + void replace($PasswordPolicyCapabilitiesInterface other); + void update(void Function($PasswordPolicyCapabilitiesInterfaceBuilder) updates); + PasswordPolicyCapabilities_PasswordPolicyBuilder get passwordPolicy; + set passwordPolicy(PasswordPolicyCapabilities_PasswordPolicyBuilder? passwordPolicy); +} + +class _$PasswordPolicyCapabilities extends PasswordPolicyCapabilities { + @override + final PasswordPolicyCapabilities_PasswordPolicy passwordPolicy; + + factory _$PasswordPolicyCapabilities([void Function(PasswordPolicyCapabilitiesBuilder)? updates]) => + (PasswordPolicyCapabilitiesBuilder()..update(updates))._build(); + + _$PasswordPolicyCapabilities._({required this.passwordPolicy}) : super._() { + BuiltValueNullFieldError.checkNotNull(passwordPolicy, r'PasswordPolicyCapabilities', 'passwordPolicy'); + } + + @override + PasswordPolicyCapabilities rebuild(void Function(PasswordPolicyCapabilitiesBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + PasswordPolicyCapabilitiesBuilder toBuilder() => PasswordPolicyCapabilitiesBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is PasswordPolicyCapabilities && passwordPolicy == other.passwordPolicy; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, passwordPolicy.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'PasswordPolicyCapabilities')..add('passwordPolicy', passwordPolicy)) + .toString(); + } +} + +class PasswordPolicyCapabilitiesBuilder + implements + Builder, + $PasswordPolicyCapabilitiesInterfaceBuilder { + _$PasswordPolicyCapabilities? _$v; + + PasswordPolicyCapabilities_PasswordPolicyBuilder? _passwordPolicy; + PasswordPolicyCapabilities_PasswordPolicyBuilder get passwordPolicy => + _$this._passwordPolicy ??= PasswordPolicyCapabilities_PasswordPolicyBuilder(); + set passwordPolicy(covariant PasswordPolicyCapabilities_PasswordPolicyBuilder? passwordPolicy) => + _$this._passwordPolicy = passwordPolicy; + + PasswordPolicyCapabilitiesBuilder() { + PasswordPolicyCapabilities._defaults(this); + } + + PasswordPolicyCapabilitiesBuilder get _$this { + final $v = _$v; + if ($v != null) { + _passwordPolicy = $v.passwordPolicy.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(covariant PasswordPolicyCapabilities other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$PasswordPolicyCapabilities; + } + + @override + void update(void Function(PasswordPolicyCapabilitiesBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + PasswordPolicyCapabilities build() => _build(); + + _$PasswordPolicyCapabilities _build() { + PasswordPolicyCapabilities._validate(this); + _$PasswordPolicyCapabilities _$result; + try { + _$result = _$v ?? + _$PasswordPolicyCapabilities._( + passwordPolicy: passwordPolicy.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'passwordPolicy'; + passwordPolicy.build(); + } catch (e) { + throw BuiltValueNestedFieldError(r'PasswordPolicyCapabilities', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + abstract mixin class $ProvisioningApiCapabilities_ProvisioningApiInterfaceBuilder { void replace($ProvisioningApiCapabilities_ProvisioningApiInterface other); void update(void Function($ProvisioningApiCapabilities_ProvisioningApiInterfaceBuilder) updates); diff --git a/packages/nextcloud/lib/src/api/core/core.openapi.json b/packages/nextcloud/lib/src/api/core/core.openapi.json index 2586a8d2960..92daa6b4175 100644 --- a/packages/nextcloud/lib/src/api/core/core.openapi.json +++ b/packages/nextcloud/lib/src/api/core/core.openapi.json @@ -1574,6 +1574,59 @@ } } }, + "PasswordPolicyCapabilities": { + "type": "object", + "required": [ + "password_policy" + ], + "properties": { + "password_policy": { + "type": "object", + "required": [ + "minLength", + "enforceNonCommonPassword", + "enforceNumericCharacters", + "enforceSpecialCharacters", + "enforceUpperLowerCase", + "api" + ], + "properties": { + "minLength": { + "type": "integer", + "format": "int64", + "minimum": 0 + }, + "enforceNonCommonPassword": { + "type": "boolean" + }, + "enforceNumericCharacters": { + "type": "boolean" + }, + "enforceSpecialCharacters": { + "type": "boolean" + }, + "enforceUpperLowerCase": { + "type": "boolean" + }, + "api": { + "type": "object", + "required": [ + "generate", + "validate" + ], + "properties": { + "generate": { + "type": "string" + }, + "validate": { + "type": "string" + } + } + } + } + } + } + }, "ProvisioningApiCapabilities": { "type": "object", "required": [ @@ -4173,6 +4226,9 @@ { "$ref": "#/components/schemas/NotificationsCapabilities" }, + { + "$ref": "#/components/schemas/PasswordPolicyCapabilities" + }, { "$ref": "#/components/schemas/ProvisioningApiCapabilities" }, diff --git a/packages/nextcloud/lib/src/api/password_policy/password_policy.openapi.dart b/packages/nextcloud/lib/src/api/password_policy/password_policy.openapi.dart new file mode 100644 index 00000000000..5b640b9e19c --- /dev/null +++ b/packages/nextcloud/lib/src/api/password_policy/password_policy.openapi.dart @@ -0,0 +1,976 @@ +// Use of this source code is governed by a agpl license. It can be obtained at `https://spdx.org/licenses/AGPL-3.0-only.html`. + +// OpenAPI client generated by Dynamite. Do not manually edit this file. + +// ignore_for_file: camel_case_extensions, camel_case_types, cascade_invocations +// ignore_for_file: discarded_futures +// ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: non_constant_identifier_names, public_member_api_docs +// ignore_for_file: unreachable_switch_case + +/// password_policy Version: 0.0.1. +/// +/// Allows admins to configure a password policy. +/// +/// Use of this source code is governed by a agpl license. +/// It can be obtained at `https://spdx.org/licenses/AGPL-3.0-only.html`. +library; // ignore_for_file: no_leading_underscores_for_library_prefixes + +import 'dart:convert'; + +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:built_value/standard_json_plugin.dart' as _i7; +import 'package:collection/collection.dart' as _i4; +import 'package:dynamite_runtime/built_value.dart' as _i6; +import 'package:dynamite_runtime/http_client.dart' as _i1; +import 'package:dynamite_runtime/utils.dart' as _i5; +import 'package:http/http.dart' as _i3; +import 'package:meta/meta.dart' as _i2; + +part 'password_policy.openapi.g.dart'; + +class $Client extends _i1.DynamiteClient { + /// Creates a new `DynamiteClient` for untagged requests. + $Client( + super.baseURL, { + super.httpClient, + super.authentications, + }); + + /// Creates a new [$Client] from another [client]. + $Client.fromClient(_i1.DynamiteClient client) + : super( + client.baseURL, + httpClient: client.httpClient, + authentications: client.authentications, + ); + + late final $ApiClient api = $ApiClient(this); +} + +class $ApiClient { + /// Creates a new `DynamiteClient` for api requests. + $ApiClient(this._rootClient); + + final $Client _rootClient; + + /// Builds a serializer to parse the response of [$generate_Request]. + @_i2.experimental + _i1.DynamiteSerializer $generate_Serializer() => _i1.DynamiteSerializer( + bodyType: const FullType(ApiGenerateResponseApplicationJson), + headersType: null, + serializers: _$jsonSerializers, + validStatuses: const {200}, + ); + + /// Generate a random password that validates against the enabled password policy rules. + /// + /// Returns a `DynamiteRequest` backing the [generate] operation. + /// Throws a `DynamiteApiException` if the API call does not return an expected status code. + /// + /// Parameters: + /// * [oCSAPIRequest] Required to be true for the API request to pass. Defaults to `true`. + /// + /// Status codes: + /// * 200: Password generated + /// * 409: Generated password accidentally failed to validate against the rules, retry. + /// + /// See: + /// * [generate] for a method executing this request and parsing the response. + /// * [$generate_Serializer] for a converter to parse the `Response` from an executed this request. + @_i2.experimental + _i3.Request $generate_Request({bool? oCSAPIRequest}) { + const _path = '/ocs/v2.php/apps/password_policy/api/v1/generate'; + final _uri = Uri.parse('${_rootClient.baseURL}$_path'); + final _request = _i3.Request('get', _uri); + _request.headers['Accept'] = 'application/json'; +// coverage:ignore-start + final authentication = _i4.IterableExtension(_rootClient.authentications)?.firstWhereOrNull( + (auth) => switch (auth) { + _i1.DynamiteHttpBearerAuthentication() || _i1.DynamiteHttpBasicAuthentication() => true, + _ => false, + }, + ); + + if (authentication != null) { + _request.headers.addAll( + authentication.headers, + ); + } else { + throw Exception('Missing authentication for bearer_auth or basic_auth'); + } + +// coverage:ignore-end + var __oCSAPIRequest = _$jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + __oCSAPIRequest ??= true; + _request.headers['OCS-APIRequest'] = const _i5.HeaderEncoder().convert(__oCSAPIRequest); + + return _request; + } + + /// Generate a random password that validates against the enabled password policy rules. + /// + /// Returns a [Future] containing a `DynamiteResponse` with the status code, deserialized body and headers. + /// Throws a `DynamiteApiException` if the API call does not return an expected status code. + /// + /// Parameters: + /// * [oCSAPIRequest] Required to be true for the API request to pass. Defaults to `true`. + /// + /// Status codes: + /// * 200: Password generated + /// * 409: Generated password accidentally failed to validate against the rules, retry. + /// + /// See: + /// * [$generate_Request] for the request send by this method. + /// * [$generate_Serializer] for a converter to parse the `Response` from an executed request. + Future<_i1.DynamiteResponse> generate({bool? oCSAPIRequest}) async { + final _request = $generate_Request( + oCSAPIRequest: oCSAPIRequest, + ); + final _streamedResponse = await _rootClient.httpClient.send(_request); + final _response = await _i3.Response.fromStream(_streamedResponse); + + final _serializer = $generate_Serializer(); + return _i1.ResponseConverter(_serializer).convert(_response); + } + + /// Builds a serializer to parse the response of [$validate_Request]. + @_i2.experimental + _i1.DynamiteSerializer $validate_Serializer() => _i1.DynamiteSerializer( + bodyType: const FullType(ApiValidateResponseApplicationJson), + headersType: null, + serializers: _$jsonSerializers, + validStatuses: const {200}, + ); + + /// Validate a password against the enabled password policy rules. + /// + /// Returns a `DynamiteRequest` backing the [validate] operation. + /// Throws a `DynamiteApiException` if the API call does not return an expected status code. + /// + /// Parameters: + /// * [oCSAPIRequest] Required to be true for the API request to pass. Defaults to `true`. + /// + /// Status codes: + /// * 200: Always + /// + /// See: + /// * [validate] for a method executing this request and parsing the response. + /// * [$validate_Serializer] for a converter to parse the `Response` from an executed this request. + @_i2.experimental + _i3.Request $validate_Request({ + required ApiValidateRequestApplicationJson $body, + bool? oCSAPIRequest, + }) { + const _path = '/ocs/v2.php/apps/password_policy/api/v1/validate'; + final _uri = Uri.parse('${_rootClient.baseURL}$_path'); + final _request = _i3.Request('post', _uri); + _request.headers['Accept'] = 'application/json'; +// coverage:ignore-start + final authentication = _i4.IterableExtension(_rootClient.authentications)?.firstWhereOrNull( + (auth) => switch (auth) { + _i1.DynamiteHttpBearerAuthentication() || _i1.DynamiteHttpBasicAuthentication() => true, + _ => false, + }, + ); + + if (authentication != null) { + _request.headers.addAll( + authentication.headers, + ); + } else { + throw Exception('Missing authentication for bearer_auth or basic_auth'); + } + +// coverage:ignore-end + var __oCSAPIRequest = _$jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + __oCSAPIRequest ??= true; + _request.headers['OCS-APIRequest'] = const _i5.HeaderEncoder().convert(__oCSAPIRequest); + + _request.headers['Content-Type'] = 'application/json'; + _request.body = json + .encode(_$jsonSerializers.serialize($body, specifiedType: const FullType(ApiValidateRequestApplicationJson))); + return _request; + } + + /// Validate a password against the enabled password policy rules. + /// + /// Returns a [Future] containing a `DynamiteResponse` with the status code, deserialized body and headers. + /// Throws a `DynamiteApiException` if the API call does not return an expected status code. + /// + /// Parameters: + /// * [oCSAPIRequest] Required to be true for the API request to pass. Defaults to `true`. + /// + /// Status codes: + /// * 200: Always + /// + /// See: + /// * [$validate_Request] for the request send by this method. + /// * [$validate_Serializer] for a converter to parse the `Response` from an executed request. + Future<_i1.DynamiteResponse> validate({ + required ApiValidateRequestApplicationJson $body, + bool? oCSAPIRequest, + }) async { + final _request = $validate_Request( + oCSAPIRequest: oCSAPIRequest, + $body: $body, + ); + final _streamedResponse = await _rootClient.httpClient.send(_request); + final _response = await _i3.Response.fromStream(_streamedResponse); + + final _serializer = $validate_Serializer(); + return _i1.ResponseConverter(_serializer).convert(_response); + } +} + +@BuiltValue(instantiable: false) +sealed class $OCSMetaInterface { + String get status; + int get statuscode; + String? get message; + String? get totalitems; + String? get itemsperpage; + + /// Rebuilds the instance. + /// + /// The result is the same as this instance but with [updates] applied. + /// [updates] is a function that takes a builder [$OCSMetaInterfaceBuilder]. + $OCSMetaInterface rebuild(void Function($OCSMetaInterfaceBuilder) updates); + + /// Converts the instance to a builder [$OCSMetaInterfaceBuilder]. + $OCSMetaInterfaceBuilder toBuilder(); + @BuiltValueHook(initializeBuilder: true) + static void _defaults($OCSMetaInterfaceBuilder b) {} + @BuiltValueHook(finalizeBuilder: true) + static void _validate($OCSMetaInterfaceBuilder b) {} +} + +abstract class OCSMeta implements $OCSMetaInterface, Built { + /// Creates a new OCSMeta object using the builder pattern. + factory OCSMeta([void Function(OCSMetaBuilder)? b]) = _$OCSMeta; + + // coverage:ignore-start + const OCSMeta._(); + // coverage:ignore-end + + /// Creates a new object from the given [json] data. + /// + /// Use [toJson] to serialize it back into json. + // coverage:ignore-start + factory OCSMeta.fromJson(Map json) => _$jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + /// Parses this object into a json like map. + /// + /// Use the fromJson factory to revive it again. + // coverage:ignore-start + Map toJson() => _$jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + + /// Serializer for OCSMeta. + static Serializer get serializer => _$oCSMetaSerializer; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(OCSMetaBuilder b) { + $OCSMetaInterface._defaults(b); + } + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(OCSMetaBuilder b) { + $OCSMetaInterface._validate(b); + } +} + +@BuiltValue(instantiable: false) +sealed class $ApiGenerateResponseApplicationJson_Ocs_DataInterface { + String get password; + + /// Rebuilds the instance. + /// + /// The result is the same as this instance but with [updates] applied. + /// [updates] is a function that takes a builder [$ApiGenerateResponseApplicationJson_Ocs_DataInterfaceBuilder]. + $ApiGenerateResponseApplicationJson_Ocs_DataInterface rebuild( + void Function($ApiGenerateResponseApplicationJson_Ocs_DataInterfaceBuilder) updates, + ); + + /// Converts the instance to a builder [$ApiGenerateResponseApplicationJson_Ocs_DataInterfaceBuilder]. + $ApiGenerateResponseApplicationJson_Ocs_DataInterfaceBuilder toBuilder(); + @BuiltValueHook(initializeBuilder: true) + static void _defaults($ApiGenerateResponseApplicationJson_Ocs_DataInterfaceBuilder b) {} + @BuiltValueHook(finalizeBuilder: true) + static void _validate($ApiGenerateResponseApplicationJson_Ocs_DataInterfaceBuilder b) {} +} + +abstract class ApiGenerateResponseApplicationJson_Ocs_Data + implements + $ApiGenerateResponseApplicationJson_Ocs_DataInterface, + Built { + /// Creates a new ApiGenerateResponseApplicationJson_Ocs_Data object using the builder pattern. + factory ApiGenerateResponseApplicationJson_Ocs_Data([ + void Function(ApiGenerateResponseApplicationJson_Ocs_DataBuilder)? b, + ]) = _$ApiGenerateResponseApplicationJson_Ocs_Data; + + // coverage:ignore-start + const ApiGenerateResponseApplicationJson_Ocs_Data._(); + // coverage:ignore-end + + /// Creates a new object from the given [json] data. + /// + /// Use [toJson] to serialize it back into json. + // coverage:ignore-start + factory ApiGenerateResponseApplicationJson_Ocs_Data.fromJson(Map json) => + _$jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + /// Parses this object into a json like map. + /// + /// Use the fromJson factory to revive it again. + // coverage:ignore-start + Map toJson() => _$jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + + /// Serializer for ApiGenerateResponseApplicationJson_Ocs_Data. + static Serializer get serializer => + _$apiGenerateResponseApplicationJsonOcsDataSerializer; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ApiGenerateResponseApplicationJson_Ocs_DataBuilder b) { + $ApiGenerateResponseApplicationJson_Ocs_DataInterface._defaults(b); + } + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(ApiGenerateResponseApplicationJson_Ocs_DataBuilder b) { + $ApiGenerateResponseApplicationJson_Ocs_DataInterface._validate(b); + } +} + +@BuiltValue(instantiable: false) +sealed class $ApiGenerateResponseApplicationJson_OcsInterface { + OCSMeta get meta; + ApiGenerateResponseApplicationJson_Ocs_Data get data; + + /// Rebuilds the instance. + /// + /// The result is the same as this instance but with [updates] applied. + /// [updates] is a function that takes a builder [$ApiGenerateResponseApplicationJson_OcsInterfaceBuilder]. + $ApiGenerateResponseApplicationJson_OcsInterface rebuild( + void Function($ApiGenerateResponseApplicationJson_OcsInterfaceBuilder) updates, + ); + + /// Converts the instance to a builder [$ApiGenerateResponseApplicationJson_OcsInterfaceBuilder]. + $ApiGenerateResponseApplicationJson_OcsInterfaceBuilder toBuilder(); + @BuiltValueHook(initializeBuilder: true) + static void _defaults($ApiGenerateResponseApplicationJson_OcsInterfaceBuilder b) {} + @BuiltValueHook(finalizeBuilder: true) + static void _validate($ApiGenerateResponseApplicationJson_OcsInterfaceBuilder b) {} +} + +abstract class ApiGenerateResponseApplicationJson_Ocs + implements + $ApiGenerateResponseApplicationJson_OcsInterface, + Built { + /// Creates a new ApiGenerateResponseApplicationJson_Ocs object using the builder pattern. + factory ApiGenerateResponseApplicationJson_Ocs([void Function(ApiGenerateResponseApplicationJson_OcsBuilder)? b]) = + _$ApiGenerateResponseApplicationJson_Ocs; + + // coverage:ignore-start + const ApiGenerateResponseApplicationJson_Ocs._(); + // coverage:ignore-end + + /// Creates a new object from the given [json] data. + /// + /// Use [toJson] to serialize it back into json. + // coverage:ignore-start + factory ApiGenerateResponseApplicationJson_Ocs.fromJson(Map json) => + _$jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + /// Parses this object into a json like map. + /// + /// Use the fromJson factory to revive it again. + // coverage:ignore-start + Map toJson() => _$jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + + /// Serializer for ApiGenerateResponseApplicationJson_Ocs. + static Serializer get serializer => + _$apiGenerateResponseApplicationJsonOcsSerializer; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ApiGenerateResponseApplicationJson_OcsBuilder b) { + $ApiGenerateResponseApplicationJson_OcsInterface._defaults(b); + } + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(ApiGenerateResponseApplicationJson_OcsBuilder b) { + $ApiGenerateResponseApplicationJson_OcsInterface._validate(b); + } +} + +@BuiltValue(instantiable: false) +sealed class $ApiGenerateResponseApplicationJsonInterface { + ApiGenerateResponseApplicationJson_Ocs get ocs; + + /// Rebuilds the instance. + /// + /// The result is the same as this instance but with [updates] applied. + /// [updates] is a function that takes a builder [$ApiGenerateResponseApplicationJsonInterfaceBuilder]. + $ApiGenerateResponseApplicationJsonInterface rebuild( + void Function($ApiGenerateResponseApplicationJsonInterfaceBuilder) updates, + ); + + /// Converts the instance to a builder [$ApiGenerateResponseApplicationJsonInterfaceBuilder]. + $ApiGenerateResponseApplicationJsonInterfaceBuilder toBuilder(); + @BuiltValueHook(initializeBuilder: true) + static void _defaults($ApiGenerateResponseApplicationJsonInterfaceBuilder b) {} + @BuiltValueHook(finalizeBuilder: true) + static void _validate($ApiGenerateResponseApplicationJsonInterfaceBuilder b) {} +} + +abstract class ApiGenerateResponseApplicationJson + implements + $ApiGenerateResponseApplicationJsonInterface, + Built { + /// Creates a new ApiGenerateResponseApplicationJson object using the builder pattern. + factory ApiGenerateResponseApplicationJson([void Function(ApiGenerateResponseApplicationJsonBuilder)? b]) = + _$ApiGenerateResponseApplicationJson; + + // coverage:ignore-start + const ApiGenerateResponseApplicationJson._(); + // coverage:ignore-end + + /// Creates a new object from the given [json] data. + /// + /// Use [toJson] to serialize it back into json. + // coverage:ignore-start + factory ApiGenerateResponseApplicationJson.fromJson(Map json) => + _$jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + /// Parses this object into a json like map. + /// + /// Use the fromJson factory to revive it again. + // coverage:ignore-start + Map toJson() => _$jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + + /// Serializer for ApiGenerateResponseApplicationJson. + static Serializer get serializer => + _$apiGenerateResponseApplicationJsonSerializer; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ApiGenerateResponseApplicationJsonBuilder b) { + $ApiGenerateResponseApplicationJsonInterface._defaults(b); + } + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(ApiGenerateResponseApplicationJsonBuilder b) { + $ApiGenerateResponseApplicationJsonInterface._validate(b); + } +} + +@BuiltValue(instantiable: false) +sealed class $ApiValidateRequestApplicationJsonInterface { + /// The password to validate. + String get password; + + /// Rebuilds the instance. + /// + /// The result is the same as this instance but with [updates] applied. + /// [updates] is a function that takes a builder [$ApiValidateRequestApplicationJsonInterfaceBuilder]. + $ApiValidateRequestApplicationJsonInterface rebuild( + void Function($ApiValidateRequestApplicationJsonInterfaceBuilder) updates, + ); + + /// Converts the instance to a builder [$ApiValidateRequestApplicationJsonInterfaceBuilder]. + $ApiValidateRequestApplicationJsonInterfaceBuilder toBuilder(); + @BuiltValueHook(initializeBuilder: true) + static void _defaults($ApiValidateRequestApplicationJsonInterfaceBuilder b) {} + @BuiltValueHook(finalizeBuilder: true) + static void _validate($ApiValidateRequestApplicationJsonInterfaceBuilder b) {} +} + +abstract class ApiValidateRequestApplicationJson + implements + $ApiValidateRequestApplicationJsonInterface, + Built { + /// Creates a new ApiValidateRequestApplicationJson object using the builder pattern. + factory ApiValidateRequestApplicationJson([void Function(ApiValidateRequestApplicationJsonBuilder)? b]) = + _$ApiValidateRequestApplicationJson; + + // coverage:ignore-start + const ApiValidateRequestApplicationJson._(); + // coverage:ignore-end + + /// Creates a new object from the given [json] data. + /// + /// Use [toJson] to serialize it back into json. + // coverage:ignore-start + factory ApiValidateRequestApplicationJson.fromJson(Map json) => + _$jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + /// Parses this object into a json like map. + /// + /// Use the fromJson factory to revive it again. + // coverage:ignore-start + Map toJson() => _$jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + + /// Serializer for ApiValidateRequestApplicationJson. + static Serializer get serializer => _$apiValidateRequestApplicationJsonSerializer; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ApiValidateRequestApplicationJsonBuilder b) { + $ApiValidateRequestApplicationJsonInterface._defaults(b); + } + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(ApiValidateRequestApplicationJsonBuilder b) { + $ApiValidateRequestApplicationJsonInterface._validate(b); + } +} + +@BuiltValue(instantiable: false) +sealed class $ApiValidateResponseApplicationJson_Ocs_DataInterface { + bool get passed; + String? get reason; + + /// Rebuilds the instance. + /// + /// The result is the same as this instance but with [updates] applied. + /// [updates] is a function that takes a builder [$ApiValidateResponseApplicationJson_Ocs_DataInterfaceBuilder]. + $ApiValidateResponseApplicationJson_Ocs_DataInterface rebuild( + void Function($ApiValidateResponseApplicationJson_Ocs_DataInterfaceBuilder) updates, + ); + + /// Converts the instance to a builder [$ApiValidateResponseApplicationJson_Ocs_DataInterfaceBuilder]. + $ApiValidateResponseApplicationJson_Ocs_DataInterfaceBuilder toBuilder(); + @BuiltValueHook(initializeBuilder: true) + static void _defaults($ApiValidateResponseApplicationJson_Ocs_DataInterfaceBuilder b) {} + @BuiltValueHook(finalizeBuilder: true) + static void _validate($ApiValidateResponseApplicationJson_Ocs_DataInterfaceBuilder b) {} +} + +abstract class ApiValidateResponseApplicationJson_Ocs_Data + implements + $ApiValidateResponseApplicationJson_Ocs_DataInterface, + Built { + /// Creates a new ApiValidateResponseApplicationJson_Ocs_Data object using the builder pattern. + factory ApiValidateResponseApplicationJson_Ocs_Data([ + void Function(ApiValidateResponseApplicationJson_Ocs_DataBuilder)? b, + ]) = _$ApiValidateResponseApplicationJson_Ocs_Data; + + // coverage:ignore-start + const ApiValidateResponseApplicationJson_Ocs_Data._(); + // coverage:ignore-end + + /// Creates a new object from the given [json] data. + /// + /// Use [toJson] to serialize it back into json. + // coverage:ignore-start + factory ApiValidateResponseApplicationJson_Ocs_Data.fromJson(Map json) => + _$jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + /// Parses this object into a json like map. + /// + /// Use the fromJson factory to revive it again. + // coverage:ignore-start + Map toJson() => _$jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + + /// Serializer for ApiValidateResponseApplicationJson_Ocs_Data. + static Serializer get serializer => + _$apiValidateResponseApplicationJsonOcsDataSerializer; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ApiValidateResponseApplicationJson_Ocs_DataBuilder b) { + $ApiValidateResponseApplicationJson_Ocs_DataInterface._defaults(b); + } + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(ApiValidateResponseApplicationJson_Ocs_DataBuilder b) { + $ApiValidateResponseApplicationJson_Ocs_DataInterface._validate(b); + } +} + +@BuiltValue(instantiable: false) +sealed class $ApiValidateResponseApplicationJson_OcsInterface { + OCSMeta get meta; + ApiValidateResponseApplicationJson_Ocs_Data get data; + + /// Rebuilds the instance. + /// + /// The result is the same as this instance but with [updates] applied. + /// [updates] is a function that takes a builder [$ApiValidateResponseApplicationJson_OcsInterfaceBuilder]. + $ApiValidateResponseApplicationJson_OcsInterface rebuild( + void Function($ApiValidateResponseApplicationJson_OcsInterfaceBuilder) updates, + ); + + /// Converts the instance to a builder [$ApiValidateResponseApplicationJson_OcsInterfaceBuilder]. + $ApiValidateResponseApplicationJson_OcsInterfaceBuilder toBuilder(); + @BuiltValueHook(initializeBuilder: true) + static void _defaults($ApiValidateResponseApplicationJson_OcsInterfaceBuilder b) {} + @BuiltValueHook(finalizeBuilder: true) + static void _validate($ApiValidateResponseApplicationJson_OcsInterfaceBuilder b) {} +} + +abstract class ApiValidateResponseApplicationJson_Ocs + implements + $ApiValidateResponseApplicationJson_OcsInterface, + Built { + /// Creates a new ApiValidateResponseApplicationJson_Ocs object using the builder pattern. + factory ApiValidateResponseApplicationJson_Ocs([void Function(ApiValidateResponseApplicationJson_OcsBuilder)? b]) = + _$ApiValidateResponseApplicationJson_Ocs; + + // coverage:ignore-start + const ApiValidateResponseApplicationJson_Ocs._(); + // coverage:ignore-end + + /// Creates a new object from the given [json] data. + /// + /// Use [toJson] to serialize it back into json. + // coverage:ignore-start + factory ApiValidateResponseApplicationJson_Ocs.fromJson(Map json) => + _$jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + /// Parses this object into a json like map. + /// + /// Use the fromJson factory to revive it again. + // coverage:ignore-start + Map toJson() => _$jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + + /// Serializer for ApiValidateResponseApplicationJson_Ocs. + static Serializer get serializer => + _$apiValidateResponseApplicationJsonOcsSerializer; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ApiValidateResponseApplicationJson_OcsBuilder b) { + $ApiValidateResponseApplicationJson_OcsInterface._defaults(b); + } + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(ApiValidateResponseApplicationJson_OcsBuilder b) { + $ApiValidateResponseApplicationJson_OcsInterface._validate(b); + } +} + +@BuiltValue(instantiable: false) +sealed class $ApiValidateResponseApplicationJsonInterface { + ApiValidateResponseApplicationJson_Ocs get ocs; + + /// Rebuilds the instance. + /// + /// The result is the same as this instance but with [updates] applied. + /// [updates] is a function that takes a builder [$ApiValidateResponseApplicationJsonInterfaceBuilder]. + $ApiValidateResponseApplicationJsonInterface rebuild( + void Function($ApiValidateResponseApplicationJsonInterfaceBuilder) updates, + ); + + /// Converts the instance to a builder [$ApiValidateResponseApplicationJsonInterfaceBuilder]. + $ApiValidateResponseApplicationJsonInterfaceBuilder toBuilder(); + @BuiltValueHook(initializeBuilder: true) + static void _defaults($ApiValidateResponseApplicationJsonInterfaceBuilder b) {} + @BuiltValueHook(finalizeBuilder: true) + static void _validate($ApiValidateResponseApplicationJsonInterfaceBuilder b) {} +} + +abstract class ApiValidateResponseApplicationJson + implements + $ApiValidateResponseApplicationJsonInterface, + Built { + /// Creates a new ApiValidateResponseApplicationJson object using the builder pattern. + factory ApiValidateResponseApplicationJson([void Function(ApiValidateResponseApplicationJsonBuilder)? b]) = + _$ApiValidateResponseApplicationJson; + + // coverage:ignore-start + const ApiValidateResponseApplicationJson._(); + // coverage:ignore-end + + /// Creates a new object from the given [json] data. + /// + /// Use [toJson] to serialize it back into json. + // coverage:ignore-start + factory ApiValidateResponseApplicationJson.fromJson(Map json) => + _$jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + /// Parses this object into a json like map. + /// + /// Use the fromJson factory to revive it again. + // coverage:ignore-start + Map toJson() => _$jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + + /// Serializer for ApiValidateResponseApplicationJson. + static Serializer get serializer => + _$apiValidateResponseApplicationJsonSerializer; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ApiValidateResponseApplicationJsonBuilder b) { + $ApiValidateResponseApplicationJsonInterface._defaults(b); + } + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(ApiValidateResponseApplicationJsonBuilder b) { + $ApiValidateResponseApplicationJsonInterface._validate(b); + } +} + +@BuiltValue(instantiable: false) +sealed class $Capabilities_PasswordPolicy_ApiInterface { + String get generate; + String get validate; + + /// Rebuilds the instance. + /// + /// The result is the same as this instance but with [updates] applied. + /// [updates] is a function that takes a builder [$Capabilities_PasswordPolicy_ApiInterfaceBuilder]. + $Capabilities_PasswordPolicy_ApiInterface rebuild( + void Function($Capabilities_PasswordPolicy_ApiInterfaceBuilder) updates, + ); + + /// Converts the instance to a builder [$Capabilities_PasswordPolicy_ApiInterfaceBuilder]. + $Capabilities_PasswordPolicy_ApiInterfaceBuilder toBuilder(); + @BuiltValueHook(initializeBuilder: true) + static void _defaults($Capabilities_PasswordPolicy_ApiInterfaceBuilder b) {} + @BuiltValueHook(finalizeBuilder: true) + static void _validate($Capabilities_PasswordPolicy_ApiInterfaceBuilder b) {} +} + +abstract class Capabilities_PasswordPolicy_Api + implements + $Capabilities_PasswordPolicy_ApiInterface, + Built { + /// Creates a new Capabilities_PasswordPolicy_Api object using the builder pattern. + factory Capabilities_PasswordPolicy_Api([void Function(Capabilities_PasswordPolicy_ApiBuilder)? b]) = + _$Capabilities_PasswordPolicy_Api; + + // coverage:ignore-start + const Capabilities_PasswordPolicy_Api._(); + // coverage:ignore-end + + /// Creates a new object from the given [json] data. + /// + /// Use [toJson] to serialize it back into json. + // coverage:ignore-start + factory Capabilities_PasswordPolicy_Api.fromJson(Map json) => + _$jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + /// Parses this object into a json like map. + /// + /// Use the fromJson factory to revive it again. + // coverage:ignore-start + Map toJson() => _$jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + + /// Serializer for Capabilities_PasswordPolicy_Api. + static Serializer get serializer => _$capabilitiesPasswordPolicyApiSerializer; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(Capabilities_PasswordPolicy_ApiBuilder b) { + $Capabilities_PasswordPolicy_ApiInterface._defaults(b); + } + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(Capabilities_PasswordPolicy_ApiBuilder b) { + $Capabilities_PasswordPolicy_ApiInterface._validate(b); + } +} + +@BuiltValue(instantiable: false) +sealed class $Capabilities_PasswordPolicyInterface { + int get minLength; + bool get enforceNonCommonPassword; + bool get enforceNumericCharacters; + bool get enforceSpecialCharacters; + bool get enforceUpperLowerCase; + Capabilities_PasswordPolicy_Api get api; + + /// Rebuilds the instance. + /// + /// The result is the same as this instance but with [updates] applied. + /// [updates] is a function that takes a builder [$Capabilities_PasswordPolicyInterfaceBuilder]. + $Capabilities_PasswordPolicyInterface rebuild(void Function($Capabilities_PasswordPolicyInterfaceBuilder) updates); + + /// Converts the instance to a builder [$Capabilities_PasswordPolicyInterfaceBuilder]. + $Capabilities_PasswordPolicyInterfaceBuilder toBuilder(); + @BuiltValueHook(initializeBuilder: true) + static void _defaults($Capabilities_PasswordPolicyInterfaceBuilder b) {} + @BuiltValueHook(finalizeBuilder: true) + static void _validate($Capabilities_PasswordPolicyInterfaceBuilder b) { + _i5.checkNumber( + b.minLength, + 'minLength', + minimum: 0, + ); + } +} + +abstract class Capabilities_PasswordPolicy + implements + $Capabilities_PasswordPolicyInterface, + Built { + /// Creates a new Capabilities_PasswordPolicy object using the builder pattern. + factory Capabilities_PasswordPolicy([void Function(Capabilities_PasswordPolicyBuilder)? b]) = + _$Capabilities_PasswordPolicy; + + // coverage:ignore-start + const Capabilities_PasswordPolicy._(); + // coverage:ignore-end + + /// Creates a new object from the given [json] data. + /// + /// Use [toJson] to serialize it back into json. + // coverage:ignore-start + factory Capabilities_PasswordPolicy.fromJson(Map json) => + _$jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + /// Parses this object into a json like map. + /// + /// Use the fromJson factory to revive it again. + // coverage:ignore-start + Map toJson() => _$jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + + /// Serializer for Capabilities_PasswordPolicy. + static Serializer get serializer => _$capabilitiesPasswordPolicySerializer; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(Capabilities_PasswordPolicyBuilder b) { + $Capabilities_PasswordPolicyInterface._defaults(b); + } + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(Capabilities_PasswordPolicyBuilder b) { + $Capabilities_PasswordPolicyInterface._validate(b); + } +} + +@BuiltValue(instantiable: false) +sealed class $CapabilitiesInterface { + @BuiltValueField(wireName: 'password_policy') + Capabilities_PasswordPolicy get passwordPolicy; + + /// Rebuilds the instance. + /// + /// The result is the same as this instance but with [updates] applied. + /// [updates] is a function that takes a builder [$CapabilitiesInterfaceBuilder]. + $CapabilitiesInterface rebuild(void Function($CapabilitiesInterfaceBuilder) updates); + + /// Converts the instance to a builder [$CapabilitiesInterfaceBuilder]. + $CapabilitiesInterfaceBuilder toBuilder(); + @BuiltValueHook(initializeBuilder: true) + static void _defaults($CapabilitiesInterfaceBuilder b) {} + @BuiltValueHook(finalizeBuilder: true) + static void _validate($CapabilitiesInterfaceBuilder b) {} +} + +abstract class Capabilities implements $CapabilitiesInterface, Built { + /// Creates a new Capabilities object using the builder pattern. + factory Capabilities([void Function(CapabilitiesBuilder)? b]) = _$Capabilities; + + // coverage:ignore-start + const Capabilities._(); + // coverage:ignore-end + + /// Creates a new object from the given [json] data. + /// + /// Use [toJson] to serialize it back into json. + // coverage:ignore-start + factory Capabilities.fromJson(Map json) => _$jsonSerializers.deserializeWith(serializer, json)!; + // coverage:ignore-end + + /// Parses this object into a json like map. + /// + /// Use the fromJson factory to revive it again. + // coverage:ignore-start + Map toJson() => _$jsonSerializers.serializeWith(serializer, this)! as Map; + // coverage:ignore-end + + /// Serializer for Capabilities. + static Serializer get serializer => _$capabilitiesSerializer; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(CapabilitiesBuilder b) { + $CapabilitiesInterface._defaults(b); + } + + @BuiltValueHook(finalizeBuilder: true) + static void _validate(CapabilitiesBuilder b) { + $CapabilitiesInterface._validate(b); + } +} + +// coverage:ignore-start +/// Serializer for all values in this library. +/// +/// Serializes values into the `built_value` wire format. +/// See: [$jsonSerializers] for serializing into json. +@_i2.visibleForTesting +final Serializers $serializers = _$serializers; +final Serializers _$serializers = (Serializers().toBuilder() + ..addBuilderFactory( + const FullType(ApiGenerateResponseApplicationJson), + ApiGenerateResponseApplicationJsonBuilder.new, + ) + ..add(ApiGenerateResponseApplicationJson.serializer) + ..addBuilderFactory( + const FullType(ApiGenerateResponseApplicationJson_Ocs), + ApiGenerateResponseApplicationJson_OcsBuilder.new, + ) + ..add(ApiGenerateResponseApplicationJson_Ocs.serializer) + ..addBuilderFactory(const FullType(OCSMeta), OCSMetaBuilder.new) + ..add(OCSMeta.serializer) + ..addBuilderFactory( + const FullType(ApiGenerateResponseApplicationJson_Ocs_Data), + ApiGenerateResponseApplicationJson_Ocs_DataBuilder.new, + ) + ..add(ApiGenerateResponseApplicationJson_Ocs_Data.serializer) + ..addBuilderFactory( + const FullType(ApiValidateRequestApplicationJson), + ApiValidateRequestApplicationJsonBuilder.new, + ) + ..add(ApiValidateRequestApplicationJson.serializer) + ..addBuilderFactory( + const FullType(ApiValidateResponseApplicationJson), + ApiValidateResponseApplicationJsonBuilder.new, + ) + ..add(ApiValidateResponseApplicationJson.serializer) + ..addBuilderFactory( + const FullType(ApiValidateResponseApplicationJson_Ocs), + ApiValidateResponseApplicationJson_OcsBuilder.new, + ) + ..add(ApiValidateResponseApplicationJson_Ocs.serializer) + ..addBuilderFactory( + const FullType(ApiValidateResponseApplicationJson_Ocs_Data), + ApiValidateResponseApplicationJson_Ocs_DataBuilder.new, + ) + ..add(ApiValidateResponseApplicationJson_Ocs_Data.serializer) + ..addBuilderFactory(const FullType(Capabilities), CapabilitiesBuilder.new) + ..add(Capabilities.serializer) + ..addBuilderFactory(const FullType(Capabilities_PasswordPolicy), Capabilities_PasswordPolicyBuilder.new) + ..add(Capabilities_PasswordPolicy.serializer) + ..addBuilderFactory(const FullType(Capabilities_PasswordPolicy_Api), Capabilities_PasswordPolicy_ApiBuilder.new) + ..add(Capabilities_PasswordPolicy_Api.serializer)) + .build(); + +/// Serializer for all values in this library. +/// +/// Serializes values into the json. Json serialization is more expensive than the built_value wire format. +/// See: [$serializers] for serializing into the `built_value` wire format. +@_i2.visibleForTesting +final Serializers $jsonSerializers = _$jsonSerializers; +final Serializers _$jsonSerializers = (_$serializers.toBuilder() + ..add(_i6.DynamiteDoubleSerializer()) + ..addPlugin(_i7.StandardJsonPlugin()) + ..addPlugin(const _i6.HeaderPlugin()) + ..addPlugin(const _i6.ContentStringPlugin())) + .build(); +// coverage:ignore-end diff --git a/packages/nextcloud/lib/src/api/password_policy/password_policy.openapi.g.dart b/packages/nextcloud/lib/src/api/password_policy/password_policy.openapi.g.dart new file mode 100644 index 00000000000..3fdc0cc7060 --- /dev/null +++ b/packages/nextcloud/lib/src/api/password_policy/password_policy.openapi.g.dart @@ -0,0 +1,1886 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'password_policy.openapi.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +Serializer _$oCSMetaSerializer = _$OCSMetaSerializer(); +Serializer _$apiGenerateResponseApplicationJsonOcsDataSerializer = + _$ApiGenerateResponseApplicationJson_Ocs_DataSerializer(); +Serializer _$apiGenerateResponseApplicationJsonOcsSerializer = + _$ApiGenerateResponseApplicationJson_OcsSerializer(); +Serializer _$apiGenerateResponseApplicationJsonSerializer = + _$ApiGenerateResponseApplicationJsonSerializer(); +Serializer _$apiValidateRequestApplicationJsonSerializer = + _$ApiValidateRequestApplicationJsonSerializer(); +Serializer _$apiValidateResponseApplicationJsonOcsDataSerializer = + _$ApiValidateResponseApplicationJson_Ocs_DataSerializer(); +Serializer _$apiValidateResponseApplicationJsonOcsSerializer = + _$ApiValidateResponseApplicationJson_OcsSerializer(); +Serializer _$apiValidateResponseApplicationJsonSerializer = + _$ApiValidateResponseApplicationJsonSerializer(); +Serializer _$capabilitiesPasswordPolicyApiSerializer = + _$Capabilities_PasswordPolicy_ApiSerializer(); +Serializer _$capabilitiesPasswordPolicySerializer = + _$Capabilities_PasswordPolicySerializer(); +Serializer _$capabilitiesSerializer = _$CapabilitiesSerializer(); + +class _$OCSMetaSerializer implements StructuredSerializer { + @override + final Iterable types = const [OCSMeta, _$OCSMeta]; + @override + final String wireName = 'OCSMeta'; + + @override + Iterable serialize(Serializers serializers, OCSMeta object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'status', + serializers.serialize(object.status, specifiedType: const FullType(String)), + 'statuscode', + serializers.serialize(object.statuscode, specifiedType: const FullType(int)), + ]; + Object? value; + value = object.message; + if (value != null) { + result + ..add('message') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + value = object.totalitems; + if (value != null) { + result + ..add('totalitems') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + value = object.itemsperpage; + if (value != null) { + result + ..add('itemsperpage') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + return result; + } + + @override + OCSMeta deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = OCSMetaBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'status': + result.status = serializers.deserialize(value, specifiedType: const FullType(String))! as String; + break; + case 'statuscode': + result.statuscode = serializers.deserialize(value, specifiedType: const FullType(int))! as int; + break; + case 'message': + result.message = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + case 'totalitems': + result.totalitems = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + case 'itemsperpage': + result.itemsperpage = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + } + } + + return result.build(); + } +} + +class _$ApiGenerateResponseApplicationJson_Ocs_DataSerializer + implements StructuredSerializer { + @override + final Iterable types = const [ + ApiGenerateResponseApplicationJson_Ocs_Data, + _$ApiGenerateResponseApplicationJson_Ocs_Data + ]; + @override + final String wireName = 'ApiGenerateResponseApplicationJson_Ocs_Data'; + + @override + Iterable serialize(Serializers serializers, ApiGenerateResponseApplicationJson_Ocs_Data object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'password', + serializers.serialize(object.password, specifiedType: const FullType(String)), + ]; + + return result; + } + + @override + ApiGenerateResponseApplicationJson_Ocs_Data deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = ApiGenerateResponseApplicationJson_Ocs_DataBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'password': + result.password = serializers.deserialize(value, specifiedType: const FullType(String))! as String; + break; + } + } + + return result.build(); + } +} + +class _$ApiGenerateResponseApplicationJson_OcsSerializer + implements StructuredSerializer { + @override + final Iterable types = const [ApiGenerateResponseApplicationJson_Ocs, _$ApiGenerateResponseApplicationJson_Ocs]; + @override + final String wireName = 'ApiGenerateResponseApplicationJson_Ocs'; + + @override + Iterable serialize(Serializers serializers, ApiGenerateResponseApplicationJson_Ocs object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'meta', + serializers.serialize(object.meta, specifiedType: const FullType(OCSMeta)), + 'data', + serializers.serialize(object.data, specifiedType: const FullType(ApiGenerateResponseApplicationJson_Ocs_Data)), + ]; + + return result; + } + + @override + ApiGenerateResponseApplicationJson_Ocs deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = ApiGenerateResponseApplicationJson_OcsBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'meta': + result.meta.replace(serializers.deserialize(value, specifiedType: const FullType(OCSMeta))! as OCSMeta); + break; + case 'data': + result.data.replace(serializers.deserialize(value, + specifiedType: const FullType(ApiGenerateResponseApplicationJson_Ocs_Data))! + as ApiGenerateResponseApplicationJson_Ocs_Data); + break; + } + } + + return result.build(); + } +} + +class _$ApiGenerateResponseApplicationJsonSerializer + implements StructuredSerializer { + @override + final Iterable types = const [ApiGenerateResponseApplicationJson, _$ApiGenerateResponseApplicationJson]; + @override + final String wireName = 'ApiGenerateResponseApplicationJson'; + + @override + Iterable serialize(Serializers serializers, ApiGenerateResponseApplicationJson object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'ocs', + serializers.serialize(object.ocs, specifiedType: const FullType(ApiGenerateResponseApplicationJson_Ocs)), + ]; + + return result; + } + + @override + ApiGenerateResponseApplicationJson deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = ApiGenerateResponseApplicationJsonBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'ocs': + result.ocs.replace( + serializers.deserialize(value, specifiedType: const FullType(ApiGenerateResponseApplicationJson_Ocs))! + as ApiGenerateResponseApplicationJson_Ocs); + break; + } + } + + return result.build(); + } +} + +class _$ApiValidateRequestApplicationJsonSerializer implements StructuredSerializer { + @override + final Iterable types = const [ApiValidateRequestApplicationJson, _$ApiValidateRequestApplicationJson]; + @override + final String wireName = 'ApiValidateRequestApplicationJson'; + + @override + Iterable serialize(Serializers serializers, ApiValidateRequestApplicationJson object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'password', + serializers.serialize(object.password, specifiedType: const FullType(String)), + ]; + + return result; + } + + @override + ApiValidateRequestApplicationJson deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = ApiValidateRequestApplicationJsonBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'password': + result.password = serializers.deserialize(value, specifiedType: const FullType(String))! as String; + break; + } + } + + return result.build(); + } +} + +class _$ApiValidateResponseApplicationJson_Ocs_DataSerializer + implements StructuredSerializer { + @override + final Iterable types = const [ + ApiValidateResponseApplicationJson_Ocs_Data, + _$ApiValidateResponseApplicationJson_Ocs_Data + ]; + @override + final String wireName = 'ApiValidateResponseApplicationJson_Ocs_Data'; + + @override + Iterable serialize(Serializers serializers, ApiValidateResponseApplicationJson_Ocs_Data object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'passed', + serializers.serialize(object.passed, specifiedType: const FullType(bool)), + ]; + Object? value; + value = object.reason; + if (value != null) { + result + ..add('reason') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + return result; + } + + @override + ApiValidateResponseApplicationJson_Ocs_Data deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = ApiValidateResponseApplicationJson_Ocs_DataBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'passed': + result.passed = serializers.deserialize(value, specifiedType: const FullType(bool))! as bool; + break; + case 'reason': + result.reason = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + } + } + + return result.build(); + } +} + +class _$ApiValidateResponseApplicationJson_OcsSerializer + implements StructuredSerializer { + @override + final Iterable types = const [ApiValidateResponseApplicationJson_Ocs, _$ApiValidateResponseApplicationJson_Ocs]; + @override + final String wireName = 'ApiValidateResponseApplicationJson_Ocs'; + + @override + Iterable serialize(Serializers serializers, ApiValidateResponseApplicationJson_Ocs object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'meta', + serializers.serialize(object.meta, specifiedType: const FullType(OCSMeta)), + 'data', + serializers.serialize(object.data, specifiedType: const FullType(ApiValidateResponseApplicationJson_Ocs_Data)), + ]; + + return result; + } + + @override + ApiValidateResponseApplicationJson_Ocs deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = ApiValidateResponseApplicationJson_OcsBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'meta': + result.meta.replace(serializers.deserialize(value, specifiedType: const FullType(OCSMeta))! as OCSMeta); + break; + case 'data': + result.data.replace(serializers.deserialize(value, + specifiedType: const FullType(ApiValidateResponseApplicationJson_Ocs_Data))! + as ApiValidateResponseApplicationJson_Ocs_Data); + break; + } + } + + return result.build(); + } +} + +class _$ApiValidateResponseApplicationJsonSerializer + implements StructuredSerializer { + @override + final Iterable types = const [ApiValidateResponseApplicationJson, _$ApiValidateResponseApplicationJson]; + @override + final String wireName = 'ApiValidateResponseApplicationJson'; + + @override + Iterable serialize(Serializers serializers, ApiValidateResponseApplicationJson object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'ocs', + serializers.serialize(object.ocs, specifiedType: const FullType(ApiValidateResponseApplicationJson_Ocs)), + ]; + + return result; + } + + @override + ApiValidateResponseApplicationJson deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = ApiValidateResponseApplicationJsonBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'ocs': + result.ocs.replace( + serializers.deserialize(value, specifiedType: const FullType(ApiValidateResponseApplicationJson_Ocs))! + as ApiValidateResponseApplicationJson_Ocs); + break; + } + } + + return result.build(); + } +} + +class _$Capabilities_PasswordPolicy_ApiSerializer implements StructuredSerializer { + @override + final Iterable types = const [Capabilities_PasswordPolicy_Api, _$Capabilities_PasswordPolicy_Api]; + @override + final String wireName = 'Capabilities_PasswordPolicy_Api'; + + @override + Iterable serialize(Serializers serializers, Capabilities_PasswordPolicy_Api object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'generate', + serializers.serialize(object.generate, specifiedType: const FullType(String)), + 'validate', + serializers.serialize(object.validate, specifiedType: const FullType(String)), + ]; + + return result; + } + + @override + Capabilities_PasswordPolicy_Api deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = Capabilities_PasswordPolicy_ApiBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'generate': + result.generate = serializers.deserialize(value, specifiedType: const FullType(String))! as String; + break; + case 'validate': + result.validate = serializers.deserialize(value, specifiedType: const FullType(String))! as String; + break; + } + } + + return result.build(); + } +} + +class _$Capabilities_PasswordPolicySerializer implements StructuredSerializer { + @override + final Iterable types = const [Capabilities_PasswordPolicy, _$Capabilities_PasswordPolicy]; + @override + final String wireName = 'Capabilities_PasswordPolicy'; + + @override + Iterable serialize(Serializers serializers, Capabilities_PasswordPolicy object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'minLength', + serializers.serialize(object.minLength, specifiedType: const FullType(int)), + 'enforceNonCommonPassword', + serializers.serialize(object.enforceNonCommonPassword, specifiedType: const FullType(bool)), + 'enforceNumericCharacters', + serializers.serialize(object.enforceNumericCharacters, specifiedType: const FullType(bool)), + 'enforceSpecialCharacters', + serializers.serialize(object.enforceSpecialCharacters, specifiedType: const FullType(bool)), + 'enforceUpperLowerCase', + serializers.serialize(object.enforceUpperLowerCase, specifiedType: const FullType(bool)), + 'api', + serializers.serialize(object.api, specifiedType: const FullType(Capabilities_PasswordPolicy_Api)), + ]; + + return result; + } + + @override + Capabilities_PasswordPolicy deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = Capabilities_PasswordPolicyBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'minLength': + result.minLength = serializers.deserialize(value, specifiedType: const FullType(int))! as int; + break; + case 'enforceNonCommonPassword': + result.enforceNonCommonPassword = + serializers.deserialize(value, specifiedType: const FullType(bool))! as bool; + break; + case 'enforceNumericCharacters': + result.enforceNumericCharacters = + serializers.deserialize(value, specifiedType: const FullType(bool))! as bool; + break; + case 'enforceSpecialCharacters': + result.enforceSpecialCharacters = + serializers.deserialize(value, specifiedType: const FullType(bool))! as bool; + break; + case 'enforceUpperLowerCase': + result.enforceUpperLowerCase = serializers.deserialize(value, specifiedType: const FullType(bool))! as bool; + break; + case 'api': + result.api.replace(serializers.deserialize(value, + specifiedType: const FullType(Capabilities_PasswordPolicy_Api))! as Capabilities_PasswordPolicy_Api); + break; + } + } + + return result.build(); + } +} + +class _$CapabilitiesSerializer implements StructuredSerializer { + @override + final Iterable types = const [Capabilities, _$Capabilities]; + @override + final String wireName = 'Capabilities'; + + @override + Iterable serialize(Serializers serializers, Capabilities object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'password_policy', + serializers.serialize(object.passwordPolicy, specifiedType: const FullType(Capabilities_PasswordPolicy)), + ]; + + return result; + } + + @override + Capabilities deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = CapabilitiesBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'password_policy': + result.passwordPolicy.replace(serializers.deserialize(value, + specifiedType: const FullType(Capabilities_PasswordPolicy))! as Capabilities_PasswordPolicy); + break; + } + } + + return result.build(); + } +} + +abstract mixin class $OCSMetaInterfaceBuilder { + void replace($OCSMetaInterface other); + void update(void Function($OCSMetaInterfaceBuilder) updates); + String? get status; + set status(String? status); + + int? get statuscode; + set statuscode(int? statuscode); + + String? get message; + set message(String? message); + + String? get totalitems; + set totalitems(String? totalitems); + + String? get itemsperpage; + set itemsperpage(String? itemsperpage); +} + +class _$OCSMeta extends OCSMeta { + @override + final String status; + @override + final int statuscode; + @override + final String? message; + @override + final String? totalitems; + @override + final String? itemsperpage; + + factory _$OCSMeta([void Function(OCSMetaBuilder)? updates]) => (OCSMetaBuilder()..update(updates))._build(); + + _$OCSMeta._({required this.status, required this.statuscode, this.message, this.totalitems, this.itemsperpage}) + : super._() { + BuiltValueNullFieldError.checkNotNull(status, r'OCSMeta', 'status'); + BuiltValueNullFieldError.checkNotNull(statuscode, r'OCSMeta', 'statuscode'); + } + + @override + OCSMeta rebuild(void Function(OCSMetaBuilder) updates) => (toBuilder()..update(updates)).build(); + + @override + OCSMetaBuilder toBuilder() => OCSMetaBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is OCSMeta && + status == other.status && + statuscode == other.statuscode && + message == other.message && + totalitems == other.totalitems && + itemsperpage == other.itemsperpage; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, status.hashCode); + _$hash = $jc(_$hash, statuscode.hashCode); + _$hash = $jc(_$hash, message.hashCode); + _$hash = $jc(_$hash, totalitems.hashCode); + _$hash = $jc(_$hash, itemsperpage.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'OCSMeta') + ..add('status', status) + ..add('statuscode', statuscode) + ..add('message', message) + ..add('totalitems', totalitems) + ..add('itemsperpage', itemsperpage)) + .toString(); + } +} + +class OCSMetaBuilder implements Builder, $OCSMetaInterfaceBuilder { + _$OCSMeta? _$v; + + String? _status; + String? get status => _$this._status; + set status(covariant String? status) => _$this._status = status; + + int? _statuscode; + int? get statuscode => _$this._statuscode; + set statuscode(covariant int? statuscode) => _$this._statuscode = statuscode; + + String? _message; + String? get message => _$this._message; + set message(covariant String? message) => _$this._message = message; + + String? _totalitems; + String? get totalitems => _$this._totalitems; + set totalitems(covariant String? totalitems) => _$this._totalitems = totalitems; + + String? _itemsperpage; + String? get itemsperpage => _$this._itemsperpage; + set itemsperpage(covariant String? itemsperpage) => _$this._itemsperpage = itemsperpage; + + OCSMetaBuilder() { + OCSMeta._defaults(this); + } + + OCSMetaBuilder get _$this { + final $v = _$v; + if ($v != null) { + _status = $v.status; + _statuscode = $v.statuscode; + _message = $v.message; + _totalitems = $v.totalitems; + _itemsperpage = $v.itemsperpage; + _$v = null; + } + return this; + } + + @override + void replace(covariant OCSMeta other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$OCSMeta; + } + + @override + void update(void Function(OCSMetaBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + OCSMeta build() => _build(); + + _$OCSMeta _build() { + OCSMeta._validate(this); + final _$result = _$v ?? + _$OCSMeta._( + status: BuiltValueNullFieldError.checkNotNull(status, r'OCSMeta', 'status'), + statuscode: BuiltValueNullFieldError.checkNotNull(statuscode, r'OCSMeta', 'statuscode'), + message: message, + totalitems: totalitems, + itemsperpage: itemsperpage, + ); + replace(_$result); + return _$result; + } +} + +abstract mixin class $ApiGenerateResponseApplicationJson_Ocs_DataInterfaceBuilder { + void replace($ApiGenerateResponseApplicationJson_Ocs_DataInterface other); + void update(void Function($ApiGenerateResponseApplicationJson_Ocs_DataInterfaceBuilder) updates); + String? get password; + set password(String? password); +} + +class _$ApiGenerateResponseApplicationJson_Ocs_Data extends ApiGenerateResponseApplicationJson_Ocs_Data { + @override + final String password; + + factory _$ApiGenerateResponseApplicationJson_Ocs_Data( + [void Function(ApiGenerateResponseApplicationJson_Ocs_DataBuilder)? updates]) => + (ApiGenerateResponseApplicationJson_Ocs_DataBuilder()..update(updates))._build(); + + _$ApiGenerateResponseApplicationJson_Ocs_Data._({required this.password}) : super._() { + BuiltValueNullFieldError.checkNotNull(password, r'ApiGenerateResponseApplicationJson_Ocs_Data', 'password'); + } + + @override + ApiGenerateResponseApplicationJson_Ocs_Data rebuild( + void Function(ApiGenerateResponseApplicationJson_Ocs_DataBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + ApiGenerateResponseApplicationJson_Ocs_DataBuilder toBuilder() => + ApiGenerateResponseApplicationJson_Ocs_DataBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is ApiGenerateResponseApplicationJson_Ocs_Data && password == other.password; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, password.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'ApiGenerateResponseApplicationJson_Ocs_Data')..add('password', password)) + .toString(); + } +} + +class ApiGenerateResponseApplicationJson_Ocs_DataBuilder + implements + Builder, + $ApiGenerateResponseApplicationJson_Ocs_DataInterfaceBuilder { + _$ApiGenerateResponseApplicationJson_Ocs_Data? _$v; + + String? _password; + String? get password => _$this._password; + set password(covariant String? password) => _$this._password = password; + + ApiGenerateResponseApplicationJson_Ocs_DataBuilder() { + ApiGenerateResponseApplicationJson_Ocs_Data._defaults(this); + } + + ApiGenerateResponseApplicationJson_Ocs_DataBuilder get _$this { + final $v = _$v; + if ($v != null) { + _password = $v.password; + _$v = null; + } + return this; + } + + @override + void replace(covariant ApiGenerateResponseApplicationJson_Ocs_Data other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$ApiGenerateResponseApplicationJson_Ocs_Data; + } + + @override + void update(void Function(ApiGenerateResponseApplicationJson_Ocs_DataBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + ApiGenerateResponseApplicationJson_Ocs_Data build() => _build(); + + _$ApiGenerateResponseApplicationJson_Ocs_Data _build() { + ApiGenerateResponseApplicationJson_Ocs_Data._validate(this); + final _$result = _$v ?? + _$ApiGenerateResponseApplicationJson_Ocs_Data._( + password: BuiltValueNullFieldError.checkNotNull( + password, r'ApiGenerateResponseApplicationJson_Ocs_Data', 'password'), + ); + replace(_$result); + return _$result; + } +} + +abstract mixin class $ApiGenerateResponseApplicationJson_OcsInterfaceBuilder { + void replace($ApiGenerateResponseApplicationJson_OcsInterface other); + void update(void Function($ApiGenerateResponseApplicationJson_OcsInterfaceBuilder) updates); + OCSMetaBuilder get meta; + set meta(OCSMetaBuilder? meta); + + ApiGenerateResponseApplicationJson_Ocs_DataBuilder get data; + set data(ApiGenerateResponseApplicationJson_Ocs_DataBuilder? data); +} + +class _$ApiGenerateResponseApplicationJson_Ocs extends ApiGenerateResponseApplicationJson_Ocs { + @override + final OCSMeta meta; + @override + final ApiGenerateResponseApplicationJson_Ocs_Data data; + + factory _$ApiGenerateResponseApplicationJson_Ocs( + [void Function(ApiGenerateResponseApplicationJson_OcsBuilder)? updates]) => + (ApiGenerateResponseApplicationJson_OcsBuilder()..update(updates))._build(); + + _$ApiGenerateResponseApplicationJson_Ocs._({required this.meta, required this.data}) : super._() { + BuiltValueNullFieldError.checkNotNull(meta, r'ApiGenerateResponseApplicationJson_Ocs', 'meta'); + BuiltValueNullFieldError.checkNotNull(data, r'ApiGenerateResponseApplicationJson_Ocs', 'data'); + } + + @override + ApiGenerateResponseApplicationJson_Ocs rebuild( + void Function(ApiGenerateResponseApplicationJson_OcsBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + ApiGenerateResponseApplicationJson_OcsBuilder toBuilder() => + ApiGenerateResponseApplicationJson_OcsBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is ApiGenerateResponseApplicationJson_Ocs && meta == other.meta && data == other.data; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, meta.hashCode); + _$hash = $jc(_$hash, data.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'ApiGenerateResponseApplicationJson_Ocs') + ..add('meta', meta) + ..add('data', data)) + .toString(); + } +} + +class ApiGenerateResponseApplicationJson_OcsBuilder + implements + Builder, + $ApiGenerateResponseApplicationJson_OcsInterfaceBuilder { + _$ApiGenerateResponseApplicationJson_Ocs? _$v; + + OCSMetaBuilder? _meta; + OCSMetaBuilder get meta => _$this._meta ??= OCSMetaBuilder(); + set meta(covariant OCSMetaBuilder? meta) => _$this._meta = meta; + + ApiGenerateResponseApplicationJson_Ocs_DataBuilder? _data; + ApiGenerateResponseApplicationJson_Ocs_DataBuilder get data => + _$this._data ??= ApiGenerateResponseApplicationJson_Ocs_DataBuilder(); + set data(covariant ApiGenerateResponseApplicationJson_Ocs_DataBuilder? data) => _$this._data = data; + + ApiGenerateResponseApplicationJson_OcsBuilder() { + ApiGenerateResponseApplicationJson_Ocs._defaults(this); + } + + ApiGenerateResponseApplicationJson_OcsBuilder get _$this { + final $v = _$v; + if ($v != null) { + _meta = $v.meta.toBuilder(); + _data = $v.data.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(covariant ApiGenerateResponseApplicationJson_Ocs other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$ApiGenerateResponseApplicationJson_Ocs; + } + + @override + void update(void Function(ApiGenerateResponseApplicationJson_OcsBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + ApiGenerateResponseApplicationJson_Ocs build() => _build(); + + _$ApiGenerateResponseApplicationJson_Ocs _build() { + ApiGenerateResponseApplicationJson_Ocs._validate(this); + _$ApiGenerateResponseApplicationJson_Ocs _$result; + try { + _$result = _$v ?? + _$ApiGenerateResponseApplicationJson_Ocs._( + meta: meta.build(), + data: data.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'meta'; + meta.build(); + _$failedField = 'data'; + data.build(); + } catch (e) { + throw BuiltValueNestedFieldError(r'ApiGenerateResponseApplicationJson_Ocs', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +abstract mixin class $ApiGenerateResponseApplicationJsonInterfaceBuilder { + void replace($ApiGenerateResponseApplicationJsonInterface other); + void update(void Function($ApiGenerateResponseApplicationJsonInterfaceBuilder) updates); + ApiGenerateResponseApplicationJson_OcsBuilder get ocs; + set ocs(ApiGenerateResponseApplicationJson_OcsBuilder? ocs); +} + +class _$ApiGenerateResponseApplicationJson extends ApiGenerateResponseApplicationJson { + @override + final ApiGenerateResponseApplicationJson_Ocs ocs; + + factory _$ApiGenerateResponseApplicationJson([void Function(ApiGenerateResponseApplicationJsonBuilder)? updates]) => + (ApiGenerateResponseApplicationJsonBuilder()..update(updates))._build(); + + _$ApiGenerateResponseApplicationJson._({required this.ocs}) : super._() { + BuiltValueNullFieldError.checkNotNull(ocs, r'ApiGenerateResponseApplicationJson', 'ocs'); + } + + @override + ApiGenerateResponseApplicationJson rebuild(void Function(ApiGenerateResponseApplicationJsonBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + ApiGenerateResponseApplicationJsonBuilder toBuilder() => ApiGenerateResponseApplicationJsonBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is ApiGenerateResponseApplicationJson && ocs == other.ocs; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, ocs.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'ApiGenerateResponseApplicationJson')..add('ocs', ocs)).toString(); + } +} + +class ApiGenerateResponseApplicationJsonBuilder + implements + Builder, + $ApiGenerateResponseApplicationJsonInterfaceBuilder { + _$ApiGenerateResponseApplicationJson? _$v; + + ApiGenerateResponseApplicationJson_OcsBuilder? _ocs; + ApiGenerateResponseApplicationJson_OcsBuilder get ocs => + _$this._ocs ??= ApiGenerateResponseApplicationJson_OcsBuilder(); + set ocs(covariant ApiGenerateResponseApplicationJson_OcsBuilder? ocs) => _$this._ocs = ocs; + + ApiGenerateResponseApplicationJsonBuilder() { + ApiGenerateResponseApplicationJson._defaults(this); + } + + ApiGenerateResponseApplicationJsonBuilder get _$this { + final $v = _$v; + if ($v != null) { + _ocs = $v.ocs.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(covariant ApiGenerateResponseApplicationJson other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$ApiGenerateResponseApplicationJson; + } + + @override + void update(void Function(ApiGenerateResponseApplicationJsonBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + ApiGenerateResponseApplicationJson build() => _build(); + + _$ApiGenerateResponseApplicationJson _build() { + ApiGenerateResponseApplicationJson._validate(this); + _$ApiGenerateResponseApplicationJson _$result; + try { + _$result = _$v ?? + _$ApiGenerateResponseApplicationJson._( + ocs: ocs.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'ocs'; + ocs.build(); + } catch (e) { + throw BuiltValueNestedFieldError(r'ApiGenerateResponseApplicationJson', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +abstract mixin class $ApiValidateRequestApplicationJsonInterfaceBuilder { + void replace($ApiValidateRequestApplicationJsonInterface other); + void update(void Function($ApiValidateRequestApplicationJsonInterfaceBuilder) updates); + String? get password; + set password(String? password); +} + +class _$ApiValidateRequestApplicationJson extends ApiValidateRequestApplicationJson { + @override + final String password; + + factory _$ApiValidateRequestApplicationJson([void Function(ApiValidateRequestApplicationJsonBuilder)? updates]) => + (ApiValidateRequestApplicationJsonBuilder()..update(updates))._build(); + + _$ApiValidateRequestApplicationJson._({required this.password}) : super._() { + BuiltValueNullFieldError.checkNotNull(password, r'ApiValidateRequestApplicationJson', 'password'); + } + + @override + ApiValidateRequestApplicationJson rebuild(void Function(ApiValidateRequestApplicationJsonBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + ApiValidateRequestApplicationJsonBuilder toBuilder() => ApiValidateRequestApplicationJsonBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is ApiValidateRequestApplicationJson && password == other.password; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, password.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'ApiValidateRequestApplicationJson')..add('password', password)).toString(); + } +} + +class ApiValidateRequestApplicationJsonBuilder + implements + Builder, + $ApiValidateRequestApplicationJsonInterfaceBuilder { + _$ApiValidateRequestApplicationJson? _$v; + + String? _password; + String? get password => _$this._password; + set password(covariant String? password) => _$this._password = password; + + ApiValidateRequestApplicationJsonBuilder() { + ApiValidateRequestApplicationJson._defaults(this); + } + + ApiValidateRequestApplicationJsonBuilder get _$this { + final $v = _$v; + if ($v != null) { + _password = $v.password; + _$v = null; + } + return this; + } + + @override + void replace(covariant ApiValidateRequestApplicationJson other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$ApiValidateRequestApplicationJson; + } + + @override + void update(void Function(ApiValidateRequestApplicationJsonBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + ApiValidateRequestApplicationJson build() => _build(); + + _$ApiValidateRequestApplicationJson _build() { + ApiValidateRequestApplicationJson._validate(this); + final _$result = _$v ?? + _$ApiValidateRequestApplicationJson._( + password: BuiltValueNullFieldError.checkNotNull(password, r'ApiValidateRequestApplicationJson', 'password'), + ); + replace(_$result); + return _$result; + } +} + +abstract mixin class $ApiValidateResponseApplicationJson_Ocs_DataInterfaceBuilder { + void replace($ApiValidateResponseApplicationJson_Ocs_DataInterface other); + void update(void Function($ApiValidateResponseApplicationJson_Ocs_DataInterfaceBuilder) updates); + bool? get passed; + set passed(bool? passed); + + String? get reason; + set reason(String? reason); +} + +class _$ApiValidateResponseApplicationJson_Ocs_Data extends ApiValidateResponseApplicationJson_Ocs_Data { + @override + final bool passed; + @override + final String? reason; + + factory _$ApiValidateResponseApplicationJson_Ocs_Data( + [void Function(ApiValidateResponseApplicationJson_Ocs_DataBuilder)? updates]) => + (ApiValidateResponseApplicationJson_Ocs_DataBuilder()..update(updates))._build(); + + _$ApiValidateResponseApplicationJson_Ocs_Data._({required this.passed, this.reason}) : super._() { + BuiltValueNullFieldError.checkNotNull(passed, r'ApiValidateResponseApplicationJson_Ocs_Data', 'passed'); + } + + @override + ApiValidateResponseApplicationJson_Ocs_Data rebuild( + void Function(ApiValidateResponseApplicationJson_Ocs_DataBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + ApiValidateResponseApplicationJson_Ocs_DataBuilder toBuilder() => + ApiValidateResponseApplicationJson_Ocs_DataBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is ApiValidateResponseApplicationJson_Ocs_Data && passed == other.passed && reason == other.reason; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, passed.hashCode); + _$hash = $jc(_$hash, reason.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'ApiValidateResponseApplicationJson_Ocs_Data') + ..add('passed', passed) + ..add('reason', reason)) + .toString(); + } +} + +class ApiValidateResponseApplicationJson_Ocs_DataBuilder + implements + Builder, + $ApiValidateResponseApplicationJson_Ocs_DataInterfaceBuilder { + _$ApiValidateResponseApplicationJson_Ocs_Data? _$v; + + bool? _passed; + bool? get passed => _$this._passed; + set passed(covariant bool? passed) => _$this._passed = passed; + + String? _reason; + String? get reason => _$this._reason; + set reason(covariant String? reason) => _$this._reason = reason; + + ApiValidateResponseApplicationJson_Ocs_DataBuilder() { + ApiValidateResponseApplicationJson_Ocs_Data._defaults(this); + } + + ApiValidateResponseApplicationJson_Ocs_DataBuilder get _$this { + final $v = _$v; + if ($v != null) { + _passed = $v.passed; + _reason = $v.reason; + _$v = null; + } + return this; + } + + @override + void replace(covariant ApiValidateResponseApplicationJson_Ocs_Data other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$ApiValidateResponseApplicationJson_Ocs_Data; + } + + @override + void update(void Function(ApiValidateResponseApplicationJson_Ocs_DataBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + ApiValidateResponseApplicationJson_Ocs_Data build() => _build(); + + _$ApiValidateResponseApplicationJson_Ocs_Data _build() { + ApiValidateResponseApplicationJson_Ocs_Data._validate(this); + final _$result = _$v ?? + _$ApiValidateResponseApplicationJson_Ocs_Data._( + passed: + BuiltValueNullFieldError.checkNotNull(passed, r'ApiValidateResponseApplicationJson_Ocs_Data', 'passed'), + reason: reason, + ); + replace(_$result); + return _$result; + } +} + +abstract mixin class $ApiValidateResponseApplicationJson_OcsInterfaceBuilder { + void replace($ApiValidateResponseApplicationJson_OcsInterface other); + void update(void Function($ApiValidateResponseApplicationJson_OcsInterfaceBuilder) updates); + OCSMetaBuilder get meta; + set meta(OCSMetaBuilder? meta); + + ApiValidateResponseApplicationJson_Ocs_DataBuilder get data; + set data(ApiValidateResponseApplicationJson_Ocs_DataBuilder? data); +} + +class _$ApiValidateResponseApplicationJson_Ocs extends ApiValidateResponseApplicationJson_Ocs { + @override + final OCSMeta meta; + @override + final ApiValidateResponseApplicationJson_Ocs_Data data; + + factory _$ApiValidateResponseApplicationJson_Ocs( + [void Function(ApiValidateResponseApplicationJson_OcsBuilder)? updates]) => + (ApiValidateResponseApplicationJson_OcsBuilder()..update(updates))._build(); + + _$ApiValidateResponseApplicationJson_Ocs._({required this.meta, required this.data}) : super._() { + BuiltValueNullFieldError.checkNotNull(meta, r'ApiValidateResponseApplicationJson_Ocs', 'meta'); + BuiltValueNullFieldError.checkNotNull(data, r'ApiValidateResponseApplicationJson_Ocs', 'data'); + } + + @override + ApiValidateResponseApplicationJson_Ocs rebuild( + void Function(ApiValidateResponseApplicationJson_OcsBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + ApiValidateResponseApplicationJson_OcsBuilder toBuilder() => + ApiValidateResponseApplicationJson_OcsBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is ApiValidateResponseApplicationJson_Ocs && meta == other.meta && data == other.data; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, meta.hashCode); + _$hash = $jc(_$hash, data.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'ApiValidateResponseApplicationJson_Ocs') + ..add('meta', meta) + ..add('data', data)) + .toString(); + } +} + +class ApiValidateResponseApplicationJson_OcsBuilder + implements + Builder, + $ApiValidateResponseApplicationJson_OcsInterfaceBuilder { + _$ApiValidateResponseApplicationJson_Ocs? _$v; + + OCSMetaBuilder? _meta; + OCSMetaBuilder get meta => _$this._meta ??= OCSMetaBuilder(); + set meta(covariant OCSMetaBuilder? meta) => _$this._meta = meta; + + ApiValidateResponseApplicationJson_Ocs_DataBuilder? _data; + ApiValidateResponseApplicationJson_Ocs_DataBuilder get data => + _$this._data ??= ApiValidateResponseApplicationJson_Ocs_DataBuilder(); + set data(covariant ApiValidateResponseApplicationJson_Ocs_DataBuilder? data) => _$this._data = data; + + ApiValidateResponseApplicationJson_OcsBuilder() { + ApiValidateResponseApplicationJson_Ocs._defaults(this); + } + + ApiValidateResponseApplicationJson_OcsBuilder get _$this { + final $v = _$v; + if ($v != null) { + _meta = $v.meta.toBuilder(); + _data = $v.data.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(covariant ApiValidateResponseApplicationJson_Ocs other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$ApiValidateResponseApplicationJson_Ocs; + } + + @override + void update(void Function(ApiValidateResponseApplicationJson_OcsBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + ApiValidateResponseApplicationJson_Ocs build() => _build(); + + _$ApiValidateResponseApplicationJson_Ocs _build() { + ApiValidateResponseApplicationJson_Ocs._validate(this); + _$ApiValidateResponseApplicationJson_Ocs _$result; + try { + _$result = _$v ?? + _$ApiValidateResponseApplicationJson_Ocs._( + meta: meta.build(), + data: data.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'meta'; + meta.build(); + _$failedField = 'data'; + data.build(); + } catch (e) { + throw BuiltValueNestedFieldError(r'ApiValidateResponseApplicationJson_Ocs', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +abstract mixin class $ApiValidateResponseApplicationJsonInterfaceBuilder { + void replace($ApiValidateResponseApplicationJsonInterface other); + void update(void Function($ApiValidateResponseApplicationJsonInterfaceBuilder) updates); + ApiValidateResponseApplicationJson_OcsBuilder get ocs; + set ocs(ApiValidateResponseApplicationJson_OcsBuilder? ocs); +} + +class _$ApiValidateResponseApplicationJson extends ApiValidateResponseApplicationJson { + @override + final ApiValidateResponseApplicationJson_Ocs ocs; + + factory _$ApiValidateResponseApplicationJson([void Function(ApiValidateResponseApplicationJsonBuilder)? updates]) => + (ApiValidateResponseApplicationJsonBuilder()..update(updates))._build(); + + _$ApiValidateResponseApplicationJson._({required this.ocs}) : super._() { + BuiltValueNullFieldError.checkNotNull(ocs, r'ApiValidateResponseApplicationJson', 'ocs'); + } + + @override + ApiValidateResponseApplicationJson rebuild(void Function(ApiValidateResponseApplicationJsonBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + ApiValidateResponseApplicationJsonBuilder toBuilder() => ApiValidateResponseApplicationJsonBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is ApiValidateResponseApplicationJson && ocs == other.ocs; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, ocs.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'ApiValidateResponseApplicationJson')..add('ocs', ocs)).toString(); + } +} + +class ApiValidateResponseApplicationJsonBuilder + implements + Builder, + $ApiValidateResponseApplicationJsonInterfaceBuilder { + _$ApiValidateResponseApplicationJson? _$v; + + ApiValidateResponseApplicationJson_OcsBuilder? _ocs; + ApiValidateResponseApplicationJson_OcsBuilder get ocs => + _$this._ocs ??= ApiValidateResponseApplicationJson_OcsBuilder(); + set ocs(covariant ApiValidateResponseApplicationJson_OcsBuilder? ocs) => _$this._ocs = ocs; + + ApiValidateResponseApplicationJsonBuilder() { + ApiValidateResponseApplicationJson._defaults(this); + } + + ApiValidateResponseApplicationJsonBuilder get _$this { + final $v = _$v; + if ($v != null) { + _ocs = $v.ocs.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(covariant ApiValidateResponseApplicationJson other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$ApiValidateResponseApplicationJson; + } + + @override + void update(void Function(ApiValidateResponseApplicationJsonBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + ApiValidateResponseApplicationJson build() => _build(); + + _$ApiValidateResponseApplicationJson _build() { + ApiValidateResponseApplicationJson._validate(this); + _$ApiValidateResponseApplicationJson _$result; + try { + _$result = _$v ?? + _$ApiValidateResponseApplicationJson._( + ocs: ocs.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'ocs'; + ocs.build(); + } catch (e) { + throw BuiltValueNestedFieldError(r'ApiValidateResponseApplicationJson', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +abstract mixin class $Capabilities_PasswordPolicy_ApiInterfaceBuilder { + void replace($Capabilities_PasswordPolicy_ApiInterface other); + void update(void Function($Capabilities_PasswordPolicy_ApiInterfaceBuilder) updates); + String? get generate; + set generate(String? generate); + + String? get validate; + set validate(String? validate); +} + +class _$Capabilities_PasswordPolicy_Api extends Capabilities_PasswordPolicy_Api { + @override + final String generate; + @override + final String validate; + + factory _$Capabilities_PasswordPolicy_Api([void Function(Capabilities_PasswordPolicy_ApiBuilder)? updates]) => + (Capabilities_PasswordPolicy_ApiBuilder()..update(updates))._build(); + + _$Capabilities_PasswordPolicy_Api._({required this.generate, required this.validate}) : super._() { + BuiltValueNullFieldError.checkNotNull(generate, r'Capabilities_PasswordPolicy_Api', 'generate'); + BuiltValueNullFieldError.checkNotNull(validate, r'Capabilities_PasswordPolicy_Api', 'validate'); + } + + @override + Capabilities_PasswordPolicy_Api rebuild(void Function(Capabilities_PasswordPolicy_ApiBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + Capabilities_PasswordPolicy_ApiBuilder toBuilder() => Capabilities_PasswordPolicy_ApiBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is Capabilities_PasswordPolicy_Api && generate == other.generate && validate == other.validate; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, generate.hashCode); + _$hash = $jc(_$hash, validate.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'Capabilities_PasswordPolicy_Api') + ..add('generate', generate) + ..add('validate', validate)) + .toString(); + } +} + +class Capabilities_PasswordPolicy_ApiBuilder + implements + Builder, + $Capabilities_PasswordPolicy_ApiInterfaceBuilder { + _$Capabilities_PasswordPolicy_Api? _$v; + + String? _generate; + String? get generate => _$this._generate; + set generate(covariant String? generate) => _$this._generate = generate; + + String? _validate; + String? get validate => _$this._validate; + set validate(covariant String? validate) => _$this._validate = validate; + + Capabilities_PasswordPolicy_ApiBuilder() { + Capabilities_PasswordPolicy_Api._defaults(this); + } + + Capabilities_PasswordPolicy_ApiBuilder get _$this { + final $v = _$v; + if ($v != null) { + _generate = $v.generate; + _validate = $v.validate; + _$v = null; + } + return this; + } + + @override + void replace(covariant Capabilities_PasswordPolicy_Api other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$Capabilities_PasswordPolicy_Api; + } + + @override + void update(void Function(Capabilities_PasswordPolicy_ApiBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + Capabilities_PasswordPolicy_Api build() => _build(); + + _$Capabilities_PasswordPolicy_Api _build() { + Capabilities_PasswordPolicy_Api._validate(this); + final _$result = _$v ?? + _$Capabilities_PasswordPolicy_Api._( + generate: BuiltValueNullFieldError.checkNotNull(generate, r'Capabilities_PasswordPolicy_Api', 'generate'), + validate: BuiltValueNullFieldError.checkNotNull(validate, r'Capabilities_PasswordPolicy_Api', 'validate'), + ); + replace(_$result); + return _$result; + } +} + +abstract mixin class $Capabilities_PasswordPolicyInterfaceBuilder { + void replace($Capabilities_PasswordPolicyInterface other); + void update(void Function($Capabilities_PasswordPolicyInterfaceBuilder) updates); + int? get minLength; + set minLength(int? minLength); + + bool? get enforceNonCommonPassword; + set enforceNonCommonPassword(bool? enforceNonCommonPassword); + + bool? get enforceNumericCharacters; + set enforceNumericCharacters(bool? enforceNumericCharacters); + + bool? get enforceSpecialCharacters; + set enforceSpecialCharacters(bool? enforceSpecialCharacters); + + bool? get enforceUpperLowerCase; + set enforceUpperLowerCase(bool? enforceUpperLowerCase); + + Capabilities_PasswordPolicy_ApiBuilder get api; + set api(Capabilities_PasswordPolicy_ApiBuilder? api); +} + +class _$Capabilities_PasswordPolicy extends Capabilities_PasswordPolicy { + @override + final int minLength; + @override + final bool enforceNonCommonPassword; + @override + final bool enforceNumericCharacters; + @override + final bool enforceSpecialCharacters; + @override + final bool enforceUpperLowerCase; + @override + final Capabilities_PasswordPolicy_Api api; + + factory _$Capabilities_PasswordPolicy([void Function(Capabilities_PasswordPolicyBuilder)? updates]) => + (Capabilities_PasswordPolicyBuilder()..update(updates))._build(); + + _$Capabilities_PasswordPolicy._( + {required this.minLength, + required this.enforceNonCommonPassword, + required this.enforceNumericCharacters, + required this.enforceSpecialCharacters, + required this.enforceUpperLowerCase, + required this.api}) + : super._() { + BuiltValueNullFieldError.checkNotNull(minLength, r'Capabilities_PasswordPolicy', 'minLength'); + BuiltValueNullFieldError.checkNotNull( + enforceNonCommonPassword, r'Capabilities_PasswordPolicy', 'enforceNonCommonPassword'); + BuiltValueNullFieldError.checkNotNull( + enforceNumericCharacters, r'Capabilities_PasswordPolicy', 'enforceNumericCharacters'); + BuiltValueNullFieldError.checkNotNull( + enforceSpecialCharacters, r'Capabilities_PasswordPolicy', 'enforceSpecialCharacters'); + BuiltValueNullFieldError.checkNotNull( + enforceUpperLowerCase, r'Capabilities_PasswordPolicy', 'enforceUpperLowerCase'); + BuiltValueNullFieldError.checkNotNull(api, r'Capabilities_PasswordPolicy', 'api'); + } + + @override + Capabilities_PasswordPolicy rebuild(void Function(Capabilities_PasswordPolicyBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + Capabilities_PasswordPolicyBuilder toBuilder() => Capabilities_PasswordPolicyBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is Capabilities_PasswordPolicy && + minLength == other.minLength && + enforceNonCommonPassword == other.enforceNonCommonPassword && + enforceNumericCharacters == other.enforceNumericCharacters && + enforceSpecialCharacters == other.enforceSpecialCharacters && + enforceUpperLowerCase == other.enforceUpperLowerCase && + api == other.api; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, minLength.hashCode); + _$hash = $jc(_$hash, enforceNonCommonPassword.hashCode); + _$hash = $jc(_$hash, enforceNumericCharacters.hashCode); + _$hash = $jc(_$hash, enforceSpecialCharacters.hashCode); + _$hash = $jc(_$hash, enforceUpperLowerCase.hashCode); + _$hash = $jc(_$hash, api.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'Capabilities_PasswordPolicy') + ..add('minLength', minLength) + ..add('enforceNonCommonPassword', enforceNonCommonPassword) + ..add('enforceNumericCharacters', enforceNumericCharacters) + ..add('enforceSpecialCharacters', enforceSpecialCharacters) + ..add('enforceUpperLowerCase', enforceUpperLowerCase) + ..add('api', api)) + .toString(); + } +} + +class Capabilities_PasswordPolicyBuilder + implements + Builder, + $Capabilities_PasswordPolicyInterfaceBuilder { + _$Capabilities_PasswordPolicy? _$v; + + int? _minLength; + int? get minLength => _$this._minLength; + set minLength(covariant int? minLength) => _$this._minLength = minLength; + + bool? _enforceNonCommonPassword; + bool? get enforceNonCommonPassword => _$this._enforceNonCommonPassword; + set enforceNonCommonPassword(covariant bool? enforceNonCommonPassword) => + _$this._enforceNonCommonPassword = enforceNonCommonPassword; + + bool? _enforceNumericCharacters; + bool? get enforceNumericCharacters => _$this._enforceNumericCharacters; + set enforceNumericCharacters(covariant bool? enforceNumericCharacters) => + _$this._enforceNumericCharacters = enforceNumericCharacters; + + bool? _enforceSpecialCharacters; + bool? get enforceSpecialCharacters => _$this._enforceSpecialCharacters; + set enforceSpecialCharacters(covariant bool? enforceSpecialCharacters) => + _$this._enforceSpecialCharacters = enforceSpecialCharacters; + + bool? _enforceUpperLowerCase; + bool? get enforceUpperLowerCase => _$this._enforceUpperLowerCase; + set enforceUpperLowerCase(covariant bool? enforceUpperLowerCase) => + _$this._enforceUpperLowerCase = enforceUpperLowerCase; + + Capabilities_PasswordPolicy_ApiBuilder? _api; + Capabilities_PasswordPolicy_ApiBuilder get api => _$this._api ??= Capabilities_PasswordPolicy_ApiBuilder(); + set api(covariant Capabilities_PasswordPolicy_ApiBuilder? api) => _$this._api = api; + + Capabilities_PasswordPolicyBuilder() { + Capabilities_PasswordPolicy._defaults(this); + } + + Capabilities_PasswordPolicyBuilder get _$this { + final $v = _$v; + if ($v != null) { + _minLength = $v.minLength; + _enforceNonCommonPassword = $v.enforceNonCommonPassword; + _enforceNumericCharacters = $v.enforceNumericCharacters; + _enforceSpecialCharacters = $v.enforceSpecialCharacters; + _enforceUpperLowerCase = $v.enforceUpperLowerCase; + _api = $v.api.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(covariant Capabilities_PasswordPolicy other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$Capabilities_PasswordPolicy; + } + + @override + void update(void Function(Capabilities_PasswordPolicyBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + Capabilities_PasswordPolicy build() => _build(); + + _$Capabilities_PasswordPolicy _build() { + Capabilities_PasswordPolicy._validate(this); + _$Capabilities_PasswordPolicy _$result; + try { + _$result = _$v ?? + _$Capabilities_PasswordPolicy._( + minLength: BuiltValueNullFieldError.checkNotNull(minLength, r'Capabilities_PasswordPolicy', 'minLength'), + enforceNonCommonPassword: BuiltValueNullFieldError.checkNotNull( + enforceNonCommonPassword, r'Capabilities_PasswordPolicy', 'enforceNonCommonPassword'), + enforceNumericCharacters: BuiltValueNullFieldError.checkNotNull( + enforceNumericCharacters, r'Capabilities_PasswordPolicy', 'enforceNumericCharacters'), + enforceSpecialCharacters: BuiltValueNullFieldError.checkNotNull( + enforceSpecialCharacters, r'Capabilities_PasswordPolicy', 'enforceSpecialCharacters'), + enforceUpperLowerCase: BuiltValueNullFieldError.checkNotNull( + enforceUpperLowerCase, r'Capabilities_PasswordPolicy', 'enforceUpperLowerCase'), + api: api.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'api'; + api.build(); + } catch (e) { + throw BuiltValueNestedFieldError(r'Capabilities_PasswordPolicy', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +abstract mixin class $CapabilitiesInterfaceBuilder { + void replace($CapabilitiesInterface other); + void update(void Function($CapabilitiesInterfaceBuilder) updates); + Capabilities_PasswordPolicyBuilder get passwordPolicy; + set passwordPolicy(Capabilities_PasswordPolicyBuilder? passwordPolicy); +} + +class _$Capabilities extends Capabilities { + @override + final Capabilities_PasswordPolicy passwordPolicy; + + factory _$Capabilities([void Function(CapabilitiesBuilder)? updates]) => + (CapabilitiesBuilder()..update(updates))._build(); + + _$Capabilities._({required this.passwordPolicy}) : super._() { + BuiltValueNullFieldError.checkNotNull(passwordPolicy, r'Capabilities', 'passwordPolicy'); + } + + @override + Capabilities rebuild(void Function(CapabilitiesBuilder) updates) => (toBuilder()..update(updates)).build(); + + @override + CapabilitiesBuilder toBuilder() => CapabilitiesBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is Capabilities && passwordPolicy == other.passwordPolicy; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, passwordPolicy.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'Capabilities')..add('passwordPolicy', passwordPolicy)).toString(); + } +} + +class CapabilitiesBuilder implements Builder, $CapabilitiesInterfaceBuilder { + _$Capabilities? _$v; + + Capabilities_PasswordPolicyBuilder? _passwordPolicy; + Capabilities_PasswordPolicyBuilder get passwordPolicy => + _$this._passwordPolicy ??= Capabilities_PasswordPolicyBuilder(); + set passwordPolicy(covariant Capabilities_PasswordPolicyBuilder? passwordPolicy) => + _$this._passwordPolicy = passwordPolicy; + + CapabilitiesBuilder() { + Capabilities._defaults(this); + } + + CapabilitiesBuilder get _$this { + final $v = _$v; + if ($v != null) { + _passwordPolicy = $v.passwordPolicy.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(covariant Capabilities other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$Capabilities; + } + + @override + void update(void Function(CapabilitiesBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + Capabilities build() => _build(); + + _$Capabilities _build() { + Capabilities._validate(this); + _$Capabilities _$result; + try { + _$result = _$v ?? + _$Capabilities._( + passwordPolicy: passwordPolicy.build(), + ); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'passwordPolicy'; + passwordPolicy.build(); + } catch (e) { + throw BuiltValueNestedFieldError(r'Capabilities', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/nextcloud/lib/src/api/password_policy/password_policy.openapi.json b/packages/nextcloud/lib/src/api/password_policy/password_policy.openapi.json new file mode 100644 index 00000000000..1526a9a4eb6 --- /dev/null +++ b/packages/nextcloud/lib/src/api/password_policy/password_policy.openapi.json @@ -0,0 +1,294 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "password_policy", + "version": "0.0.1", + "description": "Allows admins to configure a password policy", + "license": { + "name": "agpl", + "identifier": "AGPL-3.0-only" + } + }, + "components": { + "securitySchemes": { + "basic_auth": { + "type": "http", + "scheme": "basic" + }, + "bearer_auth": { + "type": "http", + "scheme": "bearer" + } + }, + "schemas": { + "Capabilities": { + "type": "object", + "required": [ + "password_policy" + ], + "properties": { + "password_policy": { + "type": "object", + "required": [ + "minLength", + "enforceNonCommonPassword", + "enforceNumericCharacters", + "enforceSpecialCharacters", + "enforceUpperLowerCase", + "api" + ], + "properties": { + "minLength": { + "type": "integer", + "format": "int64", + "minimum": 0 + }, + "enforceNonCommonPassword": { + "type": "boolean" + }, + "enforceNumericCharacters": { + "type": "boolean" + }, + "enforceSpecialCharacters": { + "type": "boolean" + }, + "enforceUpperLowerCase": { + "type": "boolean" + }, + "api": { + "type": "object", + "required": [ + "generate", + "validate" + ], + "properties": { + "generate": { + "type": "string" + }, + "validate": { + "type": "string" + } + } + } + } + } + } + }, + "OCSMeta": { + "type": "object", + "required": [ + "status", + "statuscode" + ], + "properties": { + "status": { + "type": "string" + }, + "statuscode": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "totalitems": { + "type": "string" + }, + "itemsperpage": { + "type": "string" + } + } + } + } + }, + "paths": { + "/ocs/v2.php/apps/password_policy/api/v1/generate": { + "get": { + "operationId": "api-generate", + "summary": "Generate a random password that validates against the enabled password policy rules", + "tags": [ + "api" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Password generated", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "password" + ], + "properties": { + "password": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "409": { + "description": "Generated password accidentally failed to validate against the rules, retry.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": {} + } + } + } + } + } + } + } + } + } + }, + "/ocs/v2.php/apps/password_policy/api/v1/validate": { + "post": { + "operationId": "api-validate", + "summary": "Validate a password against the enabled password policy rules", + "tags": [ + "api" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "password" + ], + "properties": { + "password": { + "type": "string", + "description": "The password to validate" + } + } + } + } + } + }, + "parameters": [ + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Always", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "passed" + ], + "properties": { + "passed": { + "type": "boolean" + }, + "reason": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "tags": [] +} diff --git a/packages/nextcloud/test/api/core/core_test.dart b/packages/nextcloud/test/api/core/core_test.dart index a3b484c8326..bec0d4d588d 100644 --- a/packages/nextcloud/test/api/core/core_test.dart +++ b/packages/nextcloud/test/api/core/core_test.dart @@ -71,6 +71,7 @@ void main() { expect(response.body.ocs.data.capabilities.filesVersionsCapabilities, isNotNull); expect(response.body.ocs.data.capabilities.notesCapabilities, isNotNull); expect(response.body.ocs.data.capabilities.notificationsCapabilities, isNotNull); + expect(response.body.ocs.data.capabilities.passwordPolicyCapabilities, isNotNull); expect(response.body.ocs.data.capabilities.provisioningApiCapabilities, isNotNull); expect(response.body.ocs.data.capabilities.sharebymailCapabilities, isNotNull); expect(response.body.ocs.data.capabilities.spreedPublicCapabilities, isNotNull); diff --git a/packages/nextcloud/test/api/password_policy/password_policy_test.dart b/packages/nextcloud/test/api/password_policy/password_policy_test.dart new file mode 100644 index 00000000000..c6040bb7c32 --- /dev/null +++ b/packages/nextcloud/test/api/password_policy/password_policy_test.dart @@ -0,0 +1,37 @@ +import 'package:nextcloud/password_policy.dart' as password_policy; +import 'package:nextcloud_test/nextcloud_test.dart'; +import 'package:test/test.dart'; + +void main() { + presets('server', 'password_policy', (tester) { + test('generate', () async { + final response = await tester.client.passwordPolicy.api.generate(); + expect(response.body.ocs.data.password, isNotEmpty); + }); + + group('validate', () { + test('pass', () async { + final generateResponse = await tester.client.passwordPolicy.api.generate(); + expect(generateResponse.body.ocs.data.password, isNotEmpty); + + final validateResponse = await tester.client.passwordPolicy.api.validate( + $body: password_policy.ApiValidateRequestApplicationJson( + (b) => b.password = generateResponse.body.ocs.data.password, + ), + ); + expect(validateResponse.body.ocs.data.passed, isTrue); + expect(validateResponse.body.ocs.data.reason, isNull); + }); + + test('fail', () async { + final validateResponse = await tester.client.passwordPolicy.api.validate( + $body: password_policy.ApiValidateRequestApplicationJson( + (b) => b.password = '12345678', + ), + ); + expect(validateResponse.body.ocs.data.passed, isFalse); + expect(validateResponse.body.ocs.data.reason, isNotEmpty); + }); + }); + }); +} diff --git a/packages/nextcloud/test/fixtures/password_policy/generate.regexp b/packages/nextcloud/test/fixtures/password_policy/generate.regexp new file mode 100644 index 00000000000..d2077eaedba --- /dev/null +++ b/packages/nextcloud/test/fixtures/password_policy/generate.regexp @@ -0,0 +1,4 @@ +GET http://localhost/ocs/v2\.php/apps/password_policy/api/v1/generate +accept: application/json +authorization: Bearer mock +ocs-apirequest: true \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/password_policy/validate/fail.regexp b/packages/nextcloud/test/fixtures/password_policy/validate/fail.regexp new file mode 100644 index 00000000000..cb48b74a1e8 --- /dev/null +++ b/packages/nextcloud/test/fixtures/password_policy/validate/fail.regexp @@ -0,0 +1,6 @@ +POST http://localhost/ocs/v2\.php/apps/password_policy/api/v1/validate +accept: application/json +authorization: Bearer mock +content-type: application/json; charset=utf-8 +ocs-apirequest: true +\{"password":"12345678"\} \ No newline at end of file diff --git a/packages/nextcloud/test/fixtures/password_policy/validate/pass.regexp b/packages/nextcloud/test/fixtures/password_policy/validate/pass.regexp new file mode 100644 index 00000000000..a2ce0de637e --- /dev/null +++ b/packages/nextcloud/test/fixtures/password_policy/validate/pass.regexp @@ -0,0 +1,10 @@ +GET http://localhost/ocs/v2\.php/apps/password_policy/api/v1/generate +accept: application/json +authorization: Bearer mock +ocs-apirequest: true +POST http://localhost/ocs/v2\.php/apps/password_policy/api/v1/validate +accept: application/json +authorization: Bearer mock +content-type: application/json; charset=utf-8 +ocs-apirequest: true +\{"password":".+"\} \ No newline at end of file diff --git a/tool/generate-specs.sh b/tool/generate-specs.sh index d52d6f203e2..6b31ff126c7 100755 --- a/tool/generate-specs.sh +++ b/tool/generate-specs.sh @@ -54,6 +54,10 @@ function generate_spec() { cd external/nextcloud-tables generate_spec "." "tables" ) +( + cd external/nextcloud-password_policy + generate_spec "." "password_policy" +) ( yq -s '.[0]."components"."schemas" = .[1] | .[0] | walk(if type == "object" then with_entries( if (.key == "$ref" and (.value | test("#\/components\/schemas\/") | not) ) then .value |= sub("#\/"; "#/components/schemas/") else . end ) else . end) | .paths |= with_entries(.key = "/index.php/apps/cookbook\(.key)")' \ external/nextcloud-cookbook/docs/dev/api/0.1.2/openapi-cookbook.yaml \