diff --git a/packages/dynamite/dynamite/lib/src/builder/client.dart b/packages/dynamite/dynamite/lib/src/builder/client.dart index d5a76c4b8ba..2c9576ccd2c 100644 --- a/packages/dynamite/dynamite/lib/src/builder/client.dart +++ b/packages/dynamite/dynamite/lib/src/builder/client.dart @@ -8,10 +8,10 @@ import 'package:dynamite/src/builder/state.dart'; import 'package:dynamite/src/helpers/dart_helpers.dart'; import 'package:dynamite/src/helpers/dynamite.dart'; import 'package:dynamite/src/helpers/pattern_check.dart'; -import 'package:dynamite/src/helpers/type_result.dart'; import 'package:dynamite/src/models/openapi.dart' as openapi; import 'package:dynamite/src/models/type_result.dart'; import 'package:intersperse/intersperse.dart'; +import 'package:uri/uri.dart'; Iterable generateClients( final openapi.OpenAPI spec, @@ -216,8 +216,7 @@ Iterable buildTags( .join(','); code.writeln(''' - final _pathParameters = {}; - final _queryParameters = {}; + final _parameters = {}; final _headers = {${acceptHeader.isNotEmpty ? "'Accept': '$acceptHeader'," : ''}}; Uint8List? _body; '''); @@ -317,12 +316,30 @@ Iterable buildTags( toDartName(identifierBuilder.toString(), uppercaseFirstCharacter: true), ); - code.writeln(''' -var _uri = Uri.parse(UriTemplate('${pathEntry.key}').expand(_pathParameters)); -if (_queryParameters.isNotEmpty) { - _uri = _uri.replace(queryParameters: _queryParameters); -} -'''); + final queryParams = []; + for (final parameter in parameters) { + if (parameter.$in != openapi.ParameterType.query) { + continue; + } + + queryParams.add(parameter.uriTemplate(withPrefix: false)); + } + + final pathBuilder = StringBuffer()..write(pathEntry.key); + + if (queryParams.isNotEmpty) { + pathBuilder + ..write('{?') + ..writeAll(queryParams, ',') + ..write('}'); + } + + final path = pathBuilder.toString(); + + // Sanity check the uri at build time. + UriTemplate(path); + + code.writeln("final _uri = Uri.parse(UriTemplate('$path').expand(_parameters));"); if (dataType != null) { returnDataType = dataType.name; @@ -409,32 +426,32 @@ String buildParameterSerialization( final openapi.Parameter parameter, ) { final $default = parameter.schema?.$default; - final hasDefault = $default != null; - final defaultValueCode = valueToEscapedValue(result, $default.toString()); + var defaultValueCode = $default?.value; + if ($default != null && $default.isString) { + defaultValueCode = "'${$default.asString}'"; + } final dartName = toDartName(parameter.name); + final serializedName = '\$$dartName'; - final value = result.encode( - hasDefault ? '($dartName ?? $defaultValueCode)' : dartName, - onlyChildren: parameter.$in == openapi.ParameterType.query, - ); + final buffer = StringBuffer()..write('var $serializedName = ${result.serialize(dartName)};'); - final mapName = switch (parameter.$in) { - openapi.ParameterType.path => '_pathParameters', - openapi.ParameterType.query => '_queryParameters', - openapi.ParameterType.header => '_headers', - _ => throw UnsupportedError('Can not work with parameter "${parameter.name}" in "${parameter.$in}"'), - }; - - final assignment = "$mapName['${parameter.name}'] = $value;"; - - final buffer = StringBuffer(); - if (!parameter.required && result.nullable && !hasDefault) { - buffer - ..write('if ($dartName != null) {') - ..write(assignment) - ..write('}'); + if ($default != null) { + buffer.writeln('$serializedName ??= $defaultValueCode;'); + } + + if (parameter.$in == openapi.ParameterType.header) { + final assignment = "_headers['${parameter.pctName}'] = ${result.encode(serializedName, onlyChildren: true)};"; + + if ($default == null) { + buffer + ..writeln('if ($serializedName != null) {') + ..writeln(assignment) + ..writeln('}'); + } else { + buffer.writeln(assignment); + } } else { - buffer.write(assignment); + buffer.writeln("_parameters['${parameter.pctName}'] = $serializedName;"); } return buffer.toString(); diff --git a/packages/dynamite/dynamite/lib/src/models/openapi.g.dart b/packages/dynamite/dynamite/lib/src/models/openapi.g.dart index fa202117c34..ea687cd41f3 100644 --- a/packages/dynamite/dynamite/lib/src/models/openapi.g.dart +++ b/packages/dynamite/dynamite/lib/src/models/openapi.g.dart @@ -16,6 +16,7 @@ Serializers _$serializers = (Serializers().toBuilder() ..add(OpenAPI.serializer) ..add(Operation.serializer) ..add(Parameter.serializer) + ..add(ParameterStyle.serializer) ..add(ParameterType.serializer) ..add(PathItem.serializer) ..add(RequestBody.serializer) diff --git a/packages/dynamite/dynamite/lib/src/models/openapi/parameter.dart b/packages/dynamite/dynamite/lib/src/models/openapi/parameter.dart index 35ff749051b..3b2cffe45b5 100644 --- a/packages/dynamite/dynamite/lib/src/models/openapi/parameter.dart +++ b/packages/dynamite/dynamite/lib/src/models/openapi/parameter.dart @@ -6,6 +6,7 @@ import 'package:dynamite/src/helpers/docs.dart'; import 'package:dynamite/src/models/exceptions.dart'; import 'package:dynamite/src/models/openapi/media_type.dart'; import 'package:dynamite/src/models/openapi/schema.dart'; +import 'package:meta/meta.dart'; part 'parameter.g.dart'; @@ -26,16 +27,20 @@ abstract class Parameter implements Built { bool get required; - @Deprecated('Use [schema] instead which also automatically handles [content].') + @protected @BuiltValueField(wireName: 'schema') Schema? get $schema; BuiltMap? get content; + bool get explode; + + bool get allowReserved; + + ParameterStyle get style; + Schema? get schema { - // ignore: deprecated_member_use_from_same_package if ($schema != null) { - // ignore: deprecated_member_use_from_same_package return $schema; } @@ -54,9 +59,111 @@ abstract class Parameter implements Built { return null; } + /// Builds the uri template value for this parameter. + /// + /// Throws a StateError if the parameter does not support a uri template. + String uriTemplate({ + final bool isFirst = false, + final bool withPrefix = true, + }) { + final error = 'The parameter $name is not supported by RFC 6570 UriTemplates. Dynamite can not yet work with it.'; + final buffer = StringBuffer(); + + final prefix = switch (style) { + ParameterStyle.simple => null, + ParameterStyle.label => '.', + ParameterStyle.matrix => ';', + ParameterStyle.form => isFirst ? '?' : '&', + ParameterStyle.spaceDelimited || ParameterStyle.pipeDelimited => explode + ? isFirst + ? '?' + : '&' + : throw UnsupportedError(error), + ParameterStyle.deepObject || _ => throw UnsupportedError(error), + }; + + if (prefix != null && withPrefix) { + buffer.write(prefix); + } + + if (allowReserved) { + buffer.write('+'); + } + + buffer.write(pctName); + + if (explode) { + buffer.write('*'); + } + + return buffer.toString(); + } + + /// The pct encoded name of this parameter. + String get pctName => Uri.encodeQueryComponent(name); + @BuiltValueHook(finalizeBuilder: true) static void _defaults(final ParameterBuilder b) { b.required ??= false; + b._allowReserved ??= false; + b._explode ??= switch (b.$in!) { + ParameterType.query || ParameterType.cookie => true, + ParameterType.path || ParameterType.header => false, + _ => throw StateError('invalid parameter type'), + }; + b._style ??= switch (b.$in!) { + ParameterType.query => ParameterStyle.form, + ParameterType.path => ParameterStyle.simple, + ParameterType.header => ParameterStyle.simple, + ParameterType.cookie => ParameterStyle.form, + _ => throw StateError('invalid parameter type'), + }; + + switch (b.style) { + case ParameterStyle.matrix: + if (b._$in != ParameterType.path) { + throw OpenAPISpecError('ParameterStyle.matrix can only be used in path parameters.'); + } + case ParameterStyle.label: + if (b._$in != ParameterType.path) { + throw OpenAPISpecError('ParameterStyle.label can only be used in path parameters.'); + } + + case ParameterStyle.form: + if (b._$in != ParameterType.query && b._$in != ParameterType.cookie) { + throw OpenAPISpecError('ParameterStyle.form can only be used in query or cookie parameters.'); + } + + case ParameterStyle.simple: + if (b._$in != ParameterType.path && b._$in != ParameterType.header) { + throw OpenAPISpecError('ParameterStyle.simple can only be used in path or header parameters.'); + } + + case ParameterStyle.spaceDelimited: + if (b._$schema?.type != SchemaType.array && b._$schema?.type != SchemaType.object) { + throw OpenAPISpecError('ParameterStyle.spaceDelimited can only be used with array or object schemas.'); + } + if (b._$in != ParameterType.query) { + throw OpenAPISpecError('ParameterStyle.spaceDelimited can only be used in query parameters.'); + } + + case ParameterStyle.pipeDelimited: + if (b._$schema?.type != SchemaType.array && b._$schema?.type != SchemaType.object) { + throw OpenAPISpecError('ParameterStyle.pipeDelimited can only be used with array or object schemas.'); + } + if (b._$in != ParameterType.query) { + throw OpenAPISpecError('ParameterStyle.pipeDelimited can only be used in query parameters.'); + } + + case ParameterStyle.deepObject: + if (b._$schema?.type != SchemaType.object) { + throw OpenAPISpecError('ParameterStyle.deepObject can only be used with object schemas.'); + } + if (b._$in != ParameterType.query) { + throw OpenAPISpecError('ParameterStyle.deepObject can only be used in query parameters.'); + } + } + if (b.$in == ParameterType.path && !b.required!) { throw OpenAPISpecError('Path parameters must be required but ${b.name} is not.'); } @@ -111,3 +218,21 @@ class ParameterType extends EnumClass { static Serializer get serializer => _$parameterTypeSerializer; } + +class ParameterStyle extends EnumClass { + const ParameterStyle._(super.name); + + static const ParameterStyle matrix = _$parameterStyleMatrix; + static const ParameterStyle label = _$parameterStyleLabel; + static const ParameterStyle form = _$parameterStyleForm; + static const ParameterStyle simple = _$parameterStyleSimple; + static const ParameterStyle spaceDelimited = _$parameterStyleSpaceDelimited; + static const ParameterStyle pipeDelimited = _$parameterStylePipeDelimited; + static const ParameterStyle deepObject = _$parameterStyleDeepObject; + + static BuiltSet get values => _$parameterStyleValues; + + static ParameterStyle valueOf(final String name) => _$parameterStyle(name); + + static Serializer get serializer => _$parameterStyleSerializer; +} diff --git a/packages/dynamite/dynamite/lib/src/models/openapi/parameter.g.dart b/packages/dynamite/dynamite/lib/src/models/openapi/parameter.g.dart index 28c1a7b5baa..e4d0dac4373 100644 --- a/packages/dynamite/dynamite/lib/src/models/openapi/parameter.g.dart +++ b/packages/dynamite/dynamite/lib/src/models/openapi/parameter.g.dart @@ -33,8 +33,48 @@ final BuiltSet _$parameterTypeValues = BuiltSet(co _$parameterTypeCookie, ]); +const ParameterStyle _$parameterStyleMatrix = ParameterStyle._('matrix'); +const ParameterStyle _$parameterStyleLabel = ParameterStyle._('label'); +const ParameterStyle _$parameterStyleForm = ParameterStyle._('form'); +const ParameterStyle _$parameterStyleSimple = ParameterStyle._('simple'); +const ParameterStyle _$parameterStyleSpaceDelimited = ParameterStyle._('spaceDelimited'); +const ParameterStyle _$parameterStylePipeDelimited = ParameterStyle._('pipeDelimited'); +const ParameterStyle _$parameterStyleDeepObject = ParameterStyle._('deepObject'); + +ParameterStyle _$parameterStyle(String name) { + switch (name) { + case 'matrix': + return _$parameterStyleMatrix; + case 'label': + return _$parameterStyleLabel; + case 'form': + return _$parameterStyleForm; + case 'simple': + return _$parameterStyleSimple; + case 'spaceDelimited': + return _$parameterStyleSpaceDelimited; + case 'pipeDelimited': + return _$parameterStylePipeDelimited; + case 'deepObject': + return _$parameterStyleDeepObject; + default: + throw ArgumentError(name); + } +} + +final BuiltSet _$parameterStyleValues = BuiltSet(const [ + _$parameterStyleMatrix, + _$parameterStyleLabel, + _$parameterStyleForm, + _$parameterStyleSimple, + _$parameterStyleSpaceDelimited, + _$parameterStylePipeDelimited, + _$parameterStyleDeepObject, +]); + Serializer _$parameterSerializer = _$ParameterSerializer(); Serializer _$parameterTypeSerializer = _$ParameterTypeSerializer(); +Serializer _$parameterStyleSerializer = _$ParameterStyleSerializer(); class _$ParameterSerializer implements StructuredSerializer { @override @@ -52,6 +92,12 @@ class _$ParameterSerializer implements StructuredSerializer { serializers.serialize(object.$in, specifiedType: const FullType(ParameterType)), 'required', serializers.serialize(object.required, specifiedType: const FullType(bool)), + 'explode', + serializers.serialize(object.explode, specifiedType: const FullType(bool)), + 'allowReserved', + serializers.serialize(object.allowReserved, specifiedType: const FullType(bool)), + 'style', + serializers.serialize(object.style, specifiedType: const FullType(ParameterStyle)), ]; Object? value; value = object.description; @@ -106,6 +152,16 @@ class _$ParameterSerializer implements StructuredSerializer { result.content.replace(serializers.deserialize(value, specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MediaType)]))!); break; + case 'explode': + result.explode = serializers.deserialize(value, specifiedType: const FullType(bool))! as bool; + break; + case 'allowReserved': + result.allowReserved = serializers.deserialize(value, specifiedType: const FullType(bool))! as bool; + break; + case 'style': + result.style = + serializers.deserialize(value, specifiedType: const FullType(ParameterStyle))! as ParameterStyle; + break; } } @@ -129,6 +185,22 @@ class _$ParameterTypeSerializer implements PrimitiveSerializer { ParameterType.valueOf(serialized as String); } +class _$ParameterStyleSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ParameterStyle]; + @override + final String wireName = 'ParameterStyle'; + + @override + Object serialize(Serializers serializers, ParameterStyle object, {FullType specifiedType = FullType.unspecified}) => + object.name; + + @override + ParameterStyle deserialize(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified}) => + ParameterStyle.valueOf(serialized as String); +} + class _$Parameter extends Parameter { @override final String name; @@ -142,15 +214,32 @@ class _$Parameter extends Parameter { final Schema? $schema; @override final BuiltMap? content; + @override + final bool explode; + @override + final bool allowReserved; + @override + final ParameterStyle style; factory _$Parameter([void Function(ParameterBuilder)? updates]) => (ParameterBuilder()..update(updates))._build(); _$Parameter._( - {required this.name, required this.$in, this.description, required this.required, this.$schema, this.content}) + {required this.name, + required this.$in, + this.description, + required this.required, + this.$schema, + this.content, + required this.explode, + required this.allowReserved, + required this.style}) : super._() { BuiltValueNullFieldError.checkNotNull(name, r'Parameter', 'name'); BuiltValueNullFieldError.checkNotNull($in, r'Parameter', '\$in'); BuiltValueNullFieldError.checkNotNull(required, r'Parameter', 'required'); + BuiltValueNullFieldError.checkNotNull(explode, r'Parameter', 'explode'); + BuiltValueNullFieldError.checkNotNull(allowReserved, r'Parameter', 'allowReserved'); + BuiltValueNullFieldError.checkNotNull(style, r'Parameter', 'style'); } @override @@ -167,7 +256,10 @@ class _$Parameter extends Parameter { $in == other.$in && required == other.required && $schema == other.$schema && - content == other.content; + content == other.content && + explode == other.explode && + allowReserved == other.allowReserved && + style == other.style; } @override @@ -178,6 +270,9 @@ class _$Parameter extends Parameter { _$hash = $jc(_$hash, required.hashCode); _$hash = $jc(_$hash, $schema.hashCode); _$hash = $jc(_$hash, content.hashCode); + _$hash = $jc(_$hash, explode.hashCode); + _$hash = $jc(_$hash, allowReserved.hashCode); + _$hash = $jc(_$hash, style.hashCode); _$hash = $jf(_$hash); return _$hash; } @@ -190,7 +285,10 @@ class _$Parameter extends Parameter { ..add('description', description) ..add('required', required) ..add('\$schema', $schema) - ..add('content', content)) + ..add('content', content) + ..add('explode', explode) + ..add('allowReserved', allowReserved) + ..add('style', style)) .toString(); } } @@ -222,6 +320,18 @@ class ParameterBuilder implements Builder { MapBuilder get content => _$this._content ??= MapBuilder(); set content(MapBuilder? content) => _$this._content = content; + bool? _explode; + bool? get explode => _$this._explode; + set explode(bool? explode) => _$this._explode = explode; + + bool? _allowReserved; + bool? get allowReserved => _$this._allowReserved; + set allowReserved(bool? allowReserved) => _$this._allowReserved = allowReserved; + + ParameterStyle? _style; + ParameterStyle? get style => _$this._style; + set style(ParameterStyle? style) => _$this._style = style; + ParameterBuilder(); ParameterBuilder get _$this { @@ -233,6 +343,9 @@ class ParameterBuilder implements Builder { _required = $v.required; _$schema = $v.$schema?.toBuilder(); _content = $v.content?.toBuilder(); + _explode = $v.explode; + _allowReserved = $v.allowReserved; + _style = $v.style; _$v = null; } return this; @@ -263,7 +376,10 @@ class ParameterBuilder implements Builder { description: description, required: BuiltValueNullFieldError.checkNotNull(required, r'Parameter', 'required'), $schema: _$schema?.build(), - content: _content?.build()); + content: _content?.build(), + explode: BuiltValueNullFieldError.checkNotNull(explode, r'Parameter', 'explode'), + allowReserved: BuiltValueNullFieldError.checkNotNull(allowReserved, r'Parameter', 'allowReserved'), + style: BuiltValueNullFieldError.checkNotNull(style, r'Parameter', 'style')); } catch (_) { late String _$failedField; try { diff --git a/packages/dynamite/dynamite/lib/src/models/type_result/base.dart b/packages/dynamite/dynamite/lib/src/models/type_result/base.dart index 170d856944a..2c8302a859c 100644 --- a/packages/dynamite/dynamite/lib/src/models/type_result/base.dart +++ b/packages/dynamite/dynamite/lib/src/models/type_result/base.dart @@ -25,7 +25,7 @@ class TypeResultBase extends TypeResult { case 'application/json': case 'application/x-www-form-urlencoded': if (className == 'String') { - return object; + return '$object as String'; } else { return '$object.toString()'; } diff --git a/packages/dynamite/dynamite/lib/src/models/type_result/list.dart b/packages/dynamite/dynamite/lib/src/models/type_result/list.dart index 39c75814256..d51b0c61d7b 100644 --- a/packages/dynamite/dynamite/lib/src/models/type_result/list.dart +++ b/packages/dynamite/dynamite/lib/src/models/type_result/list.dart @@ -22,7 +22,7 @@ class TypeResultList extends TypeResult { final String? mimeType, }) { if (onlyChildren) { - return '$object.map((final e) => ${subType.encode('e', mimeType: mimeType)})'; + return '($object as List).map((final e) => ${subType.encode('e', mimeType: mimeType)}).join()'; } return super.encode(object, mimeType: mimeType); diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/headers.openapi.dart b/packages/dynamite/dynamite_end_to_end_test/lib/headers.openapi.dart index 02902f0e502..4c3ee391455 100644 --- a/packages/dynamite/dynamite_end_to_end_test/lib/headers.openapi.dart +++ b/packages/dynamite/dynamite_end_to_end_test/lib/headers.openapi.dart @@ -60,16 +60,11 @@ class Client extends DynamiteClient { /// * [$get] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse $getRaw() { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = {}; Uint8List? body; - var uri = Uri.parse(UriTemplate('/').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'get', @@ -110,16 +105,11 @@ class Client extends DynamiteClient { /// * [withContentOperationId] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse withContentOperationIdRaw() { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = {}; Uint8List? body; - var uri = Uri.parse(UriTemplate('/with_content/operation_id').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/with_content/operation_id').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'get', @@ -160,18 +150,13 @@ class Client extends DynamiteClient { /// * [getWithContent] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse getWithContentRaw() { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/octet-stream', }; Uint8List? body; - var uri = Uri.parse(UriTemplate('/with_content').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/with_content').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'get', diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.dart b/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.dart index 020b46fa5a4..3e7241aef33 100644 --- a/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.dart +++ b/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.dart @@ -47,6 +47,7 @@ class Client extends DynamiteClient { /// * [$int] /// * [$double] /// * [$num] + /// * [object] /// /// Status codes: /// * 200 @@ -56,13 +57,14 @@ class Client extends DynamiteClient { Future> $get({ final ContentString>? contentString, final ContentString>? contentParameter, - final BuiltList? array, + final BuiltList? array, final bool? $bool, final String? string, final Uint8List? stringBinary, final int? $int, final double? $double, final num? $num, + final JsonObject? object, }) async { final rawResponse = $getRaw( contentString: contentString, @@ -74,6 +76,7 @@ class Client extends DynamiteClient { $int: $int, $double: $double, $num: $num, + object: object, ); return rawResponse.future; @@ -94,6 +97,7 @@ class Client extends DynamiteClient { /// * [$int] /// * [$double] /// * [$num] + /// * [object] /// /// Status codes: /// * 200 @@ -104,63 +108,180 @@ class Client extends DynamiteClient { DynamiteRawResponse $getRaw({ final ContentString>? contentString, final ContentString>? contentParameter, - final BuiltList? array, + final BuiltList? array, final bool? $bool, final String? string, final Uint8List? stringBinary, final int? $int, final double? $double, final num? $num, + final JsonObject? object, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; Uint8List? body; - if (contentString != null) { - queryParameters['content_string'] = jsonSerializers.serialize( - contentString, - specifiedType: const FullType(ContentString, [ - FullType(BuiltMap, [FullType(String), FullType(JsonObject)]), - ]), - ); - } - if (contentParameter != null) { - queryParameters['content_parameter'] = jsonSerializers.serialize( - contentParameter, - specifiedType: const FullType(ContentString, [ - FullType(BuiltMap, [FullType(String), FullType(JsonObject)]), - ]), - ); - } - if (array != null) { - queryParameters['array'] = array.map((final e) => e.toString()); - } - if ($bool != null) { - queryParameters['bool'] = $bool.toString(); - } - if (string != null) { - queryParameters['string'] = string; + final $contentString = jsonSerializers.serialize( + contentString, + specifiedType: const FullType(ContentString, [ + FullType(BuiltMap, [FullType(String), FullType(JsonObject)]), + ]), + ); + parameters['content_string'] = $contentString; + + final $contentParameter = jsonSerializers.serialize( + contentParameter, + specifiedType: const FullType(ContentString, [ + FullType(BuiltMap, [FullType(String), FullType(JsonObject)]), + ]), + ); + parameters['content_parameter'] = $contentParameter; + + final $array = jsonSerializers.serialize(array, specifiedType: const FullType(BuiltList, [FullType(String)])); + parameters['array'] = $array; + + final $$bool = jsonSerializers.serialize($bool, specifiedType: const FullType(bool)); + parameters['bool'] = $$bool; + + final $string = jsonSerializers.serialize(string, specifiedType: const FullType(String)); + parameters['string'] = $string; + + final $stringBinary = jsonSerializers.serialize(stringBinary, specifiedType: const FullType(Uint8List)); + parameters['string_binary'] = $stringBinary; + + final $$int = jsonSerializers.serialize($int, specifiedType: const FullType(int)); + parameters['int'] = $$int; + + final $$double = jsonSerializers.serialize($double, specifiedType: const FullType(double)); + parameters['double'] = $$double; + + final $$num = jsonSerializers.serialize($num, specifiedType: const FullType(num)); + parameters['num'] = $$num; + + final $object = jsonSerializers.serialize(object, specifiedType: const FullType(JsonObject)); + parameters['object'] = $object; + + final uri = Uri.parse( + UriTemplate( + '/{?content_string*,content_parameter*,array*,bool*,string*,string_binary*,int*,double*,num*,object*}', + ).expand(parameters), + ); + return DynamiteRawResponse( + response: executeRequest( + 'get', + uri, + headers, + body, + const {200}, + ), + bodyType: const FullType(JsonObject), + headersType: null, + serializers: jsonSerializers, + ); + } + + /// 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: + /// * [array] + /// * [$bool] + /// * [string] + /// * [$int] + /// * [$double] + /// * [$num] + /// + /// Status codes: + /// * 200 + /// + /// See: + /// * [getHeadersRaw] for an experimental operation that returns a [DynamiteRawResponse] that can be serialized. + Future> getHeaders({ + final BuiltList? array, + final bool? $bool, + final String? string, + final int? $int, + final double? $double, + final num? $num, + }) async { + final rawResponse = getHeadersRaw( + array: array, + $bool: $bool, + string: string, + $int: $int, + $double: $double, + $num: $num, + ); + + return rawResponse.future; + } + + /// This method and the response it returns is experimental. The API might change without a major version bump. + /// + /// Returns a [Future] containing a [DynamiteRawResponse] with the raw [HttpClientResponse] and serialization helpers. + /// Throws a [DynamiteApiException] if the API call does not return an expected status code. + /// + /// Parameters: + /// * [array] + /// * [$bool] + /// * [string] + /// * [$int] + /// * [$double] + /// * [$num] + /// + /// Status codes: + /// * 200 + /// + /// See: + /// * [getHeaders] for an operation that returns a [DynamiteResponse] with a stable API. + @experimental + DynamiteRawResponse getHeadersRaw({ + final BuiltList? array, + final bool? $bool, + final String? string, + final int? $int, + final double? $double, + final num? $num, + }) { + final parameters = {}; + final headers = { + 'Accept': 'application/json', + }; + Uint8List? body; + + final $array = jsonSerializers.serialize(array, specifiedType: const FullType(BuiltList, [FullType(String)])); + if ($array != null) { + headers['array'] = ($array as List).map((final e) => e as String).join(); } - if (stringBinary != null) { - queryParameters['string_binary'] = stringBinary.toString(); + + final $$bool = jsonSerializers.serialize($bool, specifiedType: const FullType(bool)); + if ($$bool != null) { + headers['bool'] = $$bool.toString(); } - if ($int != null) { - queryParameters['int'] = $int.toString(); + + final $string = jsonSerializers.serialize(string, specifiedType: const FullType(String)); + if ($string != null) { + headers['string'] = $string as String; } - if ($double != null) { - queryParameters['double'] = $double.toString(); + + final $$int = jsonSerializers.serialize($int, specifiedType: const FullType(int)); + if ($$int != null) { + headers['int'] = $$int.toString(); } - if ($num != null) { - queryParameters['num'] = $num.toString(); + + final $$double = jsonSerializers.serialize($double, specifiedType: const FullType(double)); + if ($$double != null) { + headers['double'] = $$double.toString(); } - var uri = Uri.parse(UriTemplate('/').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); + + final $$num = jsonSerializers.serialize($num, specifiedType: const FullType(num)); + if ($$num != null) { + headers['num'] = $$num.toString(); } + final uri = Uri.parse(UriTemplate('/headers').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'get', @@ -203,19 +324,16 @@ class Client extends DynamiteClient { /// * [getPathParameter] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse getPathParameterRaw({required final String pathParameter}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; Uint8List? body; - pathParameters['path_parameter'] = pathParameter; - var uri = Uri.parse(UriTemplate('/{path_parameter}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $pathParameter = jsonSerializers.serialize(pathParameter, specifiedType: const FullType(String)); + parameters['path_parameter'] = $pathParameter; + final uri = Uri.parse(UriTemplate('/{path_parameter}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'get', @@ -245,7 +363,7 @@ final Serializers serializers = (Serializers().toBuilder() ContentStringBuilder>.new, ) ..add(ContentString.serializer) - ..addBuilderFactory(const FullType(BuiltList, [FullType(JsonObject)]), ListBuilder.new)) + ..addBuilderFactory(const FullType(BuiltList, [FullType(String)]), ListBuilder.new)) .build(); @visibleForTesting diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.json b/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.json index 165c4858ee5..079a3f9f8a0 100644 --- a/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.json +++ b/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.json @@ -36,7 +36,10 @@ "name": "array", "in": "query", "schema": { - "type": "array" + "type": "array", + "items": { + "type": "string" + } } }, { @@ -82,6 +85,75 @@ "schema": { "type": "number" } + }, + { + "name": "object", + "in": "query", + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": {} + } + } + } + } + } + }, + "/headers": { + "get": { + "parameters": [ + { + "name": "array", + "in": "header", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "bool", + "in": "header", + "schema": { + "type": "boolean" + } + }, + { + "name": "string", + "in": "header", + "schema": { + "type": "string" + } + }, + { + "name": "int", + "in": "header", + "schema": { + "type": "integer" + } + }, + { + "name": "double", + "in": "header", + "schema": { + "type": "number", + "format": "float" + } + }, + { + "name": "num", + "in": "header", + "schema": { + "type": "number" + } } ], "responses": { diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/request_body.openapi.dart b/packages/dynamite/dynamite_end_to_end_test/lib/request_body.openapi.dart index dfe2fe35729..7e503c8c602 100644 --- a/packages/dynamite/dynamite_end_to_end_test/lib/request_body.openapi.dart +++ b/packages/dynamite/dynamite_end_to_end_test/lib/request_body.openapi.dart @@ -60,8 +60,7 @@ class Client extends DynamiteClient { /// * [$get] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse $getRaw({final Uint8List? uint8List}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = {}; Uint8List? body; @@ -69,11 +68,7 @@ class Client extends DynamiteClient { if (uint8List != null) { body = uint8List; } - var uri = Uri.parse(UriTemplate('/').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'get', @@ -116,8 +111,7 @@ class Client extends DynamiteClient { /// * [post] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse postRaw({final String? string}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = {}; Uint8List? body; @@ -125,11 +119,7 @@ class Client extends DynamiteClient { if (string != null) { body = utf8.encode(string); } - var uri = Uri.parse(UriTemplate('/').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'post', diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/responses.openapi.dart b/packages/dynamite/dynamite_end_to_end_test/lib/responses.openapi.dart index a9211464fcf..4f4e011877b 100644 --- a/packages/dynamite/dynamite_end_to_end_test/lib/responses.openapi.dart +++ b/packages/dynamite/dynamite_end_to_end_test/lib/responses.openapi.dart @@ -57,18 +57,13 @@ class Client extends DynamiteClient { /// * [$get] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse $getRaw() { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; Uint8List? body; - var uri = Uri.parse(UriTemplate('/').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'get', @@ -111,18 +106,13 @@ class Client extends DynamiteClient { /// * [put] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse putRaw() { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; Uint8List? body; - var uri = Uri.parse(UriTemplate('/').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'put', @@ -167,18 +157,13 @@ class Client extends DynamiteClient { /// * [post] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse postRaw() { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; Uint8List? body; - var uri = Uri.parse(UriTemplate('/').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'post', @@ -221,18 +206,13 @@ class Client extends DynamiteClient { /// * [patch] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse patchRaw() { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; Uint8List? body; - var uri = Uri.parse(UriTemplate('/').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'patch', diff --git a/packages/dynamite/dynamite_end_to_end_test/test/parameters_test.dart b/packages/dynamite/dynamite_end_to_end_test/test/parameters_test.dart index 348513d1fa5..bd4b8b653ca 100644 --- a/packages/dynamite/dynamite_end_to_end_test/test/parameters_test.dart +++ b/packages/dynamite/dynamite_end_to_end_test/test/parameters_test.dart @@ -89,6 +89,18 @@ void main() { ); }); + test('with empty string', () async { + await client.$get(string: ''); + final captured = verify(mockHttpClient.openUrl(captureAny, captureAny)).captured; + expect( + captured, + equals([ + 'get', + Uri.parse('example.com/?string='), + ]), + ); + }); + test('with multiple query parameters', () async { final contentString = ContentString>( (final b) => b..content = BuiltMap({'key': JsonObject('value')}), diff --git a/packages/dynamite/dynamite_petstore_example/lib/petstore.openapi.dart b/packages/dynamite/dynamite_petstore_example/lib/petstore.openapi.dart index 75a2cfc1288..46268d4ad54 100644 --- a/packages/dynamite/dynamite_petstore_example/lib/petstore.openapi.dart +++ b/packages/dynamite/dynamite_petstore_example/lib/petstore.openapi.dart @@ -92,24 +92,19 @@ class Client extends DynamiteClient { BuiltList? tags, int? limit, }) { - final _pathParameters = {}; - final _queryParameters = {}; + final _parameters = {}; final _headers = { 'Accept': 'application/json', }; Uint8List? _body; - if (tags != null) { - _queryParameters['tags'] = tags.map((final e) => e); - } - if (limit != null) { - _queryParameters['limit'] = limit.toString(); - } - var _uri = Uri.parse(UriTemplate('/pets').expand(_pathParameters)); - if (_queryParameters.isNotEmpty) { - _uri = _uri.replace(queryParameters: _queryParameters); - } + var $tags = jsonSerializers.serialize(tags, specifiedType: const FullType(BuiltList, [FullType(String)])); + _parameters['tags'] = $tags; + var $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + _parameters['limit'] = $limit; + + final _uri = Uri.parse(UriTemplate('/pets{?tags*,limit*}').expand(_parameters)); return DynamiteRawResponse, void>( response: this.executeRequest( 'get', @@ -158,8 +153,7 @@ class Client extends DynamiteClient { /// * [addPet] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse addPetRaw({required NewPet newPet}) { - final _pathParameters = {}; - final _queryParameters = {}; + final _parameters = {}; final _headers = { 'Accept': 'application/json', }; @@ -167,11 +161,7 @@ class Client extends DynamiteClient { _headers['Content-Type'] = 'application/json'; _body = utf8.encode(json.encode(jsonSerializers.serialize(newPet, specifiedType: const FullType(NewPet)))); - var _uri = Uri.parse(UriTemplate('/pets').expand(_pathParameters)); - if (_queryParameters.isNotEmpty) { - _uri = _uri.replace(queryParameters: _queryParameters); - } - + final _uri = Uri.parse(UriTemplate('/pets').expand(_parameters)); return DynamiteRawResponse( response: this.executeRequest( 'post', @@ -226,19 +216,16 @@ class Client extends DynamiteClient { /// * [findPetById] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse findPetByIdRaw({required int id}) { - final _pathParameters = {}; - final _queryParameters = {}; + final _parameters = {}; final _headers = { 'Accept': 'application/json', }; Uint8List? _body; - _pathParameters['id'] = id.toString(); - var _uri = Uri.parse(UriTemplate('/pets/{id}').expand(_pathParameters)); - if (_queryParameters.isNotEmpty) { - _uri = _uri.replace(queryParameters: _queryParameters); - } + var $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + _parameters['id'] = $id; + final _uri = Uri.parse(UriTemplate('/pets/{id}').expand(_parameters)); return DynamiteRawResponse( response: this.executeRequest( 'get', @@ -293,17 +280,14 @@ class Client extends DynamiteClient { /// * [deletePet] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse deletePetRaw({required int id}) { - final _pathParameters = {}; - final _queryParameters = {}; + final _parameters = {}; final _headers = {}; Uint8List? _body; - _pathParameters['id'] = id.toString(); - var _uri = Uri.parse(UriTemplate('/pets/{id}').expand(_pathParameters)); - if (_queryParameters.isNotEmpty) { - _uri = _uri.replace(queryParameters: _queryParameters); - } + var $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + _parameters['id'] = $id; + final _uri = Uri.parse(UriTemplate('/pets/{id}').expand(_parameters)); return DynamiteRawResponse( response: this.executeRequest( 'delete', diff --git a/packages/nextcloud/lib/src/api/core.openapi.dart b/packages/nextcloud/lib/src/api/core.openapi.dart index 9caa750a407..c91efe1725b 100644 --- a/packages/nextcloud/lib/src/api/core.openapi.dart +++ b/packages/nextcloud/lib/src/api/core.openapi.dart @@ -106,18 +106,13 @@ class Client extends DynamiteClient { /// * [getStatus] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse getStatusRaw() { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; Uint8List? body; - var uri = Uri.parse(UriTemplate('/status.php').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/status.php').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'get', @@ -182,8 +177,7 @@ class AppPasswordClient { DynamiteRawResponse getAppPasswordRaw({ final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -206,12 +200,11 @@ class AppPasswordClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/core/getapppassword').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/core/getapppassword').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -270,8 +263,7 @@ class AppPasswordClient { DynamiteRawResponse rotateAppPasswordRaw({ final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -294,12 +286,11 @@ class AppPasswordClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/core/apppassword/rotate').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/core/apppassword/rotate').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -358,8 +349,7 @@ class AppPasswordClient { DynamiteRawResponse deleteAppPasswordRaw({ final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -382,12 +372,11 @@ class AppPasswordClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/core/apppassword').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/core/apppassword').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -480,8 +469,7 @@ class AutoCompleteClient { final int? limit, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -504,26 +492,34 @@ class AutoCompleteClient { } // coverage:ignore-end - queryParameters['search'] = search; - if (itemType != null) { - queryParameters['itemType'] = itemType; - } - if (itemId != null) { - queryParameters['itemId'] = itemId; - } - if (sorter != null) { - queryParameters['sorter'] = sorter; - } - if (shareTypes != null) { - queryParameters['shareTypes[]'] = shareTypes.map((final e) => e.toString()); - } - queryParameters['limit'] = (limit ?? 10).toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/core/autocomplete/get').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $search = jsonSerializers.serialize(search, specifiedType: const FullType(String)); + parameters['search'] = $search; + + final $itemType = jsonSerializers.serialize(itemType, specifiedType: const FullType(String)); + parameters['itemType'] = $itemType; + final $itemId = jsonSerializers.serialize(itemId, specifiedType: const FullType(String)); + parameters['itemId'] = $itemId; + + final $sorter = jsonSerializers.serialize(sorter, specifiedType: const FullType(String)); + parameters['sorter'] = $sorter; + + final $shareTypes = + jsonSerializers.serialize(shareTypes, specifiedType: const FullType(BuiltList, [FullType(int)])); + parameters['shareTypes%5B%5D'] = $shareTypes; + + var $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + $limit ??= 10; + parameters['limit'] = $limit; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/core/autocomplete/get{?search*,itemType*,itemId*,sorter*,shareTypes%5B%5D*,limit*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -594,8 +590,7 @@ class AvatarClient { required final String userId, required final int size, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': '*/*', }; @@ -616,13 +611,13 @@ class AvatarClient { } // coverage:ignore-end - pathParameters['userId'] = userId; - pathParameters['size'] = size.toString(); - var uri = Uri.parse(UriTemplate('/index.php/avatar/{userId}/{size}/dark').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + + final $size = jsonSerializers.serialize(size, specifiedType: const FullType(int)); + parameters['size'] = $size; + final uri = Uri.parse(UriTemplate('/index.php/avatar/{userId}/{size}/dark').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -686,8 +681,7 @@ class AvatarClient { required final String userId, required final int size, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': '*/*', }; @@ -708,13 +702,13 @@ class AvatarClient { } // coverage:ignore-end - pathParameters['userId'] = userId; - pathParameters['size'] = size.toString(); - var uri = Uri.parse(UriTemplate('/index.php/avatar/{userId}/{size}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + + final $size = jsonSerializers.serialize(size, specifiedType: const FullType(int)); + parameters['size'] = $size; + final uri = Uri.parse(UriTemplate('/index.php/avatar/{userId}/{size}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -775,8 +769,7 @@ class ClientFlowLoginV2Client { /// * [poll] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse pollRaw({required final String token}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -797,12 +790,10 @@ class ClientFlowLoginV2Client { } // coverage:ignore-end - queryParameters['token'] = token; - var uri = Uri.parse(UriTemplate('/index.php/login/v2/poll').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + final uri = Uri.parse(UriTemplate('/index.php/login/v2/poll{?token*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -847,8 +838,7 @@ class ClientFlowLoginV2Client { /// * [init] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse initRaw() { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -869,11 +859,7 @@ class ClientFlowLoginV2Client { } // coverage:ignore-end - var uri = Uri.parse(UriTemplate('/index.php/login/v2').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/index.php/login/v2').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -943,8 +929,7 @@ class CollaborationResourcesClient { required final String filter, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -967,15 +952,15 @@ class CollaborationResourcesClient { } // coverage:ignore-end - pathParameters['filter'] = filter; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/collaboration/resources/collections/search/{filter}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $filter = jsonSerializers.serialize(filter, specifiedType: const FullType(String)); + parameters['filter'] = $filter; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/collaboration/resources/collections/search/{filter}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -1041,8 +1026,7 @@ class CollaborationResourcesClient { required final int collectionId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1065,15 +1049,15 @@ class CollaborationResourcesClient { } // coverage:ignore-end - pathParameters['collectionId'] = collectionId.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/collaboration/resources/collections/{collectionId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $collectionId = jsonSerializers.serialize(collectionId, specifiedType: const FullType(int)); + parameters['collectionId'] = $collectionId; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/collaboration/resources/collections/{collectionId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -1144,8 +1128,7 @@ class CollaborationResourcesClient { required final int collectionId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1168,16 +1151,20 @@ class CollaborationResourcesClient { } // coverage:ignore-end - queryParameters['collectionName'] = collectionName; - pathParameters['collectionId'] = collectionId.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/collaboration/resources/collections/{collectionId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $collectionName = jsonSerializers.serialize(collectionName, specifiedType: const FullType(String)); + parameters['collectionName'] = $collectionName; + final $collectionId = jsonSerializers.serialize(collectionId, specifiedType: const FullType(int)); + parameters['collectionId'] = $collectionId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/collaboration/resources/collections/{collectionId}{?collectionName*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -1253,8 +1240,7 @@ class CollaborationResourcesClient { required final int collectionId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1277,17 +1263,23 @@ class CollaborationResourcesClient { } // coverage:ignore-end - queryParameters['resourceType'] = resourceType; - queryParameters['resourceId'] = resourceId; - pathParameters['collectionId'] = collectionId.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/collaboration/resources/collections/{collectionId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $resourceType = jsonSerializers.serialize(resourceType, specifiedType: const FullType(String)); + parameters['resourceType'] = $resourceType; + + final $resourceId = jsonSerializers.serialize(resourceId, specifiedType: const FullType(String)); + parameters['resourceId'] = $resourceId; + final $collectionId = jsonSerializers.serialize(collectionId, specifiedType: const FullType(int)); + parameters['collectionId'] = $collectionId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/collaboration/resources/collections/{collectionId}{?resourceType*,resourceId*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -1363,8 +1355,7 @@ class CollaborationResourcesClient { required final int collectionId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1387,17 +1378,23 @@ class CollaborationResourcesClient { } // coverage:ignore-end - queryParameters['resourceType'] = resourceType; - queryParameters['resourceId'] = resourceId; - pathParameters['collectionId'] = collectionId.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/collaboration/resources/collections/{collectionId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $resourceType = jsonSerializers.serialize(resourceType, specifiedType: const FullType(String)); + parameters['resourceType'] = $resourceType; + + final $resourceId = jsonSerializers.serialize(resourceId, specifiedType: const FullType(String)); + parameters['resourceId'] = $resourceId; + final $collectionId = jsonSerializers.serialize(collectionId, specifiedType: const FullType(int)); + parameters['collectionId'] = $collectionId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/collaboration/resources/collections/{collectionId}{?resourceType*,resourceId*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -1468,8 +1465,7 @@ class CollaborationResourcesClient { required final String resourceId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1492,16 +1488,18 @@ class CollaborationResourcesClient { } // coverage:ignore-end - pathParameters['resourceType'] = resourceType; - pathParameters['resourceId'] = resourceId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/collaboration/resources/{resourceType}/{resourceId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $resourceType = jsonSerializers.serialize(resourceType, specifiedType: const FullType(String)); + parameters['resourceType'] = $resourceType; + + final $resourceId = jsonSerializers.serialize(resourceId, specifiedType: const FullType(String)); + parameters['resourceId'] = $resourceId; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/collaboration/resources/{resourceType}/{resourceId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -1581,8 +1579,7 @@ class CollaborationResourcesClient { required final String baseResourceId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1605,17 +1602,22 @@ class CollaborationResourcesClient { } // coverage:ignore-end - queryParameters['name'] = name; - pathParameters['baseResourceType'] = baseResourceType; - pathParameters['baseResourceId'] = baseResourceId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/collaboration/resources/{baseResourceType}/{baseResourceId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $name = jsonSerializers.serialize(name, specifiedType: const FullType(String)); + parameters['name'] = $name; + + final $baseResourceType = jsonSerializers.serialize(baseResourceType, specifiedType: const FullType(String)); + parameters['baseResourceType'] = $baseResourceType; + + final $baseResourceId = jsonSerializers.serialize(baseResourceId, specifiedType: const FullType(String)); + parameters['baseResourceId'] = $baseResourceId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/collaboration/resources/{baseResourceType}/{baseResourceId}{?name*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -1688,8 +1690,7 @@ class GuestAvatarClient { required final String guestName, required final String size, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': '*/*', }; @@ -1710,13 +1711,13 @@ class GuestAvatarClient { } // coverage:ignore-end - pathParameters['guestName'] = guestName; - pathParameters['size'] = size; - var uri = Uri.parse(UriTemplate('/index.php/avatar/guest/{guestName}/{size}/dark').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $guestName = jsonSerializers.serialize(guestName, specifiedType: const FullType(String)); + parameters['guestName'] = $guestName; + + final $size = jsonSerializers.serialize(size, specifiedType: const FullType(String)); + parameters['size'] = $size; + final uri = Uri.parse(UriTemplate('/index.php/avatar/guest/{guestName}/{size}/dark').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -1787,8 +1788,7 @@ class GuestAvatarClient { required final String size, final int? darkTheme, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': '*/*', }; @@ -1809,14 +1809,17 @@ class GuestAvatarClient { } // coverage:ignore-end - pathParameters['guestName'] = guestName; - pathParameters['size'] = size; - queryParameters['darkTheme'] = (darkTheme ?? 0).toString(); - var uri = Uri.parse(UriTemplate('/index.php/avatar/guest/{guestName}/{size}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $guestName = jsonSerializers.serialize(guestName, specifiedType: const FullType(String)); + parameters['guestName'] = $guestName; + + final $size = jsonSerializers.serialize(size, specifiedType: const FullType(String)); + parameters['size'] = $size; + var $darkTheme = jsonSerializers.serialize(darkTheme, specifiedType: const FullType(int)); + $darkTheme ??= 0; + parameters['darkTheme'] = $darkTheme; + + final uri = Uri.parse(UriTemplate('/index.php/avatar/guest/{guestName}/{size}{?darkTheme*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -1886,8 +1889,7 @@ class HoverCardClient { required final String userId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1910,13 +1912,14 @@ class HoverCardClient { } // coverage:ignore-end - pathParameters['userId'] = userId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/hovercard/v1/{userId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/hovercard/v1/{userId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -1986,8 +1989,7 @@ class NavigationClient { final int? absolute, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2010,13 +2012,15 @@ class NavigationClient { } // coverage:ignore-end - queryParameters['absolute'] = (absolute ?? 0).toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/core/navigation/apps').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $absolute = jsonSerializers.serialize(absolute, specifiedType: const FullType(int)); + $absolute ??= 0; + parameters['absolute'] = $absolute; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/core/navigation/apps{?absolute*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -2080,8 +2084,7 @@ class NavigationClient { final int? absolute, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2104,13 +2107,15 @@ class NavigationClient { } // coverage:ignore-end - queryParameters['absolute'] = (absolute ?? 0).toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/core/navigation/settings').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $absolute = jsonSerializers.serialize(absolute, specifiedType: const FullType(int)); + $absolute ??= 0; + parameters['absolute'] = $absolute; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/core/navigation/settings{?absolute*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -2164,8 +2169,7 @@ class OcmClient { /// * [discovery] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse discoveryRaw() { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2186,11 +2190,7 @@ class OcmClient { } // coverage:ignore-end - var uri = Uri.parse(UriTemplate('/index.php/ocm-provider').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/index.php/ocm-provider').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -2251,8 +2251,7 @@ class OcsClient { /// * [getCapabilities] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse getCapabilitiesRaw({final bool? oCSAPIRequest}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2273,12 +2272,11 @@ class OcsClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/capabilities').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/capabilities').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -2379,8 +2377,7 @@ class PreviewClient { final String? mode, final int? mimeFallback, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': '*/*', }; @@ -2403,18 +2400,37 @@ class PreviewClient { } // coverage:ignore-end - queryParameters['fileId'] = (fileId ?? -1).toString(); - queryParameters['x'] = (x ?? 32).toString(); - queryParameters['y'] = (y ?? 32).toString(); - queryParameters['a'] = (a ?? 0).toString(); - queryParameters['forceIcon'] = (forceIcon ?? 1).toString(); - queryParameters['mode'] = mode ?? 'fill'; - queryParameters['mimeFallback'] = (mimeFallback ?? 0).toString(); - var uri = Uri.parse(UriTemplate('/index.php/core/preview').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $fileId = jsonSerializers.serialize(fileId, specifiedType: const FullType(int)); + $fileId ??= -1; + parameters['fileId'] = $fileId; + + var $x = jsonSerializers.serialize(x, specifiedType: const FullType(int)); + $x ??= 32; + parameters['x'] = $x; + + var $y = jsonSerializers.serialize(y, specifiedType: const FullType(int)); + $y ??= 32; + parameters['y'] = $y; + + var $a = jsonSerializers.serialize(a, specifiedType: const FullType(int)); + $a ??= 0; + parameters['a'] = $a; + + var $forceIcon = jsonSerializers.serialize(forceIcon, specifiedType: const FullType(int)); + $forceIcon ??= 1; + parameters['forceIcon'] = $forceIcon; + var $mode = jsonSerializers.serialize(mode, specifiedType: const FullType(String)); + $mode ??= 'fill'; + parameters['mode'] = $mode; + + var $mimeFallback = jsonSerializers.serialize(mimeFallback, specifiedType: const FullType(int)); + $mimeFallback ??= 0; + parameters['mimeFallback'] = $mimeFallback; + + final uri = Uri.parse( + UriTemplate('/index.php/core/preview{?fileId*,x*,y*,a*,forceIcon*,mode*,mimeFallback*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -2509,8 +2525,7 @@ class PreviewClient { final String? mode, final int? mimeFallback, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': '*/*', }; @@ -2533,18 +2548,37 @@ class PreviewClient { } // coverage:ignore-end - queryParameters['file'] = file ?? ''; - queryParameters['x'] = (x ?? 32).toString(); - queryParameters['y'] = (y ?? 32).toString(); - queryParameters['a'] = (a ?? 0).toString(); - queryParameters['forceIcon'] = (forceIcon ?? 1).toString(); - queryParameters['mode'] = mode ?? 'fill'; - queryParameters['mimeFallback'] = (mimeFallback ?? 0).toString(); - var uri = Uri.parse(UriTemplate('/index.php/core/preview.png').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $file = jsonSerializers.serialize(file, specifiedType: const FullType(String)); + $file ??= ''; + parameters['file'] = $file; + + var $x = jsonSerializers.serialize(x, specifiedType: const FullType(int)); + $x ??= 32; + parameters['x'] = $x; + + var $y = jsonSerializers.serialize(y, specifiedType: const FullType(int)); + $y ??= 32; + parameters['y'] = $y; + + var $a = jsonSerializers.serialize(a, specifiedType: const FullType(int)); + $a ??= 0; + parameters['a'] = $a; + + var $forceIcon = jsonSerializers.serialize(forceIcon, specifiedType: const FullType(int)); + $forceIcon ??= 1; + parameters['forceIcon'] = $forceIcon; + + var $mode = jsonSerializers.serialize(mode, specifiedType: const FullType(String)); + $mode ??= 'fill'; + parameters['mode'] = $mode; + + var $mimeFallback = jsonSerializers.serialize(mimeFallback, specifiedType: const FullType(int)); + $mimeFallback ??= 0; + parameters['mimeFallback'] = $mimeFallback; + final uri = Uri.parse( + UriTemplate('/index.php/core/preview.png{?file*,x*,y*,a*,forceIcon*,mode*,mimeFallback*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -2628,8 +2662,7 @@ class ProfileApiClient { required final String targetUserId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2652,15 +2685,20 @@ class ProfileApiClient { } // coverage:ignore-end - queryParameters['paramId'] = paramId; - queryParameters['visibility'] = visibility; - pathParameters['targetUserId'] = targetUserId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/profile/{targetUserId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $paramId = jsonSerializers.serialize(paramId, specifiedType: const FullType(String)); + parameters['paramId'] = $paramId; + + final $visibility = jsonSerializers.serialize(visibility, specifiedType: const FullType(String)); + parameters['visibility'] = $visibility; + + final $targetUserId = jsonSerializers.serialize(targetUserId, specifiedType: const FullType(String)); + parameters['targetUserId'] = $targetUserId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/profile/{targetUserId}{?paramId*,visibility*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -2721,8 +2759,7 @@ class ReferenceClient { /// * [preview] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse previewRaw({required final String referenceId}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': '*/*', }; @@ -2743,12 +2780,10 @@ class ReferenceClient { } // coverage:ignore-end - pathParameters['referenceId'] = referenceId; - var uri = Uri.parse(UriTemplate('/index.php/core/references/preview/{referenceId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $referenceId = jsonSerializers.serialize(referenceId, specifiedType: const FullType(String)); + parameters['referenceId'] = $referenceId; + final uri = Uri.parse(UriTemplate('/index.php/core/references/preview/{referenceId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -2816,8 +2851,7 @@ class ReferenceApiClient { required final String reference, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2840,13 +2874,14 @@ class ReferenceApiClient { } // coverage:ignore-end - queryParameters['reference'] = reference; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/references/resolve').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $reference = jsonSerializers.serialize(reference, specifiedType: const FullType(String)); + parameters['reference'] = $reference; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/references/resolve{?reference*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -2913,8 +2948,7 @@ class ReferenceApiClient { final int? limit, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2937,14 +2971,19 @@ class ReferenceApiClient { } // coverage:ignore-end - queryParameters['references[]'] = references.map((final e) => e); - queryParameters['limit'] = (limit ?? 1).toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/references/resolve').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $references = + jsonSerializers.serialize(references, specifiedType: const FullType(BuiltList, [FullType(String)])); + parameters['references%5B%5D'] = $references; + + var $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + $limit ??= 1; + parameters['limit'] = $limit; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/references/resolve{?references%5B%5D*,limit*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -3016,8 +3055,7 @@ class ReferenceApiClient { final int? limit, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3040,15 +3078,22 @@ class ReferenceApiClient { } // coverage:ignore-end - queryParameters['text'] = text; - queryParameters['resolve'] = (resolve ?? 0).toString(); - queryParameters['limit'] = (limit ?? 1).toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/references/extract').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $text = jsonSerializers.serialize(text, specifiedType: const FullType(String)); + parameters['text'] = $text; + + var $resolve = jsonSerializers.serialize(resolve, specifiedType: const FullType(int)); + $resolve ??= 0; + parameters['resolve'] = $resolve; + + var $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + $limit ??= 1; + parameters['limit'] = $limit; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/references/extract{?text*,resolve*,limit*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -3105,8 +3150,7 @@ class ReferenceApiClient { DynamiteRawResponse getProvidersInfoRaw({ final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3129,12 +3173,11 @@ class ReferenceApiClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/references/providers').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/references/providers').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -3201,8 +3244,7 @@ class ReferenceApiClient { final int? timestamp, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3225,16 +3267,17 @@ class ReferenceApiClient { } // coverage:ignore-end - pathParameters['providerId'] = providerId; - if (timestamp != null) { - queryParameters['timestamp'] = timestamp.toString(); - } - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/references/provider/{providerId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $providerId = jsonSerializers.serialize(providerId, specifiedType: const FullType(String)); + parameters['providerId'] = $providerId; + + final $timestamp = jsonSerializers.serialize(timestamp, specifiedType: const FullType(int)); + parameters['timestamp'] = $timestamp; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/references/provider/{providerId}{?timestamp*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -3297,8 +3340,7 @@ class TextProcessingApiClient { DynamiteRawResponse taskTypesRaw({ final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3319,12 +3361,11 @@ class TextProcessingApiClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/textprocessing/tasktypes').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/textprocessing/tasktypes').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -3405,8 +3446,7 @@ class TextProcessingApiClient { final String? identifier, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3427,16 +3467,26 @@ class TextProcessingApiClient { } // coverage:ignore-end - queryParameters['input'] = input; - queryParameters['type'] = type; - queryParameters['appId'] = appId; - queryParameters['identifier'] = identifier ?? ''; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/textprocessing/schedule').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $input = jsonSerializers.serialize(input, specifiedType: const FullType(String)); + parameters['input'] = $input; + + final $type = jsonSerializers.serialize(type, specifiedType: const FullType(String)); + parameters['type'] = $type; + + final $appId = jsonSerializers.serialize(appId, specifiedType: const FullType(String)); + parameters['appId'] = $appId; + + var $identifier = jsonSerializers.serialize(identifier, specifiedType: const FullType(String)); + $identifier ??= ''; + parameters['identifier'] = $identifier; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/textprocessing/schedule{?input*,type*,appId*,identifier*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -3502,8 +3552,7 @@ class TextProcessingApiClient { required final int id, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3524,13 +3573,14 @@ class TextProcessingApiClient { } // coverage:ignore-end - pathParameters['id'] = id.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/textprocessing/task/{id}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + parameters['id'] = $id; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/textprocessing/task/{id}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -3596,8 +3646,7 @@ class TextProcessingApiClient { required final int id, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3620,13 +3669,14 @@ class TextProcessingApiClient { } // coverage:ignore-end - pathParameters['id'] = id.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/textprocessing/task/{id}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + parameters['id'] = $id; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/textprocessing/task/{id}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -3695,8 +3745,7 @@ class TextProcessingApiClient { final String? identifier, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3719,16 +3768,17 @@ class TextProcessingApiClient { } // coverage:ignore-end - pathParameters['appId'] = appId; - if (identifier != null) { - queryParameters['identifier'] = identifier; - } - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/textprocessing/tasks/app/{appId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $appId = jsonSerializers.serialize(appId, specifiedType: const FullType(String)); + parameters['appId'] = $appId; + + final $identifier = jsonSerializers.serialize(identifier, specifiedType: const FullType(String)); + parameters['identifier'] = $identifier; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/textprocessing/tasks/app/{appId}{?identifier*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -3791,8 +3841,7 @@ class TextToImageApiClient { DynamiteRawResponse isAvailableRaw({ final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3813,12 +3862,11 @@ class TextToImageApiClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/text2image/is_available').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/text2image/is_available').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -3899,8 +3947,7 @@ class TextToImageApiClient { final int? numberOfImages, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3921,16 +3968,27 @@ class TextToImageApiClient { } // coverage:ignore-end - queryParameters['input'] = input; - queryParameters['appId'] = appId; - queryParameters['identifier'] = identifier ?? ''; - queryParameters['numberOfImages'] = (numberOfImages ?? 8).toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/text2image/schedule').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $input = jsonSerializers.serialize(input, specifiedType: const FullType(String)); + parameters['input'] = $input; + + final $appId = jsonSerializers.serialize(appId, specifiedType: const FullType(String)); + parameters['appId'] = $appId; + + var $identifier = jsonSerializers.serialize(identifier, specifiedType: const FullType(String)); + $identifier ??= ''; + parameters['identifier'] = $identifier; + + var $numberOfImages = jsonSerializers.serialize(numberOfImages, specifiedType: const FullType(int)); + $numberOfImages ??= 8; + parameters['numberOfImages'] = $numberOfImages; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/text2image/schedule{?input*,appId*,identifier*,numberOfImages*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -3996,8 +4054,7 @@ class TextToImageApiClient { required final int id, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4018,13 +4075,14 @@ class TextToImageApiClient { } // coverage:ignore-end - pathParameters['id'] = id.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/text2image/task/{id}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + parameters['id'] = $id; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/text2image/task/{id}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -4090,8 +4148,7 @@ class TextToImageApiClient { required final int id, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4114,13 +4171,14 @@ class TextToImageApiClient { } // coverage:ignore-end - pathParameters['id'] = id.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/text2image/task/{id}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + parameters['id'] = $id; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/text2image/task/{id}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -4191,8 +4249,7 @@ class TextToImageApiClient { required final int index, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': '*/*', }; @@ -4213,14 +4270,17 @@ class TextToImageApiClient { } // coverage:ignore-end - pathParameters['id'] = id.toString(); - pathParameters['index'] = index.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/text2image/task/{id}/image/{index}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + parameters['id'] = $id; + + final $index = jsonSerializers.serialize(index, specifiedType: const FullType(int)); + parameters['index'] = $index; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/text2image/task/{id}/image/{index}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -4289,8 +4349,7 @@ class TextToImageApiClient { final String? identifier, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4313,16 +4372,17 @@ class TextToImageApiClient { } // coverage:ignore-end - pathParameters['appId'] = appId; - if (identifier != null) { - queryParameters['identifier'] = identifier; - } - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/text2image/tasks/app/{appId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $appId = jsonSerializers.serialize(appId, specifiedType: const FullType(String)); + parameters['appId'] = $appId; + + final $identifier = jsonSerializers.serialize(identifier, specifiedType: const FullType(String)); + parameters['identifier'] = $identifier; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/text2image/tasks/app/{appId}{?identifier*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -4383,8 +4443,7 @@ class TranslationApiClient { /// * [languages] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse languagesRaw({final bool? oCSAPIRequest}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4405,12 +4464,11 @@ class TranslationApiClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/translation/languages').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/translation/languages').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -4488,8 +4546,7 @@ class TranslationApiClient { final String? fromLanguage, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4510,17 +4567,22 @@ class TranslationApiClient { } // coverage:ignore-end - queryParameters['text'] = text; - queryParameters['toLanguage'] = toLanguage; - if (fromLanguage != null) { - queryParameters['fromLanguage'] = fromLanguage; - } - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/translation/translate').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $text = jsonSerializers.serialize(text, specifiedType: const FullType(String)); + parameters['text'] = $text; + + final $toLanguage = jsonSerializers.serialize(toLanguage, specifiedType: const FullType(String)); + parameters['toLanguage'] = $toLanguage; + + final $fromLanguage = jsonSerializers.serialize(fromLanguage, specifiedType: const FullType(String)); + parameters['fromLanguage'] = $fromLanguage; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/translation/translate{?text*,toLanguage*,fromLanguage*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -4588,8 +4650,7 @@ class UnifiedSearchClient { final String? from, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4612,13 +4673,15 @@ class UnifiedSearchClient { } // coverage:ignore-end - queryParameters['from'] = from ?? ''; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/search/providers').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $from = jsonSerializers.serialize(from, specifiedType: const FullType(String)); + $from ??= ''; + parameters['from'] = $from; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/search/providers{?from*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -4707,8 +4770,7 @@ class UnifiedSearchClient { final String? from, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4731,27 +4793,37 @@ class UnifiedSearchClient { } // coverage:ignore-end - pathParameters['providerId'] = providerId; - queryParameters['term'] = term ?? ''; - if (sortOrder != null) { - queryParameters['sortOrder'] = sortOrder.toString(); - } - if (limit != null) { - queryParameters['limit'] = limit.toString(); - } - if (cursor != null) { - queryParameters['cursor'] = jsonSerializers.serialize( - cursor, - specifiedType: const FullType(ContentString, [FullType(UnifiedSearchSearchCursor)]), - ); - } - queryParameters['from'] = from ?? ''; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/search/providers/{providerId}/search').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $providerId = jsonSerializers.serialize(providerId, specifiedType: const FullType(String)); + parameters['providerId'] = $providerId; + + var $term = jsonSerializers.serialize(term, specifiedType: const FullType(String)); + $term ??= ''; + parameters['term'] = $term; + + final $sortOrder = jsonSerializers.serialize(sortOrder, specifiedType: const FullType(int)); + parameters['sortOrder'] = $sortOrder; + + final $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + parameters['limit'] = $limit; + final $cursor = jsonSerializers.serialize( + cursor, + specifiedType: const FullType(ContentString, [FullType(UnifiedSearchSearchCursor)]), + ); + parameters['cursor'] = $cursor; + + var $from = jsonSerializers.serialize(from, specifiedType: const FullType(String)); + $from ??= ''; + parameters['from'] = $from; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/search/providers/{providerId}/search{?term*,sortOrder*,limit*,cursor*,from*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -4812,8 +4884,7 @@ class WhatsNewClient { /// * [$get] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse $getRaw({final bool? oCSAPIRequest}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4836,12 +4907,11 @@ class WhatsNewClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/core/whatsnew').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/core/whatsnew').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -4905,8 +4975,7 @@ class WhatsNewClient { required final String version, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4929,13 +4998,14 @@ class WhatsNewClient { } // coverage:ignore-end - queryParameters['version'] = version; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/core/whatsnew').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $version = jsonSerializers.serialize(version, specifiedType: const FullType(String)); + parameters['version'] = $version; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/core/whatsnew{?version*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -4996,8 +5066,7 @@ class WipeClient { /// * [checkWipe] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse checkWipeRaw({required final String token}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -5018,12 +5087,10 @@ class WipeClient { } // coverage:ignore-end - queryParameters['token'] = token; - var uri = Uri.parse(UriTemplate('/index.php/core/wipe/check').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + final uri = Uri.parse(UriTemplate('/index.php/core/wipe/check{?token*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -5078,8 +5145,7 @@ class WipeClient { /// * [wipeDone] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse wipeDoneRaw({required final String token}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -5100,12 +5166,10 @@ class WipeClient { } // coverage:ignore-end - queryParameters['token'] = token; - var uri = Uri.parse(UriTemplate('/index.php/core/wipe/success').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + final uri = Uri.parse(UriTemplate('/index.php/core/wipe/success{?token*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', diff --git a/packages/nextcloud/lib/src/api/dashboard.openapi.dart b/packages/nextcloud/lib/src/api/dashboard.openapi.dart index 7bd5cb36c3a..b60900d5377 100644 --- a/packages/nextcloud/lib/src/api/dashboard.openapi.dart +++ b/packages/nextcloud/lib/src/api/dashboard.openapi.dart @@ -86,8 +86,7 @@ class DashboardApiClient { /// * [getWidgets] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse getWidgetsRaw({final bool? oCSAPIRequest}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -110,12 +109,11 @@ class DashboardApiClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/dashboard/api/v1/widgets').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/dashboard/api/v1/widgets').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -187,8 +185,7 @@ class DashboardApiClient { final BuiltList? widgets, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -211,22 +208,30 @@ class DashboardApiClient { } // coverage:ignore-end - if (sinceIds != null) { - queryParameters['sinceIds'] = jsonSerializers.serialize( - sinceIds, - specifiedType: const FullType(ContentString, [ - FullType(BuiltMap, [FullType(String), FullType(String)]), - ]), - ); - } - queryParameters['limit'] = (limit ?? 7).toString(); - queryParameters['widgets[]'] = (widgets ?? const []).map((final e) => e); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/dashboard/api/v1/widget-items').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $sinceIds = jsonSerializers.serialize( + sinceIds, + specifiedType: const FullType(ContentString, [ + FullType(BuiltMap, [FullType(String), FullType(String)]), + ]), + ); + parameters['sinceIds'] = $sinceIds; + + var $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + $limit ??= 7; + parameters['limit'] = $limit; + + var $widgets = jsonSerializers.serialize(widgets, specifiedType: const FullType(BuiltList, [FullType(String)])); + $widgets ??= []; + parameters['widgets%5B%5D'] = $widgets; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/dashboard/api/v1/widget-items{?sinceIds*,limit*,widgets%5B%5D*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -302,8 +307,7 @@ class DashboardApiClient { final BuiltList? widgets, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -326,22 +330,30 @@ class DashboardApiClient { } // coverage:ignore-end - if (sinceIds != null) { - queryParameters['sinceIds'] = jsonSerializers.serialize( - sinceIds, - specifiedType: const FullType(ContentString, [ - FullType(BuiltMap, [FullType(String), FullType(String)]), - ]), - ); - } - queryParameters['limit'] = (limit ?? 7).toString(); - queryParameters['widgets[]'] = (widgets ?? const []).map((final e) => e); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/dashboard/api/v2/widget-items').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $sinceIds = jsonSerializers.serialize( + sinceIds, + specifiedType: const FullType(ContentString, [ + FullType(BuiltMap, [FullType(String), FullType(String)]), + ]), + ); + parameters['sinceIds'] = $sinceIds; + + var $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + $limit ??= 7; + parameters['limit'] = $limit; + + var $widgets = jsonSerializers.serialize(widgets, specifiedType: const FullType(BuiltList, [FullType(String)])); + $widgets ??= []; + parameters['widgets%5B%5D'] = $widgets; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/dashboard/api/v2/widget-items{?sinceIds*,limit*,widgets%5B%5D*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', diff --git a/packages/nextcloud/lib/src/api/dav.openapi.dart b/packages/nextcloud/lib/src/api/dav.openapi.dart index cf5c6fd132f..64a752ac022 100644 --- a/packages/nextcloud/lib/src/api/dav.openapi.dart +++ b/packages/nextcloud/lib/src/api/dav.openapi.dart @@ -102,8 +102,7 @@ class DirectClient { final int? expirationTime, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -126,16 +125,18 @@ class DirectClient { } // coverage:ignore-end - queryParameters['fileId'] = fileId.toString(); - if (expirationTime != null) { - queryParameters['expirationTime'] = expirationTime.toString(); - } - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/dav/api/v1/direct').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $fileId = jsonSerializers.serialize(fileId, specifiedType: const FullType(int)); + parameters['fileId'] = $fileId; + + final $expirationTime = jsonSerializers.serialize(expirationTime, specifiedType: const FullType(int)); + parameters['expirationTime'] = $expirationTime; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/dav/api/v1/direct{?fileId*,expirationTime*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', diff --git a/packages/nextcloud/lib/src/api/files.openapi.dart b/packages/nextcloud/lib/src/api/files.openapi.dart index e2b289eb90a..a556c618a17 100644 --- a/packages/nextcloud/lib/src/api/files.openapi.dart +++ b/packages/nextcloud/lib/src/api/files.openapi.dart @@ -111,8 +111,7 @@ class ApiClient { required final int y, required final String file, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': '*/*', }; @@ -135,15 +134,17 @@ class ApiClient { } // coverage:ignore-end - pathParameters['x'] = x.toString(); - pathParameters['y'] = y.toString(); + final $x = jsonSerializers.serialize(x, specifiedType: const FullType(int)); + parameters['x'] = $x; + + final $y = jsonSerializers.serialize(y, specifiedType: const FullType(int)); + parameters['y'] = $y; + dynamite_utils.checkPattern(file, RegExp(r'^.+$'), 'file'); - pathParameters['file'] = file; - var uri = Uri.parse(UriTemplate('/index.php/apps/files/api/v1/thumbnail/{x}/{y}/{file}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $file = jsonSerializers.serialize(file, specifiedType: const FullType(String)); + parameters['file'] = $file; + final uri = Uri.parse(UriTemplate('/index.php/apps/files/api/v1/thumbnail/{x}/{y}/{file}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -202,8 +203,7 @@ class DirectEditingClient { /// * [info] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse infoRaw({final bool? oCSAPIRequest}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -226,12 +226,11 @@ class DirectEditingClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files/api/v1/directEditing').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files/api/v1/directEditing').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -300,8 +299,7 @@ class DirectEditingClient { required final String creatorId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -324,17 +322,19 @@ class DirectEditingClient { } // coverage:ignore-end - pathParameters['editorId'] = editorId; - pathParameters['creatorId'] = creatorId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/files/api/v1/directEditing/templates/{editorId}/{creatorId}') - .expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $editorId = jsonSerializers.serialize(editorId, specifiedType: const FullType(String)); + parameters['editorId'] = $editorId; + final $creatorId = jsonSerializers.serialize(creatorId, specifiedType: const FullType(String)); + parameters['creatorId'] = $creatorId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/files/api/v1/directEditing/templates/{editorId}/{creatorId}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -410,8 +410,7 @@ class DirectEditingClient { final int? fileId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -434,19 +433,22 @@ class DirectEditingClient { } // coverage:ignore-end - queryParameters['path'] = path; - if (editorId != null) { - queryParameters['editorId'] = editorId; - } - if (fileId != null) { - queryParameters['fileId'] = fileId.toString(); - } - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files/api/v1/directEditing/open').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $path = jsonSerializers.serialize(path, specifiedType: const FullType(String)); + parameters['path'] = $path; + final $editorId = jsonSerializers.serialize(editorId, specifiedType: const FullType(String)); + parameters['editorId'] = $editorId; + + final $fileId = jsonSerializers.serialize(fileId, specifiedType: const FullType(int)); + parameters['fileId'] = $fileId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/files/api/v1/directEditing/open{?path*,editorId*,fileId*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -527,8 +529,7 @@ class DirectEditingClient { final String? templateId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -551,18 +552,26 @@ class DirectEditingClient { } // coverage:ignore-end - queryParameters['path'] = path; - queryParameters['editorId'] = editorId; - queryParameters['creatorId'] = creatorId; - if (templateId != null) { - queryParameters['templateId'] = templateId; - } - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files/api/v1/directEditing/create').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $path = jsonSerializers.serialize(path, specifiedType: const FullType(String)); + parameters['path'] = $path; + final $editorId = jsonSerializers.serialize(editorId, specifiedType: const FullType(String)); + parameters['editorId'] = $editorId; + + final $creatorId = jsonSerializers.serialize(creatorId, specifiedType: const FullType(String)); + parameters['creatorId'] = $creatorId; + + final $templateId = jsonSerializers.serialize(templateId, specifiedType: const FullType(String)); + parameters['templateId'] = $templateId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/files/api/v1/directEditing/create{?path*,editorId*,creatorId*,templateId*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -632,8 +641,7 @@ class OpenLocalEditorClient { required final String path, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -656,13 +664,14 @@ class OpenLocalEditorClient { } // coverage:ignore-end - queryParameters['path'] = path; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files/api/v1/openlocaleditor').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $path = jsonSerializers.serialize(path, specifiedType: const FullType(String)); + parameters['path'] = $path; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files/api/v1/openlocaleditor{?path*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -731,8 +740,7 @@ class OpenLocalEditorClient { required final String token, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -755,14 +763,18 @@ class OpenLocalEditorClient { } // coverage:ignore-end - queryParameters['path'] = path; - pathParameters['token'] = token; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files/api/v1/openlocaleditor/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $path = jsonSerializers.serialize(path, specifiedType: const FullType(String)); + parameters['path'] = $path; + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/files/api/v1/openlocaleditor/{token}{?path*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -821,8 +833,7 @@ class TemplateClient { /// * [list] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse listRaw({final bool? oCSAPIRequest}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -845,12 +856,11 @@ class TemplateClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files/api/v1/templates').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files/api/v1/templates').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -924,8 +934,7 @@ class TemplateClient { final String? templateType, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -948,15 +957,25 @@ class TemplateClient { } // coverage:ignore-end - queryParameters['filePath'] = filePath; - queryParameters['templatePath'] = templatePath ?? ''; - queryParameters['templateType'] = templateType ?? 'user'; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files/api/v1/templates/create').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $filePath = jsonSerializers.serialize(filePath, specifiedType: const FullType(String)); + parameters['filePath'] = $filePath; + + var $templatePath = jsonSerializers.serialize(templatePath, specifiedType: const FullType(String)); + $templatePath ??= ''; + parameters['templatePath'] = $templatePath; + + var $templateType = jsonSerializers.serialize(templateType, specifiedType: const FullType(String)); + $templateType ??= 'user'; + parameters['templateType'] = $templateType; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/files/api/v1/templates/create{?filePath*,templatePath*,templateType*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -1025,8 +1044,7 @@ class TemplateClient { final int? copySystemTemplates, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1049,14 +1067,22 @@ class TemplateClient { } // coverage:ignore-end - queryParameters['templatePath'] = templatePath ?? ''; - queryParameters['copySystemTemplates'] = (copySystemTemplates ?? 0).toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files/api/v1/templates/path').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $templatePath = jsonSerializers.serialize(templatePath, specifiedType: const FullType(String)); + $templatePath ??= ''; + parameters['templatePath'] = $templatePath; + var $copySystemTemplates = jsonSerializers.serialize(copySystemTemplates, specifiedType: const FullType(int)); + $copySystemTemplates ??= 0; + parameters['copySystemTemplates'] = $copySystemTemplates; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/files/api/v1/templates/path{?templatePath*,copySystemTemplates*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -1133,8 +1159,7 @@ class TransferOwnershipClient { required final String path, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1157,14 +1182,19 @@ class TransferOwnershipClient { } // coverage:ignore-end - queryParameters['recipient'] = recipient; - queryParameters['path'] = path; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files/api/v1/transferownership').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $recipient = jsonSerializers.serialize(recipient, specifiedType: const FullType(String)); + parameters['recipient'] = $recipient; + + final $path = jsonSerializers.serialize(path, specifiedType: const FullType(String)); + parameters['path'] = $path; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/files/api/v1/transferownership{?recipient*,path*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -1230,8 +1260,7 @@ class TransferOwnershipClient { required final int id, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1254,13 +1283,14 @@ class TransferOwnershipClient { } // coverage:ignore-end - pathParameters['id'] = id.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files/api/v1/transferownership/{id}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + parameters['id'] = $id; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files/api/v1/transferownership/{id}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -1326,8 +1356,7 @@ class TransferOwnershipClient { required final int id, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1350,13 +1379,14 @@ class TransferOwnershipClient { } // coverage:ignore-end - pathParameters['id'] = id.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files/api/v1/transferownership/{id}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + parameters['id'] = $id; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files/api/v1/transferownership/{id}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', diff --git a/packages/nextcloud/lib/src/api/files_external.openapi.dart b/packages/nextcloud/lib/src/api/files_external.openapi.dart index b5eba4ced1e..363da26b3cd 100644 --- a/packages/nextcloud/lib/src/api/files_external.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_external.openapi.dart @@ -86,8 +86,7 @@ class ApiClient { /// * [getUserMounts] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse getUserMountsRaw({final bool? oCSAPIRequest}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -110,12 +109,11 @@ class ApiClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_external/api/v1/mounts').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_external/api/v1/mounts').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', diff --git a/packages/nextcloud/lib/src/api/files_reminders.openapi.dart b/packages/nextcloud/lib/src/api/files_reminders.openapi.dart index 12477fbce62..132e67f2233 100644 --- a/packages/nextcloud/lib/src/api/files_reminders.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_reminders.openapi.dart @@ -100,8 +100,7 @@ class ApiClient { required final int fileId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -125,14 +124,17 @@ class ApiClient { // coverage:ignore-end dynamite_utils.checkPattern(version, RegExp(r'^1$'), 'version'); - pathParameters['version'] = version; - pathParameters['fileId'] = fileId.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_reminders/api/v{version}/{fileId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $version = jsonSerializers.serialize(version, specifiedType: const FullType(String)); + parameters['version'] = $version; + + final $fileId = jsonSerializers.serialize(fileId, specifiedType: const FullType(int)); + parameters['fileId'] = $fileId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_reminders/api/v{version}/{fileId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -212,8 +214,7 @@ class ApiClient { required final int fileId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -236,16 +237,23 @@ class ApiClient { } // coverage:ignore-end - queryParameters['dueDate'] = dueDate; + final $dueDate = jsonSerializers.serialize(dueDate, specifiedType: const FullType(String)); + parameters['dueDate'] = $dueDate; + dynamite_utils.checkPattern(version, RegExp(r'^1$'), 'version'); - pathParameters['version'] = version; - pathParameters['fileId'] = fileId.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_reminders/api/v{version}/{fileId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $version = jsonSerializers.serialize(version, specifiedType: const FullType(String)); + parameters['version'] = $version; + + final $fileId = jsonSerializers.serialize(fileId, specifiedType: const FullType(int)); + parameters['fileId'] = $fileId; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/files_reminders/api/v{version}/{fileId}{?dueDate*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -316,8 +324,7 @@ class ApiClient { required final int fileId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -341,14 +348,17 @@ class ApiClient { // coverage:ignore-end dynamite_utils.checkPattern(version, RegExp(r'^1$'), 'version'); - pathParameters['version'] = version; - pathParameters['fileId'] = fileId.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_reminders/api/v{version}/{fileId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $version = jsonSerializers.serialize(version, specifiedType: const FullType(String)); + parameters['version'] = $version; + + final $fileId = jsonSerializers.serialize(fileId, specifiedType: const FullType(int)); + parameters['fileId'] = $fileId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_reminders/api/v{version}/{fileId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', diff --git a/packages/nextcloud/lib/src/api/files_sharing.openapi.dart b/packages/nextcloud/lib/src/api/files_sharing.openapi.dart index 6291df43029..fd91004ced3 100644 --- a/packages/nextcloud/lib/src/api/files_sharing.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_sharing.openapi.dart @@ -96,8 +96,7 @@ class DeletedShareapiClient { /// * [list] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse listRaw({final bool? oCSAPIRequest}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -120,12 +119,11 @@ class DeletedShareapiClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/deletedshares').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/deletedshares').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -189,8 +187,7 @@ class DeletedShareapiClient { required final String id, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -213,13 +210,14 @@ class DeletedShareapiClient { } // coverage:ignore-end - pathParameters['id'] = id; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/deletedshares/{id}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(String)); + parameters['id'] = $id; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/deletedshares/{id}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -293,8 +291,7 @@ class PublicPreviewClient { required final String token, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': '*/*', }; @@ -315,13 +312,14 @@ class PublicPreviewClient { } // coverage:ignore-end - pathParameters['token'] = token; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/index.php/s/{token}/preview').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/index.php/s/{token}/preview').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -409,8 +407,7 @@ class PublicPreviewClient { final int? a, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': '*/*', }; @@ -431,17 +428,32 @@ class PublicPreviewClient { } // coverage:ignore-end - pathParameters['token'] = token; - queryParameters['file'] = file ?? ''; - queryParameters['x'] = (x ?? 32).toString(); - queryParameters['y'] = (y ?? 32).toString(); - queryParameters['a'] = (a ?? 0).toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/files_sharing/publicpreview/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $file = jsonSerializers.serialize(file, specifiedType: const FullType(String)); + $file ??= ''; + parameters['file'] = $file; + var $x = jsonSerializers.serialize(x, specifiedType: const FullType(int)); + $x ??= 32; + parameters['x'] = $x; + + var $y = jsonSerializers.serialize(y, specifiedType: const FullType(int)); + $y ??= 32; + parameters['y'] = $y; + + var $a = jsonSerializers.serialize(a, specifiedType: const FullType(int)); + $a ??= 0; + parameters['a'] = $a; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/index.php/apps/files_sharing/publicpreview/{token}{?file*,x*,y*,a*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -500,8 +512,7 @@ class RemoteClient { /// * [getShares] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse getSharesRaw({final bool? oCSAPIRequest}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -524,12 +535,11 @@ class RemoteClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/remote_shares').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/remote_shares').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -584,8 +594,7 @@ class RemoteClient { /// * [getOpenShares] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse getOpenSharesRaw({final bool? oCSAPIRequest}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -608,13 +617,12 @@ class RemoteClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -678,8 +686,7 @@ class RemoteClient { required final int id, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -702,15 +709,15 @@ class RemoteClient { } // coverage:ignore-end - pathParameters['id'] = id.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/{id}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + parameters['id'] = $id; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/{id}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -774,8 +781,7 @@ class RemoteClient { required final int id, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -798,15 +804,15 @@ class RemoteClient { } // coverage:ignore-end - pathParameters['id'] = id.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/{id}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + parameters['id'] = $id; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/{id}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -870,8 +876,7 @@ class RemoteClient { required final int id, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -894,13 +899,14 @@ class RemoteClient { } // coverage:ignore-end - pathParameters['id'] = id.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/remote_shares/{id}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + parameters['id'] = $id; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/remote_shares/{id}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -966,8 +972,7 @@ class RemoteClient { required final int id, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -990,13 +995,14 @@ class RemoteClient { } // coverage:ignore-end - pathParameters['id'] = id.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/remote_shares/{id}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + parameters['id'] = $id; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/remote_shares/{id}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -1078,8 +1084,7 @@ class ShareInfoClient { final String? dir, final int? depth, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1100,19 +1105,22 @@ class ShareInfoClient { } // coverage:ignore-end - queryParameters['t'] = t; - if (password != null) { - queryParameters['password'] = password; - } - if (dir != null) { - queryParameters['dir'] = dir; - } - queryParameters['depth'] = (depth ?? -1).toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/files_sharing/shareinfo').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $t = jsonSerializers.serialize(t, specifiedType: const FullType(String)); + parameters['t'] = $t; + + final $password = jsonSerializers.serialize(password, specifiedType: const FullType(String)); + parameters['password'] = $password; + + final $dir = jsonSerializers.serialize(dir, specifiedType: const FullType(String)); + parameters['dir'] = $dir; + + var $depth = jsonSerializers.serialize(depth, specifiedType: const FullType(int)); + $depth ??= -1; + parameters['depth'] = $depth; + final uri = Uri.parse( + UriTemplate('/index.php/apps/files_sharing/shareinfo{?t*,password*,dir*,depth*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -1202,8 +1210,7 @@ class ShareapiClient { final String? includeTags, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1226,17 +1233,35 @@ class ShareapiClient { } // coverage:ignore-end - queryParameters['shared_with_me'] = sharedWithMe ?? 'false'; - queryParameters['reshares'] = reshares ?? 'false'; - queryParameters['subfiles'] = subfiles ?? 'false'; - queryParameters['path'] = path ?? ''; - queryParameters['include_tags'] = includeTags ?? 'false'; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/shares').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + var $sharedWithMe = jsonSerializers.serialize(sharedWithMe, specifiedType: const FullType(String)); + $sharedWithMe ??= 'false'; + parameters['shared_with_me'] = $sharedWithMe; + + var $reshares = jsonSerializers.serialize(reshares, specifiedType: const FullType(String)); + $reshares ??= 'false'; + parameters['reshares'] = $reshares; + + var $subfiles = jsonSerializers.serialize(subfiles, specifiedType: const FullType(String)); + $subfiles ??= 'false'; + parameters['subfiles'] = $subfiles; + + var $path = jsonSerializers.serialize(path, specifiedType: const FullType(String)); + $path ??= ''; + parameters['path'] = $path; + + var $includeTags = jsonSerializers.serialize(includeTags, specifiedType: const FullType(String)); + $includeTags ??= 'false'; + parameters['include_tags'] = $includeTags; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/files_sharing/api/v1/shares{?shared_with_me*,reshares*,subfiles*,path*,include_tags*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -1354,8 +1379,7 @@ class ShareapiClient { final String? attributes, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1378,33 +1402,54 @@ class ShareapiClient { } // coverage:ignore-end - if (path != null) { - queryParameters['path'] = path; - } - if (permissions != null) { - queryParameters['permissions'] = permissions.toString(); - } - queryParameters['shareType'] = (shareType ?? -1).toString(); - if (shareWith != null) { - queryParameters['shareWith'] = shareWith; - } - queryParameters['publicUpload'] = publicUpload ?? 'false'; - queryParameters['password'] = password ?? ''; - if (sendPasswordByTalk != null) { - queryParameters['sendPasswordByTalk'] = sendPasswordByTalk; - } - queryParameters['expireDate'] = expireDate ?? ''; - queryParameters['note'] = note ?? ''; - queryParameters['label'] = label ?? ''; - if (attributes != null) { - queryParameters['attributes'] = attributes; - } - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/shares').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $path = jsonSerializers.serialize(path, specifiedType: const FullType(String)); + parameters['path'] = $path; + + final $permissions = jsonSerializers.serialize(permissions, specifiedType: const FullType(int)); + parameters['permissions'] = $permissions; + + var $shareType = jsonSerializers.serialize(shareType, specifiedType: const FullType(int)); + $shareType ??= -1; + parameters['shareType'] = $shareType; + + final $shareWith = jsonSerializers.serialize(shareWith, specifiedType: const FullType(String)); + parameters['shareWith'] = $shareWith; + + var $publicUpload = jsonSerializers.serialize(publicUpload, specifiedType: const FullType(String)); + $publicUpload ??= 'false'; + parameters['publicUpload'] = $publicUpload; + + var $password = jsonSerializers.serialize(password, specifiedType: const FullType(String)); + $password ??= ''; + parameters['password'] = $password; + + final $sendPasswordByTalk = jsonSerializers.serialize(sendPasswordByTalk, specifiedType: const FullType(String)); + parameters['sendPasswordByTalk'] = $sendPasswordByTalk; + + var $expireDate = jsonSerializers.serialize(expireDate, specifiedType: const FullType(String)); + $expireDate ??= ''; + parameters['expireDate'] = $expireDate; + + var $note = jsonSerializers.serialize(note, specifiedType: const FullType(String)); + $note ??= ''; + parameters['note'] = $note; + + var $label = jsonSerializers.serialize(label, specifiedType: const FullType(String)); + $label ??= ''; + parameters['label'] = $label; + + final $attributes = jsonSerializers.serialize(attributes, specifiedType: const FullType(String)); + parameters['attributes'] = $attributes; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/files_sharing/api/v1/shares{?path*,permissions*,shareType*,shareWith*,publicUpload*,password*,sendPasswordByTalk*,expireDate*,note*,label*,attributes*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -1470,8 +1515,7 @@ class ShareapiClient { required final String path, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1494,13 +1538,15 @@ class ShareapiClient { } // coverage:ignore-end - queryParameters['path'] = path; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/shares/inherited').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $path = jsonSerializers.serialize(path, specifiedType: const FullType(String)); + parameters['path'] = $path; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/shares/inherited{?path*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -1557,8 +1603,7 @@ class ShareapiClient { DynamiteRawResponse pendingSharesRaw({ final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1581,12 +1626,11 @@ class ShareapiClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/shares/pending').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/shares/pending').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -1655,8 +1699,7 @@ class ShareapiClient { final int? includeTags, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1679,14 +1722,19 @@ class ShareapiClient { } // coverage:ignore-end - pathParameters['id'] = id; - queryParameters['include_tags'] = (includeTags ?? 0).toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/shares/{id}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(String)); + parameters['id'] = $id; + + var $includeTags = jsonSerializers.serialize(includeTags, specifiedType: const FullType(int)); + $includeTags ??= 0; + parameters['include_tags'] = $includeTags; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/shares/{id}{?include_tags*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -1799,8 +1847,7 @@ class ShareapiClient { final String? attributes, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1823,40 +1870,45 @@ class ShareapiClient { } // coverage:ignore-end - pathParameters['id'] = id; - if (permissions != null) { - queryParameters['permissions'] = permissions.toString(); - } - if (password != null) { - queryParameters['password'] = password; - } - if (sendPasswordByTalk != null) { - queryParameters['sendPasswordByTalk'] = sendPasswordByTalk; - } - if (publicUpload != null) { - queryParameters['publicUpload'] = publicUpload; - } - if (expireDate != null) { - queryParameters['expireDate'] = expireDate; - } - if (note != null) { - queryParameters['note'] = note; - } - if (label != null) { - queryParameters['label'] = label; - } - if (hideDownload != null) { - queryParameters['hideDownload'] = hideDownload; - } - if (attributes != null) { - queryParameters['attributes'] = attributes; - } - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/shares/{id}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(String)); + parameters['id'] = $id; + + final $permissions = jsonSerializers.serialize(permissions, specifiedType: const FullType(int)); + parameters['permissions'] = $permissions; + + final $password = jsonSerializers.serialize(password, specifiedType: const FullType(String)); + parameters['password'] = $password; + + final $sendPasswordByTalk = jsonSerializers.serialize(sendPasswordByTalk, specifiedType: const FullType(String)); + parameters['sendPasswordByTalk'] = $sendPasswordByTalk; + + final $publicUpload = jsonSerializers.serialize(publicUpload, specifiedType: const FullType(String)); + parameters['publicUpload'] = $publicUpload; + + final $expireDate = jsonSerializers.serialize(expireDate, specifiedType: const FullType(String)); + parameters['expireDate'] = $expireDate; + + final $note = jsonSerializers.serialize(note, specifiedType: const FullType(String)); + parameters['note'] = $note; + + final $label = jsonSerializers.serialize(label, specifiedType: const FullType(String)); + parameters['label'] = $label; + + final $hideDownload = jsonSerializers.serialize(hideDownload, specifiedType: const FullType(String)); + parameters['hideDownload'] = $hideDownload; + + final $attributes = jsonSerializers.serialize(attributes, specifiedType: const FullType(String)); + parameters['attributes'] = $attributes; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/files_sharing/api/v1/shares/{id}{?permissions*,password*,sendPasswordByTalk*,publicUpload*,expireDate*,note*,label*,hideDownload*,attributes*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -1922,8 +1974,7 @@ class ShareapiClient { required final String id, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1946,13 +1997,14 @@ class ShareapiClient { } // coverage:ignore-end - pathParameters['id'] = id; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/shares/{id}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(String)); + parameters['id'] = $id; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/shares/{id}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -2018,8 +2070,7 @@ class ShareapiClient { required final String id, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2042,14 +2093,14 @@ class ShareapiClient { } // coverage:ignore-end - pathParameters['id'] = id; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/shares/pending/{id}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(String)); + parameters['id'] = $id; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/shares/pending/{id}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -2144,8 +2195,7 @@ class ShareesapiClient { final int? lookup, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2168,25 +2218,40 @@ class ShareesapiClient { } // coverage:ignore-end - queryParameters['search'] = search ?? ''; - if (itemType != null) { - queryParameters['itemType'] = itemType; - } - queryParameters['page'] = (page ?? 1).toString(); - queryParameters['perPage'] = (perPage ?? 200).toString(); - if (shareType != null) { - queryParameters['shareType'] = jsonSerializers.serialize( - shareType, - specifiedType: const FullType(ContentString, [FullType(ShareesapiSearchShareType)]), - ); - } - queryParameters['lookup'] = (lookup ?? 0).toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/sharees').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $search = jsonSerializers.serialize(search, specifiedType: const FullType(String)); + $search ??= ''; + parameters['search'] = $search; + + final $itemType = jsonSerializers.serialize(itemType, specifiedType: const FullType(String)); + parameters['itemType'] = $itemType; + + var $page = jsonSerializers.serialize(page, specifiedType: const FullType(int)); + $page ??= 1; + parameters['page'] = $page; + + var $perPage = jsonSerializers.serialize(perPage, specifiedType: const FullType(int)); + $perPage ??= 200; + parameters['perPage'] = $perPage; + final $shareType = jsonSerializers.serialize( + shareType, + specifiedType: const FullType(ContentString, [FullType(ShareesapiSearchShareType)]), + ); + parameters['shareType'] = $shareType; + + var $lookup = jsonSerializers.serialize(lookup, specifiedType: const FullType(int)); + $lookup ??= 0; + parameters['lookup'] = $lookup; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/files_sharing/api/v1/sharees{?search*,itemType*,page*,perPage*,shareType*,lookup*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -2253,8 +2318,7 @@ class ShareesapiClient { final ContentString? shareType, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2277,20 +2341,23 @@ class ShareesapiClient { } // coverage:ignore-end - queryParameters['itemType'] = itemType; - if (shareType != null) { - queryParameters['shareType'] = jsonSerializers.serialize( - shareType, - specifiedType: const FullType(ContentString, [FullType(ShareesapiFindRecommendedShareType)]), - ); - } - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/sharees_recommended').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $itemType = jsonSerializers.serialize(itemType, specifiedType: const FullType(String)); + parameters['itemType'] = $itemType; + + final $shareType = jsonSerializers.serialize( + shareType, + specifiedType: const FullType(ContentString, [FullType(ShareesapiFindRecommendedShareType)]), + ); + parameters['shareType'] = $shareType; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/files_sharing/api/v1/sharees_recommended{?itemType*,shareType*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', diff --git a/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart b/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart index 330ab296038..25b47dc34db 100644 --- a/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart @@ -105,8 +105,7 @@ class PreviewClient { final int? y, final int? a, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': '*/*', }; @@ -129,15 +128,23 @@ class PreviewClient { } // coverage:ignore-end - queryParameters['fileId'] = (fileId ?? -1).toString(); - queryParameters['x'] = (x ?? 32).toString(); - queryParameters['y'] = (y ?? 32).toString(); - queryParameters['a'] = (a ?? 0).toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/files_trashbin/preview').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $fileId = jsonSerializers.serialize(fileId, specifiedType: const FullType(int)); + $fileId ??= -1; + parameters['fileId'] = $fileId; + + var $x = jsonSerializers.serialize(x, specifiedType: const FullType(int)); + $x ??= 32; + parameters['x'] = $x; + + var $y = jsonSerializers.serialize(y, specifiedType: const FullType(int)); + $y ??= 32; + parameters['y'] = $y; + + var $a = jsonSerializers.serialize(a, specifiedType: const FullType(int)); + $a ??= 0; + parameters['a'] = $a; + final uri = Uri.parse(UriTemplate('/index.php/apps/files_trashbin/preview{?fileId*,x*,y*,a*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', diff --git a/packages/nextcloud/lib/src/api/files_versions.openapi.dart b/packages/nextcloud/lib/src/api/files_versions.openapi.dart index 80f76d03a48..8d9ff1f0346 100644 --- a/packages/nextcloud/lib/src/api/files_versions.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_versions.openapi.dart @@ -105,8 +105,7 @@ class PreviewClient { final int? y, final String? version, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': '*/*', }; @@ -129,15 +128,24 @@ class PreviewClient { } // coverage:ignore-end - queryParameters['file'] = file ?? ''; - queryParameters['x'] = (x ?? 44).toString(); - queryParameters['y'] = (y ?? 44).toString(); - queryParameters['version'] = version ?? ''; - var uri = Uri.parse(UriTemplate('/index.php/apps/files_versions/preview').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $file = jsonSerializers.serialize(file, specifiedType: const FullType(String)); + $file ??= ''; + parameters['file'] = $file; + + var $x = jsonSerializers.serialize(x, specifiedType: const FullType(int)); + $x ??= 44; + parameters['x'] = $x; + + var $y = jsonSerializers.serialize(y, specifiedType: const FullType(int)); + $y ??= 44; + parameters['y'] = $y; + + var $version = jsonSerializers.serialize(version, specifiedType: const FullType(String)); + $version ??= ''; + parameters['version'] = $version; + final uri = + Uri.parse(UriTemplate('/index.php/apps/files_versions/preview{?file*,x*,y*,version*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', diff --git a/packages/nextcloud/lib/src/api/news.openapi.dart b/packages/nextcloud/lib/src/api/news.openapi.dart index f1dd8b92e37..ba78b21fead 100644 --- a/packages/nextcloud/lib/src/api/news.openapi.dart +++ b/packages/nextcloud/lib/src/api/news.openapi.dart @@ -64,8 +64,7 @@ class Client extends DynamiteClient { /// * [getSupportedApiVersions] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse getSupportedApiVersionsRaw() { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -88,11 +87,7 @@ class Client extends DynamiteClient { } // coverage:ignore-end - var uri = Uri.parse(UriTemplate('/index.php/apps/news/api').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/index.php/apps/news/api').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'get', @@ -133,8 +128,7 @@ class Client extends DynamiteClient { /// * [listFolders] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse listFoldersRaw() { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -157,11 +151,7 @@ class Client extends DynamiteClient { } // coverage:ignore-end - var uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/folders').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/folders').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'get', @@ -210,8 +200,7 @@ class Client extends DynamiteClient { /// * [createFolder] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse createFolderRaw({required final String name}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -234,12 +223,10 @@ class Client extends DynamiteClient { } // coverage:ignore-end - queryParameters['name'] = name; - var uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/folders').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $name = jsonSerializers.serialize(name, specifiedType: const FullType(String)); + parameters['name'] = $name; + final uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/folders{?name*}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'post', @@ -295,8 +282,7 @@ class Client extends DynamiteClient { required final int folderId, required final String name, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = {}; Uint8List? body; @@ -317,13 +303,13 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['folderId'] = folderId.toString(); - queryParameters['name'] = name; - var uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/folders/{folderId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $folderId = jsonSerializers.serialize(folderId, specifiedType: const FullType(int)); + parameters['folderId'] = $folderId; + + final $name = jsonSerializers.serialize(name, specifiedType: const FullType(String)); + parameters['name'] = $name; + final uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/folders/{folderId}{?name*}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'put', @@ -366,8 +352,7 @@ class Client extends DynamiteClient { /// * [deleteFolder] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse deleteFolderRaw({required final int folderId}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = {}; Uint8List? body; @@ -388,12 +373,10 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['folderId'] = folderId.toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/folders/{folderId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $folderId = jsonSerializers.serialize(folderId, specifiedType: const FullType(int)); + parameters['folderId'] = $folderId; + final uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/folders/{folderId}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'delete', @@ -449,8 +432,7 @@ class Client extends DynamiteClient { required final int folderId, required final int newestItemId, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = {}; Uint8List? body; @@ -471,13 +453,15 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['folderId'] = folderId.toString(); - queryParameters['newestItemId'] = newestItemId.toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/folders/{folderId}/read').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $folderId = jsonSerializers.serialize(folderId, specifiedType: const FullType(int)); + parameters['folderId'] = $folderId; + + final $newestItemId = jsonSerializers.serialize(newestItemId, specifiedType: const FullType(int)); + parameters['newestItemId'] = $newestItemId; + final uri = Uri.parse( + UriTemplate('/index.php/apps/news/api/v1-3/folders/{folderId}/read{?newestItemId*}').expand(parameters), + ); return DynamiteRawResponse( response: executeRequest( 'post', @@ -518,8 +502,7 @@ class Client extends DynamiteClient { /// * [listFeeds] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse listFeedsRaw() { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -542,11 +525,7 @@ class Client extends DynamiteClient { } // coverage:ignore-end - var uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/feeds').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/feeds').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'get', @@ -604,8 +583,7 @@ class Client extends DynamiteClient { required final String url, final int? folderId, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -628,15 +606,13 @@ class Client extends DynamiteClient { } // coverage:ignore-end - queryParameters['url'] = url; - if (folderId != null) { - queryParameters['folderId'] = folderId.toString(); - } - var uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/feeds').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $url = jsonSerializers.serialize(url, specifiedType: const FullType(String)); + parameters['url'] = $url; + final $folderId = jsonSerializers.serialize(folderId, specifiedType: const FullType(int)); + parameters['folderId'] = $folderId; + + final uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/feeds{?url*,folderId*}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'post', @@ -679,8 +655,7 @@ class Client extends DynamiteClient { /// * [deleteFeed] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse deleteFeedRaw({required final int feedId}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = {}; Uint8List? body; @@ -701,12 +676,10 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['feedId'] = feedId.toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/feeds/{feedId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $feedId = jsonSerializers.serialize(feedId, specifiedType: const FullType(int)); + parameters['feedId'] = $feedId; + final uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/feeds/{feedId}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'delete', @@ -762,8 +735,7 @@ class Client extends DynamiteClient { required final int feedId, final int? folderId, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = {}; Uint8List? body; @@ -784,15 +756,14 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['feedId'] = feedId.toString(); - if (folderId != null) { - queryParameters['folderId'] = folderId.toString(); - } - var uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/feeds/{feedId}/move').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $feedId = jsonSerializers.serialize(feedId, specifiedType: const FullType(int)); + parameters['feedId'] = $feedId; + + final $folderId = jsonSerializers.serialize(folderId, specifiedType: const FullType(int)); + parameters['folderId'] = $folderId; + final uri = + Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/feeds/{feedId}/move{?folderId*}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'post', @@ -848,8 +819,7 @@ class Client extends DynamiteClient { required final int feedId, required final String feedTitle, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = {}; Uint8List? body; @@ -870,13 +840,14 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['feedId'] = feedId.toString(); - queryParameters['feedTitle'] = feedTitle; - var uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/feeds/{feedId}/rename').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $feedId = jsonSerializers.serialize(feedId, specifiedType: const FullType(int)); + parameters['feedId'] = $feedId; + + final $feedTitle = jsonSerializers.serialize(feedTitle, specifiedType: const FullType(String)); + parameters['feedTitle'] = $feedTitle; + final uri = + Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/feeds/{feedId}/rename{?feedTitle*}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'post', @@ -932,8 +903,7 @@ class Client extends DynamiteClient { required final int feedId, required final int newestItemId, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = {}; Uint8List? body; @@ -954,13 +924,14 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['feedId'] = feedId.toString(); - queryParameters['newestItemId'] = newestItemId.toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/feeds/{feedId}/read').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $feedId = jsonSerializers.serialize(feedId, specifiedType: const FullType(int)); + parameters['feedId'] = $feedId; + final $newestItemId = jsonSerializers.serialize(newestItemId, specifiedType: const FullType(int)); + parameters['newestItemId'] = $newestItemId; + + final uri = + Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/feeds/{feedId}/read{?newestItemId*}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'post', @@ -1038,8 +1009,7 @@ class Client extends DynamiteClient { final int? offset, final int? oldestFirst, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1062,17 +1032,34 @@ class Client extends DynamiteClient { } // coverage:ignore-end - queryParameters['type'] = (type ?? 3).toString(); - queryParameters['id'] = (id ?? 0).toString(); - queryParameters['getRead'] = (getRead ?? 1).toString(); - queryParameters['batchSize'] = (batchSize ?? -1).toString(); - queryParameters['offset'] = (offset ?? 0).toString(); - queryParameters['oldestFirst'] = (oldestFirst ?? 0).toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/items').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $type = jsonSerializers.serialize(type, specifiedType: const FullType(int)); + $type ??= 3; + parameters['type'] = $type; + + var $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + $id ??= 0; + parameters['id'] = $id; + + var $getRead = jsonSerializers.serialize(getRead, specifiedType: const FullType(int)); + $getRead ??= 1; + parameters['getRead'] = $getRead; + + var $batchSize = jsonSerializers.serialize(batchSize, specifiedType: const FullType(int)); + $batchSize ??= -1; + parameters['batchSize'] = $batchSize; + + var $offset = jsonSerializers.serialize(offset, specifiedType: const FullType(int)); + $offset ??= 0; + parameters['offset'] = $offset; + + var $oldestFirst = jsonSerializers.serialize(oldestFirst, specifiedType: const FullType(int)); + $oldestFirst ??= 0; + parameters['oldestFirst'] = $oldestFirst; + final uri = Uri.parse( + UriTemplate('/index.php/apps/news/api/v1-3/items{?type*,id*,getRead*,batchSize*,offset*,oldestFirst*}') + .expand(parameters), + ); return DynamiteRawResponse( response: executeRequest( 'get', @@ -1135,8 +1122,7 @@ class Client extends DynamiteClient { final int? id, final int? lastModified, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1159,14 +1145,21 @@ class Client extends DynamiteClient { } // coverage:ignore-end - queryParameters['type'] = (type ?? 3).toString(); - queryParameters['id'] = (id ?? 0).toString(); - queryParameters['lastModified'] = (lastModified ?? 0).toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/items/updated').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $type = jsonSerializers.serialize(type, specifiedType: const FullType(int)); + $type ??= 3; + parameters['type'] = $type; + + var $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + $id ??= 0; + parameters['id'] = $id; + var $lastModified = jsonSerializers.serialize(lastModified, specifiedType: const FullType(int)); + $lastModified ??= 0; + parameters['lastModified'] = $lastModified; + + final uri = Uri.parse( + UriTemplate('/index.php/apps/news/api/v1-3/items/updated{?type*,id*,lastModified*}').expand(parameters), + ); return DynamiteRawResponse( response: executeRequest( 'get', @@ -1209,8 +1202,7 @@ class Client extends DynamiteClient { /// * [markArticleAsRead] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse markArticleAsReadRaw({required final int itemId}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = {}; Uint8List? body; @@ -1231,12 +1223,10 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['itemId'] = itemId.toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/items/{itemId}/read').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $itemId = jsonSerializers.serialize(itemId, specifiedType: const FullType(int)); + parameters['itemId'] = $itemId; + final uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/items/{itemId}/read').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'post', @@ -1279,8 +1269,7 @@ class Client extends DynamiteClient { /// * [markArticleAsUnread] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse markArticleAsUnreadRaw({required final int itemId}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = {}; Uint8List? body; @@ -1301,12 +1290,10 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['itemId'] = itemId.toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/items/{itemId}/unread').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $itemId = jsonSerializers.serialize(itemId, specifiedType: const FullType(int)); + parameters['itemId'] = $itemId; + final uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/items/{itemId}/unread').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'post', @@ -1349,8 +1336,7 @@ class Client extends DynamiteClient { /// * [starArticle] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse starArticleRaw({required final int itemId}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = {}; Uint8List? body; @@ -1371,12 +1357,10 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['itemId'] = itemId.toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/items/{itemId}/star').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $itemId = jsonSerializers.serialize(itemId, specifiedType: const FullType(int)); + parameters['itemId'] = $itemId; + final uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/items/{itemId}/star').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'post', @@ -1419,8 +1403,7 @@ class Client extends DynamiteClient { /// * [unstarArticle] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse unstarArticleRaw({required final int itemId}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = {}; Uint8List? body; @@ -1441,12 +1424,10 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['itemId'] = itemId.toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/items/{itemId}/unstar').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $itemId = jsonSerializers.serialize(itemId, specifiedType: const FullType(int)); + parameters['itemId'] = $itemId; + final uri = Uri.parse(UriTemplate('/index.php/apps/news/api/v1-3/items/{itemId}/unstar').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'post', diff --git a/packages/nextcloud/lib/src/api/notes.openapi.dart b/packages/nextcloud/lib/src/api/notes.openapi.dart index 8bbbbbd19f1..1694c96adb0 100644 --- a/packages/nextcloud/lib/src/api/notes.openapi.dart +++ b/packages/nextcloud/lib/src/api/notes.openapi.dart @@ -102,8 +102,7 @@ class Client extends DynamiteClient { final String? chunkCursor, final String? ifNoneMatch, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -126,23 +125,33 @@ class Client extends DynamiteClient { } // coverage:ignore-end - if (category != null) { - queryParameters['category'] = category; - } - queryParameters['exclude'] = exclude ?? ''; - queryParameters['pruneBefore'] = (pruneBefore ?? 0).toString(); - queryParameters['chunkSize'] = (chunkSize ?? 0).toString(); - if (chunkCursor != null) { - queryParameters['chunkCursor'] = chunkCursor; - } - if (ifNoneMatch != null) { - headers['If-None-Match'] = ifNoneMatch; - } - var uri = Uri.parse(UriTemplate('/index.php/apps/notes/api/v1/notes').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); + final $category = jsonSerializers.serialize(category, specifiedType: const FullType(String)); + parameters['category'] = $category; + + var $exclude = jsonSerializers.serialize(exclude, specifiedType: const FullType(String)); + $exclude ??= ''; + parameters['exclude'] = $exclude; + + var $pruneBefore = jsonSerializers.serialize(pruneBefore, specifiedType: const FullType(int)); + $pruneBefore ??= 0; + parameters['pruneBefore'] = $pruneBefore; + + var $chunkSize = jsonSerializers.serialize(chunkSize, specifiedType: const FullType(int)); + $chunkSize ??= 0; + parameters['chunkSize'] = $chunkSize; + + final $chunkCursor = jsonSerializers.serialize(chunkCursor, specifiedType: const FullType(String)); + parameters['chunkCursor'] = $chunkCursor; + + final $ifNoneMatch = jsonSerializers.serialize(ifNoneMatch, specifiedType: const FullType(String)); + if ($ifNoneMatch != null) { + headers['If-None-Match'] = $ifNoneMatch as String; } + final uri = Uri.parse( + UriTemplate('/index.php/apps/notes/api/v1/notes{?category*,exclude*,pruneBefore*,chunkSize*,chunkCursor*}') + .expand(parameters), + ); return DynamiteRawResponse, void>( response: executeRequest( 'get', @@ -215,8 +224,7 @@ class Client extends DynamiteClient { final int? modified, final int? favorite, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -239,16 +247,30 @@ class Client extends DynamiteClient { } // coverage:ignore-end - queryParameters['category'] = category ?? ''; - queryParameters['title'] = title ?? ''; - queryParameters['content'] = content ?? ''; - queryParameters['modified'] = (modified ?? 0).toString(); - queryParameters['favorite'] = (favorite ?? 0).toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/notes/api/v1/notes').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $category = jsonSerializers.serialize(category, specifiedType: const FullType(String)); + $category ??= ''; + parameters['category'] = $category; + + var $title = jsonSerializers.serialize(title, specifiedType: const FullType(String)); + $title ??= ''; + parameters['title'] = $title; + + var $content = jsonSerializers.serialize(content, specifiedType: const FullType(String)); + $content ??= ''; + parameters['content'] = $content; + + var $modified = jsonSerializers.serialize(modified, specifiedType: const FullType(int)); + $modified ??= 0; + parameters['modified'] = $modified; + + var $favorite = jsonSerializers.serialize(favorite, specifiedType: const FullType(int)); + $favorite ??= 0; + parameters['favorite'] = $favorite; + final uri = Uri.parse( + UriTemplate('/index.php/apps/notes/api/v1/notes{?category*,title*,content*,modified*,favorite*}') + .expand(parameters), + ); return DynamiteRawResponse( response: executeRequest( 'post', @@ -309,8 +331,7 @@ class Client extends DynamiteClient { final String? exclude, final String? ifNoneMatch, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -333,16 +354,19 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['id'] = id.toString(); - queryParameters['exclude'] = exclude ?? ''; - if (ifNoneMatch != null) { - headers['If-None-Match'] = ifNoneMatch; - } - var uri = Uri.parse(UriTemplate('/index.php/apps/notes/api/v1/notes/{id}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + parameters['id'] = $id; + + var $exclude = jsonSerializers.serialize(exclude, specifiedType: const FullType(String)); + $exclude ??= ''; + parameters['exclude'] = $exclude; + + final $ifNoneMatch = jsonSerializers.serialize(ifNoneMatch, specifiedType: const FullType(String)); + if ($ifNoneMatch != null) { + headers['If-None-Match'] = $ifNoneMatch as String; } + final uri = Uri.parse(UriTemplate('/index.php/apps/notes/api/v1/notes/{id}{?exclude*}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'get', @@ -423,8 +447,7 @@ class Client extends DynamiteClient { final int? favorite, final String? ifMatch, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -447,30 +470,33 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['id'] = id.toString(); - if (content != null) { - queryParameters['content'] = content; - } - if (modified != null) { - queryParameters['modified'] = modified.toString(); - } - if (title != null) { - queryParameters['title'] = title; - } - if (category != null) { - queryParameters['category'] = category; - } - if (favorite != null) { - queryParameters['favorite'] = favorite.toString(); - } - if (ifMatch != null) { - headers['If-Match'] = ifMatch; - } - var uri = Uri.parse(UriTemplate('/index.php/apps/notes/api/v1/notes/{id}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + parameters['id'] = $id; + + final $content = jsonSerializers.serialize(content, specifiedType: const FullType(String)); + parameters['content'] = $content; + + final $modified = jsonSerializers.serialize(modified, specifiedType: const FullType(int)); + parameters['modified'] = $modified; + + final $title = jsonSerializers.serialize(title, specifiedType: const FullType(String)); + parameters['title'] = $title; + + final $category = jsonSerializers.serialize(category, specifiedType: const FullType(String)); + parameters['category'] = $category; + + final $favorite = jsonSerializers.serialize(favorite, specifiedType: const FullType(int)); + parameters['favorite'] = $favorite; + + final $ifMatch = jsonSerializers.serialize(ifMatch, specifiedType: const FullType(String)); + if ($ifMatch != null) { + headers['If-Match'] = $ifMatch as String; } + final uri = Uri.parse( + UriTemplate('/index.php/apps/notes/api/v1/notes/{id}{?content*,modified*,title*,category*,favorite*}') + .expand(parameters), + ); return DynamiteRawResponse( response: executeRequest( 'put', @@ -513,8 +539,7 @@ class Client extends DynamiteClient { /// * [deleteNote] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse deleteNoteRaw({required final int id}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -537,12 +562,10 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['id'] = id.toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/notes/api/v1/notes/{id}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + parameters['id'] = $id; + final uri = Uri.parse(UriTemplate('/index.php/apps/notes/api/v1/notes/{id}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'delete', @@ -583,8 +606,7 @@ class Client extends DynamiteClient { /// * [getSettings] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse getSettingsRaw() { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -607,11 +629,7 @@ class Client extends DynamiteClient { } // coverage:ignore-end - var uri = Uri.parse(UriTemplate('/index.php/apps/notes/api/v1/settings').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/index.php/apps/notes/api/v1/settings').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'get', @@ -654,8 +672,7 @@ class Client extends DynamiteClient { /// * [updateSettings] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse updateSettingsRaw({required final Settings settings}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -680,11 +697,7 @@ class Client extends DynamiteClient { // coverage:ignore-end headers['Content-Type'] = 'application/json'; body = utf8.encode(json.encode(jsonSerializers.serialize(settings, specifiedType: const FullType(Settings)))); - var uri = Uri.parse(UriTemplate('/index.php/apps/notes/api/v1/settings').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/index.php/apps/notes/api/v1/settings').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'put', diff --git a/packages/nextcloud/lib/src/api/notifications.openapi.dart b/packages/nextcloud/lib/src/api/notifications.openapi.dart index 25b2b121f27..8ef9354fb3e 100644 --- a/packages/nextcloud/lib/src/api/notifications.openapi.dart +++ b/packages/nextcloud/lib/src/api/notifications.openapi.dart @@ -124,8 +124,7 @@ class ApiClient { final ApiGenerateNotificationApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -148,19 +147,30 @@ class ApiClient { } // coverage:ignore-end - queryParameters['shortMessage'] = shortMessage; - pathParameters['userId'] = userId; - queryParameters['longMessage'] = longMessage ?? ''; - pathParameters['apiVersion'] = (apiVersion ?? ApiGenerateNotificationApiVersion.v2).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/notifications/api/{apiVersion}/admin_notifications/{userId}') - .expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $shortMessage = jsonSerializers.serialize(shortMessage, specifiedType: const FullType(String)); + parameters['shortMessage'] = $shortMessage; + + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + + var $longMessage = jsonSerializers.serialize(longMessage, specifiedType: const FullType(String)); + $longMessage ??= ''; + parameters['longMessage'] = $longMessage; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(ApiGenerateNotificationApiVersion)); + $apiVersion ??= 'v2'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/notifications/api/{apiVersion}/admin_notifications/{userId}{?shortMessage*,longMessage*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -232,8 +242,7 @@ class EndpointClient { final EndpointListNotificationsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -256,14 +265,17 @@ class EndpointClient { } // coverage:ignore-end - pathParameters['apiVersion'] = (apiVersion ?? EndpointListNotificationsApiVersion.v2).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/notifications/api/{apiVersion}/notifications').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(EndpointListNotificationsApiVersion)); + $apiVersion ??= 'v2'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/notifications/api/{apiVersion}/notifications').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( @@ -328,8 +340,7 @@ class EndpointClient { final EndpointDeleteAllNotificationsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -352,14 +363,17 @@ class EndpointClient { } // coverage:ignore-end - pathParameters['apiVersion'] = (apiVersion ?? EndpointDeleteAllNotificationsApiVersion.v2).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/notifications/api/{apiVersion}/notifications').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(EndpointDeleteAllNotificationsApiVersion)); + $apiVersion ??= 'v2'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/notifications/api/{apiVersion}/notifications').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -428,8 +442,7 @@ class EndpointClient { final EndpointGetNotificationApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -452,16 +465,21 @@ class EndpointClient { } // coverage:ignore-end - pathParameters['id'] = id.toString(); - pathParameters['apiVersion'] = (apiVersion ?? EndpointGetNotificationApiVersion.v2).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/notifications/api/{apiVersion}/notifications/{id}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + parameters['id'] = $id; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(EndpointGetNotificationApiVersion)); + $apiVersion ??= 'v2'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/notifications/api/{apiVersion}/notifications/{id}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -532,8 +550,7 @@ class EndpointClient { final EndpointDeleteNotificationApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -556,16 +573,21 @@ class EndpointClient { } // coverage:ignore-end - pathParameters['id'] = id.toString(); - pathParameters['apiVersion'] = (apiVersion ?? EndpointDeleteNotificationApiVersion.v2).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/notifications/api/{apiVersion}/notifications/{id}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + parameters['id'] = $id; + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(EndpointDeleteNotificationApiVersion)); + $apiVersion ??= 'v2'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/notifications/api/{apiVersion}/notifications/{id}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -634,8 +656,7 @@ class EndpointClient { final EndpointConfirmIdsForUserApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -658,16 +679,22 @@ class EndpointClient { } // coverage:ignore-end - queryParameters['ids[]'] = ids.map((final e) => e.toString()); - pathParameters['apiVersion'] = (apiVersion ?? EndpointConfirmIdsForUserApiVersion.v2).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/notifications/api/{apiVersion}/notifications/exists').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $ids = jsonSerializers.serialize(ids, specifiedType: const FullType(BuiltList, [FullType(int)])); + parameters['ids%5B%5D'] = $ids; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(EndpointConfirmIdsForUserApiVersion)); + $apiVersion ??= 'v2'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/notifications/api/{apiVersion}/notifications/exists{?ids%5B%5D*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -756,8 +783,7 @@ class PushClient { final PushRegisterDeviceApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -780,16 +806,29 @@ class PushClient { } // coverage:ignore-end - queryParameters['pushTokenHash'] = pushTokenHash; - queryParameters['devicePublicKey'] = devicePublicKey; - queryParameters['proxyServer'] = proxyServer; - pathParameters['apiVersion'] = (apiVersion ?? PushRegisterDeviceApiVersion.v2).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/notifications/api/{apiVersion}/push').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $pushTokenHash = jsonSerializers.serialize(pushTokenHash, specifiedType: const FullType(String)); + parameters['pushTokenHash'] = $pushTokenHash; + + final $devicePublicKey = jsonSerializers.serialize(devicePublicKey, specifiedType: const FullType(String)); + parameters['devicePublicKey'] = $devicePublicKey; + + final $proxyServer = jsonSerializers.serialize(proxyServer, specifiedType: const FullType(String)); + parameters['proxyServer'] = $proxyServer; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(PushRegisterDeviceApiVersion)); + $apiVersion ??= 'v2'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/notifications/api/{apiVersion}/push{?pushTokenHash*,devicePublicKey*,proxyServer*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -857,8 +896,7 @@ class PushClient { final PushRemoveDeviceApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -881,13 +919,15 @@ class PushClient { } // coverage:ignore-end - pathParameters['apiVersion'] = (apiVersion ?? PushRemoveDeviceApiVersion.v2).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/notifications/api/{apiVersion}/push').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(PushRemoveDeviceApiVersion)); + $apiVersion ??= 'v2'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/notifications/api/{apiVersion}/push').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -970,8 +1010,7 @@ class SettingsClient { final SettingsPersonalApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -994,16 +1033,28 @@ class SettingsClient { } // coverage:ignore-end - queryParameters['batchSetting'] = batchSetting.toString(); - queryParameters['soundNotification'] = soundNotification; - queryParameters['soundTalk'] = soundTalk; - pathParameters['apiVersion'] = (apiVersion ?? SettingsPersonalApiVersion.v2).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/notifications/api/{apiVersion}/settings').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $batchSetting = jsonSerializers.serialize(batchSetting, specifiedType: const FullType(int)); + parameters['batchSetting'] = $batchSetting; + + final $soundNotification = jsonSerializers.serialize(soundNotification, specifiedType: const FullType(String)); + parameters['soundNotification'] = $soundNotification; + final $soundTalk = jsonSerializers.serialize(soundTalk, specifiedType: const FullType(String)); + parameters['soundTalk'] = $soundTalk; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(SettingsPersonalApiVersion)); + $apiVersion ??= 'v2'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/notifications/api/{apiVersion}/settings{?batchSetting*,soundNotification*,soundTalk*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -1084,8 +1135,7 @@ class SettingsClient { final SettingsAdminApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1108,18 +1158,28 @@ class SettingsClient { } // coverage:ignore-end - queryParameters['batchSetting'] = batchSetting.toString(); - queryParameters['soundNotification'] = soundNotification; - queryParameters['soundTalk'] = soundTalk; - pathParameters['apiVersion'] = (apiVersion ?? SettingsAdminApiVersion.v2).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/notifications/api/{apiVersion}/settings/admin').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $batchSetting = jsonSerializers.serialize(batchSetting, specifiedType: const FullType(int)); + parameters['batchSetting'] = $batchSetting; + final $soundNotification = jsonSerializers.serialize(soundNotification, specifiedType: const FullType(String)); + parameters['soundNotification'] = $soundNotification; + + final $soundTalk = jsonSerializers.serialize(soundTalk, specifiedType: const FullType(String)); + parameters['soundTalk'] = $soundTalk; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(SettingsAdminApiVersion)); + $apiVersion ??= 'v2'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/notifications/api/{apiVersion}/settings/admin{?batchSetting*,soundNotification*,soundTalk*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', diff --git a/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart b/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart index f12f59852b8..e986690f5e7 100644 --- a/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart +++ b/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart @@ -98,8 +98,7 @@ class AppConfigClient { /// * [getApps] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse getAppsRaw({final bool? oCSAPIRequest}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -122,12 +121,11 @@ class AppConfigClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/provisioning_api/api/v1/config/apps').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/provisioning_api/api/v1/config/apps').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -195,8 +193,7 @@ class AppConfigClient { required final String app, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -219,14 +216,14 @@ class AppConfigClient { } // coverage:ignore-end - pathParameters['app'] = app; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/provisioning_api/api/v1/config/apps/{app}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $app = jsonSerializers.serialize(app, specifiedType: const FullType(String)); + parameters['app'] = $app; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/provisioning_api/api/v1/config/apps/{app}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -304,8 +301,7 @@ class AppConfigClient { final String? defaultValue, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -328,17 +324,24 @@ class AppConfigClient { } // coverage:ignore-end - pathParameters['app'] = app; - pathParameters['key'] = key; - queryParameters['defaultValue'] = defaultValue ?? ''; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/provisioning_api/api/v1/config/apps/{app}/{key}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $app = jsonSerializers.serialize(app, specifiedType: const FullType(String)); + parameters['app'] = $app; + + final $key = jsonSerializers.serialize(key, specifiedType: const FullType(String)); + parameters['key'] = $key; + var $defaultValue = jsonSerializers.serialize(defaultValue, specifiedType: const FullType(String)); + $defaultValue ??= ''; + parameters['defaultValue'] = $defaultValue; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/provisioning_api/api/v1/config/apps/{app}/{key}{?defaultValue*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -412,8 +415,7 @@ class AppConfigClient { required final String key, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -436,17 +438,22 @@ class AppConfigClient { } // coverage:ignore-end - queryParameters['value'] = value; - pathParameters['app'] = app; - pathParameters['key'] = key; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/provisioning_api/api/v1/config/apps/{app}/{key}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $value = jsonSerializers.serialize(value, specifiedType: const FullType(String)); + parameters['value'] = $value; + final $app = jsonSerializers.serialize(app, specifiedType: const FullType(String)); + parameters['app'] = $app; + + final $key = jsonSerializers.serialize(key, specifiedType: const FullType(String)); + parameters['key'] = $key; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/provisioning_api/api/v1/config/apps/{app}/{key}{?value*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -519,8 +526,7 @@ class AppConfigClient { required final String key, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -543,16 +549,18 @@ class AppConfigClient { } // coverage:ignore-end - pathParameters['app'] = app; - pathParameters['key'] = key; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/provisioning_api/api/v1/config/apps/{app}/{key}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $app = jsonSerializers.serialize(app, specifiedType: const FullType(String)); + parameters['app'] = $app; + final $key = jsonSerializers.serialize(key, specifiedType: const FullType(String)); + parameters['key'] = $key; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/provisioning_api/api/v1/config/apps/{app}/{key}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -624,8 +632,7 @@ class AppsClient { final String? filter, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -648,15 +655,14 @@ class AppsClient { } // coverage:ignore-end - if (filter != null) { - queryParameters['filter'] = filter; - } - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/apps').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $filter = jsonSerializers.serialize(filter, specifiedType: const FullType(String)); + parameters['filter'] = $filter; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/apps{?filter*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -722,8 +728,7 @@ class AppsClient { required final String app, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -746,13 +751,14 @@ class AppsClient { } // coverage:ignore-end - pathParameters['app'] = app; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/apps/{app}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $app = jsonSerializers.serialize(app, specifiedType: const FullType(String)); + parameters['app'] = $app; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/apps/{app}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -818,8 +824,7 @@ class AppsClient { required final String app, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -842,13 +847,14 @@ class AppsClient { } // coverage:ignore-end - pathParameters['app'] = app; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/apps/{app}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $app = jsonSerializers.serialize(app, specifiedType: const FullType(String)); + parameters['app'] = $app; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/apps/{app}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -914,8 +920,7 @@ class AppsClient { required final String app, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -938,13 +943,14 @@ class AppsClient { } // coverage:ignore-end - pathParameters['app'] = app; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/apps/{app}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $app = jsonSerializers.serialize(app, specifiedType: const FullType(String)); + parameters['app'] = $app; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/apps/{app}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -1022,8 +1028,7 @@ class GroupsClient { final int? offset, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1046,17 +1051,22 @@ class GroupsClient { } // coverage:ignore-end - queryParameters['search'] = search ?? ''; - if (limit != null) { - queryParameters['limit'] = limit.toString(); - } - queryParameters['offset'] = (offset ?? 0).toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/groups').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $search = jsonSerializers.serialize(search, specifiedType: const FullType(String)); + $search ??= ''; + parameters['search'] = $search; + final $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + parameters['limit'] = $limit; + + var $offset = jsonSerializers.serialize(offset, specifiedType: const FullType(int)); + $offset ??= 0; + parameters['offset'] = $offset; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/groups{?search*,limit*,offset*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -1127,8 +1137,7 @@ class GroupsClient { final String? displayname, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1151,14 +1160,18 @@ class GroupsClient { } // coverage:ignore-end - queryParameters['groupid'] = groupid; - queryParameters['displayname'] = displayname ?? ''; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/groups').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $groupid = jsonSerializers.serialize(groupid, specifiedType: const FullType(String)); + parameters['groupid'] = $groupid; + + var $displayname = jsonSerializers.serialize(displayname, specifiedType: const FullType(String)); + $displayname ??= ''; + parameters['displayname'] = $displayname; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/groups{?groupid*,displayname*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -1230,8 +1243,7 @@ class GroupsClient { final int? offset, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1254,17 +1266,22 @@ class GroupsClient { } // coverage:ignore-end - queryParameters['search'] = search ?? ''; - if (limit != null) { - queryParameters['limit'] = limit.toString(); - } - queryParameters['offset'] = (offset ?? 0).toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/groups/details').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $search = jsonSerializers.serialize(search, specifiedType: const FullType(String)); + $search ??= ''; + parameters['search'] = $search; + + final $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + parameters['limit'] = $limit; + var $offset = jsonSerializers.serialize(offset, specifiedType: const FullType(int)); + $offset ??= 0; + parameters['offset'] = $offset; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/groups/details{?search*,limit*,offset*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -1330,8 +1347,7 @@ class GroupsClient { required final String groupId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1355,13 +1371,14 @@ class GroupsClient { // coverage:ignore-end dynamite_utils.checkPattern(groupId, RegExp(r'^.+$'), 'groupId'); - pathParameters['groupId'] = groupId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/groups/{groupId}/users').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $groupId = jsonSerializers.serialize(groupId, specifiedType: const FullType(String)); + parameters['groupId'] = $groupId; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/groups/{groupId}/users').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -1438,8 +1455,7 @@ class GroupsClient { final int? offset, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1463,18 +1479,27 @@ class GroupsClient { // coverage:ignore-end dynamite_utils.checkPattern(groupId, RegExp(r'^.+$'), 'groupId'); - pathParameters['groupId'] = groupId; - queryParameters['search'] = search ?? ''; - if (limit != null) { - queryParameters['limit'] = limit.toString(); - } - queryParameters['offset'] = (offset ?? 0).toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/groups/{groupId}/users/details').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $groupId = jsonSerializers.serialize(groupId, specifiedType: const FullType(String)); + parameters['groupId'] = $groupId; + + var $search = jsonSerializers.serialize(search, specifiedType: const FullType(String)); + $search ??= ''; + parameters['search'] = $search; + + final $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + parameters['limit'] = $limit; + + var $offset = jsonSerializers.serialize(offset, specifiedType: const FullType(int)); + $offset ??= 0; + parameters['offset'] = $offset; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/cloud/groups/{groupId}/users/details{?search*,limit*,offset*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -1540,8 +1565,7 @@ class GroupsClient { required final String groupId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1565,13 +1589,14 @@ class GroupsClient { // coverage:ignore-end dynamite_utils.checkPattern(groupId, RegExp(r'^.+$'), 'groupId'); - pathParameters['groupId'] = groupId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/groups/{groupId}/subadmins').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $groupId = jsonSerializers.serialize(groupId, specifiedType: const FullType(String)); + parameters['groupId'] = $groupId; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/groups/{groupId}/subadmins').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -1635,8 +1660,7 @@ class GroupsClient { required final String groupId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1660,13 +1684,14 @@ class GroupsClient { // coverage:ignore-end dynamite_utils.checkPattern(groupId, RegExp(r'^.+$'), 'groupId'); - pathParameters['groupId'] = groupId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/groups/{groupId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $groupId = jsonSerializers.serialize(groupId, specifiedType: const FullType(String)); + parameters['groupId'] = $groupId; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/groups/{groupId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -1742,8 +1767,7 @@ class GroupsClient { required final String groupId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1766,16 +1790,21 @@ class GroupsClient { } // coverage:ignore-end - queryParameters['key'] = key; - queryParameters['value'] = value; + final $key = jsonSerializers.serialize(key, specifiedType: const FullType(String)); + parameters['key'] = $key; + + final $value = jsonSerializers.serialize(value, specifiedType: const FullType(String)); + parameters['value'] = $value; + dynamite_utils.checkPattern(groupId, RegExp(r'^.+$'), 'groupId'); - pathParameters['groupId'] = groupId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/groups/{groupId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $groupId = jsonSerializers.serialize(groupId, specifiedType: const FullType(String)); + parameters['groupId'] = $groupId; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/groups/{groupId}{?key*,value*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -1841,8 +1870,7 @@ class GroupsClient { required final String groupId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1866,13 +1894,14 @@ class GroupsClient { // coverage:ignore-end dynamite_utils.checkPattern(groupId, RegExp(r'^.+$'), 'groupId'); - pathParameters['groupId'] = groupId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/groups/{groupId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $groupId = jsonSerializers.serialize(groupId, specifiedType: const FullType(String)); + parameters['groupId'] = $groupId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/groups/{groupId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -1952,8 +1981,7 @@ class PreferencesClient { required final String configKey, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1976,17 +2004,23 @@ class PreferencesClient { } // coverage:ignore-end - queryParameters['configValue'] = configValue; - pathParameters['appId'] = appId; - pathParameters['configKey'] = configKey; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}/{configKey}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $configValue = jsonSerializers.serialize(configValue, specifiedType: const FullType(String)); + parameters['configValue'] = $configValue; + + final $appId = jsonSerializers.serialize(appId, specifiedType: const FullType(String)); + parameters['appId'] = $appId; + final $configKey = jsonSerializers.serialize(configKey, specifiedType: const FullType(String)); + parameters['configKey'] = $configKey; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}/{configKey}{?configValue*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -2055,8 +2089,7 @@ class PreferencesClient { required final String configKey, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2079,16 +2112,19 @@ class PreferencesClient { } // coverage:ignore-end - pathParameters['appId'] = appId; - pathParameters['configKey'] = configKey; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}/{configKey}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $appId = jsonSerializers.serialize(appId, specifiedType: const FullType(String)); + parameters['appId'] = $appId; + final $configKey = jsonSerializers.serialize(configKey, specifiedType: const FullType(String)); + parameters['configKey'] = $configKey; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}/{configKey}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -2157,8 +2193,7 @@ class PreferencesClient { required final String appId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2181,20 +2216,24 @@ class PreferencesClient { } // coverage:ignore-end - queryParameters['configs'] = jsonSerializers.serialize( + final $configs = jsonSerializers.serialize( configs, specifiedType: const FullType(ContentString, [ FullType(BuiltMap, [FullType(String), FullType(String)]), ]), ); - pathParameters['appId'] = appId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + parameters['configs'] = $configs; + + final $appId = jsonSerializers.serialize(appId, specifiedType: const FullType(String)); + parameters['appId'] = $appId; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}{?configs*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -2263,8 +2302,7 @@ class PreferencesClient { required final String appId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2287,15 +2325,21 @@ class PreferencesClient { } // coverage:ignore-end - queryParameters['configKeys[]'] = configKeys.map((final e) => e); - pathParameters['appId'] = appId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $configKeys = + jsonSerializers.serialize(configKeys, specifiedType: const FullType(BuiltList, [FullType(String)])); + parameters['configKeys%5B%5D'] = $configKeys; + + final $appId = jsonSerializers.serialize(appId, specifiedType: const FullType(String)); + parameters['appId'] = $appId; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}{?configKeys%5B%5D*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -2373,8 +2417,7 @@ class UsersClient { final int? offset, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2397,17 +2440,22 @@ class UsersClient { } // coverage:ignore-end - queryParameters['search'] = search ?? ''; - if (limit != null) { - queryParameters['limit'] = limit.toString(); - } - queryParameters['offset'] = (offset ?? 0).toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $search = jsonSerializers.serialize(search, specifiedType: const FullType(String)); + $search ??= ''; + parameters['search'] = $search; + + final $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + parameters['limit'] = $limit; + var $offset = jsonSerializers.serialize(offset, specifiedType: const FullType(int)); + $offset ??= 0; + parameters['offset'] = $offset; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users{?search*,limit*,offset*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -2511,8 +2559,7 @@ class UsersClient { final String? manager, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2535,23 +2582,49 @@ class UsersClient { } // coverage:ignore-end - queryParameters['userid'] = userid; - queryParameters['password'] = password ?? ''; - queryParameters['displayName'] = displayName ?? ''; - queryParameters['email'] = email ?? ''; - queryParameters['groups[]'] = (groups ?? const []).map((final e) => e); - queryParameters['subadmin[]'] = (subadmin ?? const []).map((final e) => e); - queryParameters['quota'] = quota ?? ''; - queryParameters['language'] = language ?? ''; - if (manager != null) { - queryParameters['manager'] = manager; - } - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $userid = jsonSerializers.serialize(userid, specifiedType: const FullType(String)); + parameters['userid'] = $userid; + + var $password = jsonSerializers.serialize(password, specifiedType: const FullType(String)); + $password ??= ''; + parameters['password'] = $password; + + var $displayName = jsonSerializers.serialize(displayName, specifiedType: const FullType(String)); + $displayName ??= ''; + parameters['displayName'] = $displayName; + + var $email = jsonSerializers.serialize(email, specifiedType: const FullType(String)); + $email ??= ''; + parameters['email'] = $email; + + var $groups = jsonSerializers.serialize(groups, specifiedType: const FullType(BuiltList, [FullType(String)])); + $groups ??= []; + parameters['groups%5B%5D'] = $groups; + + var $subadmin = jsonSerializers.serialize(subadmin, specifiedType: const FullType(BuiltList, [FullType(String)])); + $subadmin ??= []; + parameters['subadmin%5B%5D'] = $subadmin; + + var $quota = jsonSerializers.serialize(quota, specifiedType: const FullType(String)); + $quota ??= ''; + parameters['quota'] = $quota; + + var $language = jsonSerializers.serialize(language, specifiedType: const FullType(String)); + $language ??= ''; + parameters['language'] = $language; + + final $manager = jsonSerializers.serialize(manager, specifiedType: const FullType(String)); + parameters['manager'] = $manager; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/cloud/users{?userid*,password*,displayName*,email*,groups%5B%5D*,subadmin%5B%5D*,quota*,language*,manager*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -2623,8 +2696,7 @@ class UsersClient { final int? offset, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2647,17 +2719,22 @@ class UsersClient { } // coverage:ignore-end - queryParameters['search'] = search ?? ''; - if (limit != null) { - queryParameters['limit'] = limit.toString(); - } - queryParameters['offset'] = (offset ?? 0).toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/details').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $search = jsonSerializers.serialize(search, specifiedType: const FullType(String)); + $search ??= ''; + parameters['search'] = $search; + + final $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + parameters['limit'] = $limit; + + var $offset = jsonSerializers.serialize(offset, specifiedType: const FullType(int)); + $offset ??= 0; + parameters['offset'] = $offset; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/details{?search*,limit*,offset*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -2724,8 +2801,7 @@ class UsersClient { final int? offset, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2748,16 +2824,18 @@ class UsersClient { } // coverage:ignore-end - if (limit != null) { - queryParameters['limit'] = limit.toString(); - } - queryParameters['offset'] = (offset ?? 0).toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/disabled').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + parameters['limit'] = $limit; + + var $offset = jsonSerializers.serialize(offset, specifiedType: const FullType(int)); + $offset ??= 0; + parameters['offset'] = $offset; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/disabled{?limit*,offset*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -2826,8 +2904,7 @@ class UsersClient { required final ContentString>> search, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2850,8 +2927,10 @@ class UsersClient { } // coverage:ignore-end - queryParameters['location'] = location; - queryParameters['search'] = jsonSerializers.serialize( + final $location = jsonSerializers.serialize(location, specifiedType: const FullType(String)); + parameters['location'] = $location; + + final $search = jsonSerializers.serialize( search, specifiedType: const FullType(ContentString, [ FullType(BuiltMap, [ @@ -2860,12 +2939,14 @@ class UsersClient { ]), ]), ); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/search/by-phone').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + parameters['search'] = $search; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/search/by-phone{?location*,search*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -2927,8 +3008,7 @@ class UsersClient { required final String userId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2951,13 +3031,14 @@ class UsersClient { } // coverage:ignore-end - pathParameters['userId'] = userId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -3029,8 +3110,7 @@ class UsersClient { required final String userId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3053,15 +3133,20 @@ class UsersClient { } // coverage:ignore-end - queryParameters['key'] = key; - queryParameters['value'] = value; - pathParameters['userId'] = userId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $key = jsonSerializers.serialize(key, specifiedType: const FullType(String)); + parameters['key'] = $key; + + final $value = jsonSerializers.serialize(value, specifiedType: const FullType(String)); + parameters['value'] = $value; + + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}{?key*,value*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -3123,8 +3208,7 @@ class UsersClient { required final String userId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3147,13 +3231,14 @@ class UsersClient { } // coverage:ignore-end - pathParameters['userId'] = userId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -3208,8 +3293,7 @@ class UsersClient { /// * [getCurrentUser] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse getCurrentUserRaw({final bool? oCSAPIRequest}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3232,12 +3316,11 @@ class UsersClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/user').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/user').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -3294,8 +3377,7 @@ class UsersClient { DynamiteRawResponse getEditableFieldsRaw({ final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3318,12 +3400,11 @@ class UsersClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/user/fields').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/user/fields').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -3385,8 +3466,7 @@ class UsersClient { required final String userId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3409,13 +3489,14 @@ class UsersClient { } // coverage:ignore-end - pathParameters['userId'] = userId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/user/fields/{userId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/user/fields/{userId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -3492,8 +3573,7 @@ class UsersClient { required final String collectionName, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3516,17 +3596,25 @@ class UsersClient { } // coverage:ignore-end - queryParameters['key'] = key; - queryParameters['value'] = value; - pathParameters['userId'] = userId; + final $key = jsonSerializers.serialize(key, specifiedType: const FullType(String)); + parameters['key'] = $key; + + final $value = jsonSerializers.serialize(value, specifiedType: const FullType(String)); + parameters['value'] = $value; + + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + dynamite_utils.checkPattern(collectionName, RegExp(r'^(?!enable$|disable$)[a-zA-Z0-9_]*$'), 'collectionName'); - pathParameters['collectionName'] = collectionName; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/{collectionName}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $collectionName = jsonSerializers.serialize(collectionName, specifiedType: const FullType(String)); + parameters['collectionName'] = $collectionName; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/{collectionName}{?key*,value*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -3588,8 +3676,7 @@ class UsersClient { required final String userId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3612,13 +3699,14 @@ class UsersClient { } // coverage:ignore-end - pathParameters['userId'] = userId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/wipe').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/wipe').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -3680,8 +3768,7 @@ class UsersClient { required final String userId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3704,13 +3791,14 @@ class UsersClient { } // coverage:ignore-end - pathParameters['userId'] = userId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/enable').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/enable').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -3772,8 +3860,7 @@ class UsersClient { required final String userId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3796,13 +3883,14 @@ class UsersClient { } // coverage:ignore-end - pathParameters['userId'] = userId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/disable').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/disable').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -3864,8 +3952,7 @@ class UsersClient { required final String userId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3888,13 +3975,14 @@ class UsersClient { } // coverage:ignore-end - pathParameters['userId'] = userId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/groups').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/groups').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -3961,8 +4049,7 @@ class UsersClient { final String? groupid, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3985,14 +4072,18 @@ class UsersClient { } // coverage:ignore-end - pathParameters['userId'] = userId; - queryParameters['groupid'] = groupid ?? ''; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/groups').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + + var $groupid = jsonSerializers.serialize(groupid, specifiedType: const FullType(String)); + $groupid ??= ''; + parameters['groupid'] = $groupid; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/groups{?groupid*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -4059,8 +4150,7 @@ class UsersClient { required final String userId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4083,14 +4173,17 @@ class UsersClient { } // coverage:ignore-end - queryParameters['groupid'] = groupid; - pathParameters['userId'] = userId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/groups').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $groupid = jsonSerializers.serialize(groupid, specifiedType: const FullType(String)); + parameters['groupid'] = $groupid; + + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/groups{?groupid*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -4156,8 +4249,7 @@ class UsersClient { required final String userId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4180,13 +4272,14 @@ class UsersClient { } // coverage:ignore-end - pathParameters['userId'] = userId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/subadmins').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/subadmins').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -4257,8 +4350,7 @@ class UsersClient { required final String userId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4281,14 +4373,17 @@ class UsersClient { } // coverage:ignore-end - queryParameters['groupid'] = groupid; - pathParameters['userId'] = userId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/subadmins').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $groupid = jsonSerializers.serialize(groupid, specifiedType: const FullType(String)); + parameters['groupid'] = $groupid; + + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/subadmins{?groupid*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -4359,8 +4454,7 @@ class UsersClient { required final String userId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4383,14 +4477,17 @@ class UsersClient { } // coverage:ignore-end - queryParameters['groupid'] = groupid; - pathParameters['userId'] = userId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/subadmins').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $groupid = jsonSerializers.serialize(groupid, specifiedType: const FullType(String)); + parameters['groupid'] = $groupid; + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/subadmins{?groupid*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -4452,8 +4549,7 @@ class UsersClient { required final String userId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4476,13 +4572,14 @@ class UsersClient { } // coverage:ignore-end - pathParameters['userId'] = userId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/welcome').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/cloud/users/{userId}/welcome').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', diff --git a/packages/nextcloud/lib/src/api/settings.openapi.dart b/packages/nextcloud/lib/src/api/settings.openapi.dart index d9f21040b5b..a373e6b83fc 100644 --- a/packages/nextcloud/lib/src/api/settings.openapi.dart +++ b/packages/nextcloud/lib/src/api/settings.openapi.dart @@ -78,8 +78,7 @@ class LogSettingsClient { /// * [download] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse downloadRaw() { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/octet-stream', }; @@ -102,11 +101,7 @@ class LogSettingsClient { } // coverage:ignore-end - var uri = Uri.parse(UriTemplate('/index.php/settings/admin/log/download').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/index.php/settings/admin/log/download').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', diff --git a/packages/nextcloud/lib/src/api/spreed.openapi.dart b/packages/nextcloud/lib/src/api/spreed.openapi.dart index 2a260e6b7f1..e5bbe2a4432 100644 --- a/packages/nextcloud/lib/src/api/spreed.openapi.dart +++ b/packages/nextcloud/lib/src/api/spreed.openapi.dart @@ -143,8 +143,7 @@ class AvatarClient { final AvatarGetAvatarApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': '*/*', }; @@ -166,16 +165,24 @@ class AvatarClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - queryParameters['darkTheme'] = (darkTheme ?? 0).toString(); - pathParameters['apiVersion'] = (apiVersion ?? AvatarGetAvatarApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/avatar').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $darkTheme = jsonSerializers.serialize(darkTheme, specifiedType: const FullType(int)); + $darkTheme ??= 0; + parameters['darkTheme'] = $darkTheme; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(AvatarGetAvatarApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/avatar{?darkTheme*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -244,8 +251,7 @@ class AvatarClient { final AvatarUploadAvatarApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -267,15 +273,20 @@ class AvatarClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? AvatarUploadAvatarApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/avatar').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(AvatarUploadAvatarApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/avatar').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -342,8 +353,7 @@ class AvatarClient { final AvatarDeleteAvatarApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -365,15 +375,20 @@ class AvatarClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? AvatarDeleteAvatarApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/avatar').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(AvatarDeleteAvatarApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/avatar').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -452,8 +467,7 @@ class AvatarClient { final AvatarEmojiAvatarApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -474,21 +488,28 @@ class AvatarClient { } // coverage:ignore-end - queryParameters['emoji'] = emoji; + final $emoji = jsonSerializers.serialize(emoji, specifiedType: const FullType(String)); + parameters['emoji'] = $emoji; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - if (color != null) { - queryParameters['color'] = color; - } - pathParameters['apiVersion'] = (apiVersion ?? AvatarEmojiAvatarApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/avatar/emoji').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + final $color = jsonSerializers.serialize(color, specifiedType: const FullType(String)); + parameters['color'] = $color; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(AvatarEmojiAvatarApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/avatar/emoji{?emoji*,color*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -555,8 +576,7 @@ class AvatarClient { final AvatarGetAvatarDarkApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': '*/*', }; @@ -578,16 +598,20 @@ class AvatarClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? AvatarGetAvatarDarkApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/avatar/dark').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(AvatarGetAvatarDarkApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/avatar/dark').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -690,8 +714,7 @@ class BotClient { final BotSendMessageApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -712,20 +735,38 @@ class BotClient { } // coverage:ignore-end - queryParameters['message'] = message; + final $message = jsonSerializers.serialize(message, specifiedType: const FullType(String)); + parameters['message'] = $message; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - queryParameters['referenceId'] = referenceId ?? ''; - queryParameters['replyTo'] = (replyTo ?? 0).toString(); - queryParameters['silent'] = (silent ?? 0).toString(); - pathParameters['apiVersion'] = (apiVersion ?? BotSendMessageApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/{token}/message').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $referenceId = jsonSerializers.serialize(referenceId, specifiedType: const FullType(String)); + $referenceId ??= ''; + parameters['referenceId'] = $referenceId; + var $replyTo = jsonSerializers.serialize(replyTo, specifiedType: const FullType(int)); + $replyTo ??= 0; + parameters['replyTo'] = $replyTo; + + var $silent = jsonSerializers.serialize(silent, specifiedType: const FullType(int)); + $silent ??= 0; + parameters['silent'] = $silent; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(BotSendMessageApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/{token}/message{?message*,referenceId*,replyTo*,silent*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -810,8 +851,7 @@ class BotClient { final BotReactApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -832,19 +872,28 @@ class BotClient { } // coverage:ignore-end - queryParameters['reaction'] = reaction; + final $reaction = jsonSerializers.serialize(reaction, specifiedType: const FullType(String)); + parameters['reaction'] = $reaction; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['messageId'] = messageId.toString(); - pathParameters['apiVersion'] = (apiVersion ?? BotReactApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/{token}/reaction/{messageId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $messageId = jsonSerializers.serialize(messageId, specifiedType: const FullType(int)); + parameters['messageId'] = $messageId; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(BotReactApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/{token}/reaction/{messageId}{?reaction*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -927,8 +976,7 @@ class BotClient { final BotDeleteReactionApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -949,19 +997,28 @@ class BotClient { } // coverage:ignore-end - queryParameters['reaction'] = reaction; + final $reaction = jsonSerializers.serialize(reaction, specifiedType: const FullType(String)); + parameters['reaction'] = $reaction; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['messageId'] = messageId.toString(); - pathParameters['apiVersion'] = (apiVersion ?? BotDeleteReactionApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/{token}/reaction/{messageId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $messageId = jsonSerializers.serialize(messageId, specifiedType: const FullType(int)); + parameters['messageId'] = $messageId; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(BotDeleteReactionApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/{token}/reaction/{messageId}{?reaction*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -1027,8 +1084,7 @@ class BotClient { final BotAdminListBotsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1051,13 +1107,15 @@ class BotClient { } // coverage:ignore-end - pathParameters['apiVersion'] = (apiVersion ?? BotAdminListBotsApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/admin').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(BotAdminListBotsApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/admin').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -1124,8 +1182,7 @@ class BotClient { final BotListBotsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1149,14 +1206,18 @@ class BotClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? BotListBotsApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(BotListBotsApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/{token}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -1232,8 +1293,7 @@ class BotClient { final BotEnableBotApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1257,16 +1317,22 @@ class BotClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['botId'] = botId.toString(); - pathParameters['apiVersion'] = (apiVersion ?? BotEnableBotApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/{token}/{botId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $botId = jsonSerializers.serialize(botId, specifiedType: const FullType(int)); + parameters['botId'] = $botId; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(BotEnableBotApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/{token}/{botId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -1340,8 +1406,7 @@ class BotClient { final BotDisableBotApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1365,16 +1430,22 @@ class BotClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['botId'] = botId.toString(); - pathParameters['apiVersion'] = (apiVersion ?? BotDisableBotApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/{token}/{botId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $botId = jsonSerializers.serialize(botId, specifiedType: const FullType(int)); + parameters['botId'] = $botId; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(BotDisableBotApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/{token}/{botId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -1464,8 +1535,7 @@ class BreakoutRoomClient { final BreakoutRoomConfigureBreakoutRoomsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1488,20 +1558,35 @@ class BreakoutRoomClient { } // coverage:ignore-end - queryParameters['mode'] = mode.toString(); - queryParameters['amount'] = amount.toString(); + final $mode = jsonSerializers.serialize(mode, specifiedType: const FullType(int)); + parameters['mode'] = $mode; + + final $amount = jsonSerializers.serialize(amount, specifiedType: const FullType(int)); + parameters['amount'] = $amount; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - queryParameters['attendeeMap'] = attendeeMap ?? '[]'; - pathParameters['apiVersion'] = (apiVersion ?? BreakoutRoomConfigureBreakoutRoomsApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/breakout-rooms/{token}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $attendeeMap = jsonSerializers.serialize(attendeeMap, specifiedType: const FullType(String)); + $attendeeMap ??= '[]'; + parameters['attendeeMap'] = $attendeeMap; + + var $apiVersion = jsonSerializers.serialize( + apiVersion, + specifiedType: const FullType(BreakoutRoomConfigureBreakoutRoomsApiVersion), + ); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/breakout-rooms/{token}{?mode*,amount*,attendeeMap*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -1568,8 +1653,7 @@ class BreakoutRoomClient { final BreakoutRoomRemoveBreakoutRoomsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1593,16 +1677,20 @@ class BreakoutRoomClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? BreakoutRoomRemoveBreakoutRoomsApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/breakout-rooms/{token}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(BreakoutRoomRemoveBreakoutRoomsApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/breakout-rooms/{token}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -1678,8 +1766,7 @@ class BreakoutRoomClient { final BreakoutRoomBroadcastChatMessageApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1702,18 +1789,28 @@ class BreakoutRoomClient { } // coverage:ignore-end - queryParameters['message'] = message; + final $message = jsonSerializers.serialize(message, specifiedType: const FullType(String)); + parameters['message'] = $message; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? BreakoutRoomBroadcastChatMessageApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/breakout-rooms/{token}/broadcast').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = jsonSerializers.serialize( + apiVersion, + specifiedType: const FullType(BreakoutRoomBroadcastChatMessageApiVersion), + ); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/breakout-rooms/{token}/broadcast{?message*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -1787,8 +1884,7 @@ class BreakoutRoomClient { final BreakoutRoomApplyAttendeeMapApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1811,18 +1907,26 @@ class BreakoutRoomClient { } // coverage:ignore-end - queryParameters['attendeeMap'] = attendeeMap; + final $attendeeMap = jsonSerializers.serialize(attendeeMap, specifiedType: const FullType(String)); + parameters['attendeeMap'] = $attendeeMap; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? BreakoutRoomApplyAttendeeMapApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/breakout-rooms/{token}/attendees').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(BreakoutRoomApplyAttendeeMapApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/breakout-rooms/{token}/attendees{?attendeeMap*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -1891,8 +1995,7 @@ class BreakoutRoomClient { final BreakoutRoomRequestAssistanceApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1916,17 +2019,22 @@ class BreakoutRoomClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? BreakoutRoomRequestAssistanceApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(BreakoutRoomRequestAssistanceApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/breakout-rooms/{token}/request-assistance') - .expand(pathParameters), + .expand(parameters), ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -1996,8 +2104,7 @@ class BreakoutRoomClient { final BreakoutRoomResetRequestForAssistanceApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2021,17 +2128,24 @@ class BreakoutRoomClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? BreakoutRoomResetRequestForAssistanceApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/breakout-rooms/{token}/request-assistance') - .expand(pathParameters), + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = jsonSerializers.serialize( + apiVersion, + specifiedType: const FullType(BreakoutRoomResetRequestForAssistanceApiVersion), ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/breakout-rooms/{token}/request-assistance') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -2100,8 +2214,7 @@ class BreakoutRoomClient { final BreakoutRoomStartBreakoutRoomsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2125,16 +2238,21 @@ class BreakoutRoomClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? BreakoutRoomStartBreakoutRoomsApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/breakout-rooms/{token}/rooms').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(BreakoutRoomStartBreakoutRoomsApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/breakout-rooms/{token}/rooms').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -2203,8 +2321,7 @@ class BreakoutRoomClient { final BreakoutRoomStopBreakoutRoomsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2228,16 +2345,21 @@ class BreakoutRoomClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? BreakoutRoomStopBreakoutRoomsApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/breakout-rooms/{token}/rooms').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(BreakoutRoomStopBreakoutRoomsApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/breakout-rooms/{token}/rooms').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -2311,8 +2433,7 @@ class BreakoutRoomClient { final BreakoutRoomSwitchBreakoutRoomApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2335,18 +2456,26 @@ class BreakoutRoomClient { } // coverage:ignore-end - queryParameters['target'] = target; + final $target = jsonSerializers.serialize(target, specifiedType: const FullType(String)); + parameters['target'] = $target; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? BreakoutRoomSwitchBreakoutRoomApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/breakout-rooms/{token}/switch').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(BreakoutRoomSwitchBreakoutRoomApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/breakout-rooms/{token}/switch{?target*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -2419,8 +2548,7 @@ class CallClient { final CallGetPeersForCallApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2442,14 +2570,19 @@ class CallClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? CallGetPeersForCallApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/call/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(CallGetPeersForCallApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/call/{token}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -2525,8 +2658,7 @@ class CallClient { final CallUpdateCallFlagsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2547,16 +2679,24 @@ class CallClient { } // coverage:ignore-end - queryParameters['flags'] = flags.toString(); + final $flags = jsonSerializers.serialize(flags, specifiedType: const FullType(int)); + parameters['flags'] = $flags; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? CallUpdateCallFlagsApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/call/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(CallUpdateCallFlagsApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/call/{token}{?flags*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -2647,8 +2787,7 @@ class CallClient { final CallJoinCallApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2670,22 +2809,36 @@ class CallClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - if (flags != null) { - queryParameters['flags'] = flags.toString(); - } - if (forcePermissions != null) { - queryParameters['forcePermissions'] = forcePermissions.toString(); - } - queryParameters['silent'] = (silent ?? 0).toString(); - queryParameters['recordingConsent'] = (recordingConsent ?? 0).toString(); - pathParameters['apiVersion'] = (apiVersion ?? CallJoinCallApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/call/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $flags = jsonSerializers.serialize(flags, specifiedType: const FullType(int)); + parameters['flags'] = $flags; + + final $forcePermissions = jsonSerializers.serialize(forcePermissions, specifiedType: const FullType(int)); + parameters['forcePermissions'] = $forcePermissions; + + var $silent = jsonSerializers.serialize(silent, specifiedType: const FullType(int)); + $silent ??= 0; + parameters['silent'] = $silent; + + var $recordingConsent = jsonSerializers.serialize(recordingConsent, specifiedType: const FullType(int)); + $recordingConsent ??= 0; + parameters['recordingConsent'] = $recordingConsent; + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(CallJoinCallApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/spreed/api/{apiVersion}/call/{token}{?flags*,forcePermissions*,silent*,recordingConsent*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -2759,8 +2912,7 @@ class CallClient { final CallLeaveCallApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2782,15 +2934,23 @@ class CallClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - queryParameters['all'] = (all ?? 0).toString(); - pathParameters['apiVersion'] = (apiVersion ?? CallLeaveCallApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/call/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $all = jsonSerializers.serialize(all, specifiedType: const FullType(int)); + $all ??= 0; + parameters['all'] = $all; + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(CallLeaveCallApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/call/{token}{?all*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -2864,8 +3024,7 @@ class CallClient { final CallRingAttendeeApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2887,17 +3046,23 @@ class CallClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['attendeeId'] = attendeeId.toString(); - pathParameters['apiVersion'] = (apiVersion ?? CallRingAttendeeApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/call/{token}/ring/{attendeeId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $attendeeId = jsonSerializers.serialize(attendeeId, specifiedType: const FullType(int)); + parameters['attendeeId'] = $attendeeId; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(CallRingAttendeeApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/call/{token}/ring/{attendeeId}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -2975,8 +3140,7 @@ class CallClient { final CallSipDialOutApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -2998,17 +3162,23 @@ class CallClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['attendeeId'] = attendeeId.toString(); - pathParameters['apiVersion'] = (apiVersion ?? CallSipDialOutApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/call/{token}/dialout/{attendeeId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $attendeeId = jsonSerializers.serialize(attendeeId, specifiedType: const FullType(int)); + parameters['attendeeId'] = $attendeeId; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(CallSipDialOutApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/call/{token}/dialout/{attendeeId}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -3087,8 +3257,7 @@ class CertificateClient { final CertificateGetCertificateExpirationApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3111,16 +3280,23 @@ class CertificateClient { } // coverage:ignore-end - queryParameters['host'] = host; - pathParameters['apiVersion'] = (apiVersion ?? CertificateGetCertificateExpirationApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/certificate/expiration').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $host = jsonSerializers.serialize(host, specifiedType: const FullType(String)); + parameters['host'] = $host; + + var $apiVersion = jsonSerializers.serialize( + apiVersion, + specifiedType: const FullType(CertificateGetCertificateExpirationApiVersion), + ); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/certificate/expiration{?host*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -3248,8 +3424,7 @@ class ChatClient { final ChatReceiveMessagesApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3270,24 +3445,60 @@ class ChatClient { } // coverage:ignore-end - queryParameters['lookIntoFuture'] = lookIntoFuture.toString(); + final $lookIntoFuture = jsonSerializers.serialize(lookIntoFuture, specifiedType: const FullType(int)); + parameters['lookIntoFuture'] = $lookIntoFuture; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - queryParameters['limit'] = (limit ?? 100).toString(); - queryParameters['lastKnownMessageId'] = (lastKnownMessageId ?? 0).toString(); - queryParameters['lastCommonReadId'] = (lastCommonReadId ?? 0).toString(); - queryParameters['timeout'] = (timeout ?? 30).toString(); - queryParameters['setReadMarker'] = (setReadMarker ?? 1).toString(); - queryParameters['includeLastKnown'] = (includeLastKnown ?? 0).toString(); - queryParameters['noStatusUpdate'] = (noStatusUpdate ?? 0).toString(); - queryParameters['markNotificationsAsRead'] = (markNotificationsAsRead ?? 1).toString(); - pathParameters['apiVersion'] = (apiVersion ?? ChatReceiveMessagesApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + $limit ??= 100; + parameters['limit'] = $limit; + var $lastKnownMessageId = jsonSerializers.serialize(lastKnownMessageId, specifiedType: const FullType(int)); + $lastKnownMessageId ??= 0; + parameters['lastKnownMessageId'] = $lastKnownMessageId; + + var $lastCommonReadId = jsonSerializers.serialize(lastCommonReadId, specifiedType: const FullType(int)); + $lastCommonReadId ??= 0; + parameters['lastCommonReadId'] = $lastCommonReadId; + + var $timeout = jsonSerializers.serialize(timeout, specifiedType: const FullType(int)); + $timeout ??= 30; + parameters['timeout'] = $timeout; + + var $setReadMarker = jsonSerializers.serialize(setReadMarker, specifiedType: const FullType(int)); + $setReadMarker ??= 1; + parameters['setReadMarker'] = $setReadMarker; + + var $includeLastKnown = jsonSerializers.serialize(includeLastKnown, specifiedType: const FullType(int)); + $includeLastKnown ??= 0; + parameters['includeLastKnown'] = $includeLastKnown; + + var $noStatusUpdate = jsonSerializers.serialize(noStatusUpdate, specifiedType: const FullType(int)); + $noStatusUpdate ??= 0; + parameters['noStatusUpdate'] = $noStatusUpdate; + + var $markNotificationsAsRead = + jsonSerializers.serialize(markNotificationsAsRead, specifiedType: const FullType(int)); + $markNotificationsAsRead ??= 1; + parameters['markNotificationsAsRead'] = $markNotificationsAsRead; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(ChatReceiveMessagesApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}{?lookIntoFuture*,limit*,lastKnownMessageId*,lastCommonReadId*,timeout*,setReadMarker*,includeLastKnown*,noStatusUpdate*,markNotificationsAsRead*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -3389,8 +3600,7 @@ class ChatClient { final ChatSendMessageApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3411,20 +3621,42 @@ class ChatClient { } // coverage:ignore-end - queryParameters['message'] = message; + final $message = jsonSerializers.serialize(message, specifiedType: const FullType(String)); + parameters['message'] = $message; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - queryParameters['actorDisplayName'] = actorDisplayName ?? ''; - queryParameters['referenceId'] = referenceId ?? ''; - queryParameters['replyTo'] = (replyTo ?? 0).toString(); - queryParameters['silent'] = (silent ?? 0).toString(); - pathParameters['apiVersion'] = (apiVersion ?? ChatSendMessageApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $actorDisplayName = jsonSerializers.serialize(actorDisplayName, specifiedType: const FullType(String)); + $actorDisplayName ??= ''; + parameters['actorDisplayName'] = $actorDisplayName; + + var $referenceId = jsonSerializers.serialize(referenceId, specifiedType: const FullType(String)); + $referenceId ??= ''; + parameters['referenceId'] = $referenceId; + + var $replyTo = jsonSerializers.serialize(replyTo, specifiedType: const FullType(int)); + $replyTo ??= 0; + parameters['replyTo'] = $replyTo; + var $silent = jsonSerializers.serialize(silent, specifiedType: const FullType(int)); + $silent ??= 0; + parameters['silent'] = $silent; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(ChatSendMessageApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}{?message*,actorDisplayName*,referenceId*,replyTo*,silent*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -3495,8 +3727,7 @@ class ChatClient { final ChatClearHistoryApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3520,14 +3751,18 @@ class ChatClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? ChatClearHistoryApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(ChatClearHistoryApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -3609,8 +3844,7 @@ class ChatClient { final ChatDeleteMessageApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3634,17 +3868,22 @@ class ChatClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['messageId'] = messageId.toString(); - pathParameters['apiVersion'] = (apiVersion ?? ChatDeleteMessageApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/{messageId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $messageId = jsonSerializers.serialize(messageId, specifiedType: const FullType(int)); + parameters['messageId'] = $messageId; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(ChatDeleteMessageApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/{messageId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -3725,8 +3964,7 @@ class ChatClient { final ChatGetMessageContextApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3748,18 +3986,29 @@ class ChatClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['messageId'] = messageId.toString(); - queryParameters['limit'] = (limit ?? 50).toString(); - pathParameters['apiVersion'] = (apiVersion ?? ChatGetMessageContextApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/{messageId}/context').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $messageId = jsonSerializers.serialize(messageId, specifiedType: const FullType(int)); + parameters['messageId'] = $messageId; + + var $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + $limit ??= 50; + parameters['limit'] = $limit; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(ChatGetMessageContextApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/{messageId}/context{?limit*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -3833,8 +4082,7 @@ class ChatClient { final ChatGetReminderApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3858,17 +4106,23 @@ class ChatClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['messageId'] = messageId.toString(); - pathParameters['apiVersion'] = (apiVersion ?? ChatGetReminderApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/{messageId}/reminder').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $messageId = jsonSerializers.serialize(messageId, specifiedType: const FullType(int)); + parameters['messageId'] = $messageId; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(ChatGetReminderApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/{messageId}/reminder').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -3947,8 +4201,7 @@ class ChatClient { final ChatSetReminderApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -3971,19 +4224,28 @@ class ChatClient { } // coverage:ignore-end - queryParameters['timestamp'] = timestamp.toString(); + final $timestamp = jsonSerializers.serialize(timestamp, specifiedType: const FullType(int)); + parameters['timestamp'] = $timestamp; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['messageId'] = messageId.toString(); - pathParameters['apiVersion'] = (apiVersion ?? ChatSetReminderApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/{messageId}/reminder').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $messageId = jsonSerializers.serialize(messageId, specifiedType: const FullType(int)); + parameters['messageId'] = $messageId; + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(ChatSetReminderApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/{messageId}/reminder{?timestamp*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -4057,8 +4319,7 @@ class ChatClient { final ChatDeleteReminderApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4082,17 +4343,24 @@ class ChatClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['messageId'] = messageId.toString(); - pathParameters['apiVersion'] = (apiVersion ?? ChatDeleteReminderApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/{messageId}/reminder').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $messageId = jsonSerializers.serialize(messageId, specifiedType: const FullType(int)); + parameters['messageId'] = $messageId; + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(ChatDeleteReminderApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/{messageId}/reminder').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -4164,8 +4432,7 @@ class ChatClient { final ChatSetReadMarkerApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4188,17 +4455,24 @@ class ChatClient { } // coverage:ignore-end - queryParameters['lastReadMessage'] = lastReadMessage.toString(); + final $lastReadMessage = jsonSerializers.serialize(lastReadMessage, specifiedType: const FullType(int)); + parameters['lastReadMessage'] = $lastReadMessage; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? ChatSetReadMarkerApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/read').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(ChatSetReadMarkerApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/read{?lastReadMessage*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -4265,8 +4539,7 @@ class ChatClient { final ChatMarkUnreadApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4290,15 +4563,18 @@ class ChatClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? ChatMarkUnreadApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/read').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(ChatMarkUnreadApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/read').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -4380,8 +4656,7 @@ class ChatClient { final ChatMentionsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4402,20 +4677,33 @@ class ChatClient { } // coverage:ignore-end - queryParameters['search'] = search; + final $search = jsonSerializers.serialize(search, specifiedType: const FullType(String)); + parameters['search'] = $search; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - queryParameters['limit'] = (limit ?? 20).toString(); - queryParameters['includeStatus'] = (includeStatus ?? 0).toString(); - pathParameters['apiVersion'] = (apiVersion ?? ChatMentionsApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/mentions').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + $limit ??= 20; + parameters['limit'] = $limit; + + var $includeStatus = jsonSerializers.serialize(includeStatus, specifiedType: const FullType(int)); + $includeStatus ??= 0; + parameters['includeStatus'] = $includeStatus; + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(ChatMentionsApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/mentions{?search*,limit*,includeStatus*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -4499,8 +4787,7 @@ class ChatClient { final ChatGetObjectsSharedInRoomApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4521,19 +4808,35 @@ class ChatClient { } // coverage:ignore-end - queryParameters['objectType'] = objectType; + final $objectType = jsonSerializers.serialize(objectType, specifiedType: const FullType(String)); + parameters['objectType'] = $objectType; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - queryParameters['lastKnownMessageId'] = (lastKnownMessageId ?? 0).toString(); - queryParameters['limit'] = (limit ?? 100).toString(); - pathParameters['apiVersion'] = (apiVersion ?? ChatGetObjectsSharedInRoomApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/share').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + var $lastKnownMessageId = jsonSerializers.serialize(lastKnownMessageId, specifiedType: const FullType(int)); + $lastKnownMessageId ??= 0; + parameters['lastKnownMessageId'] = $lastKnownMessageId; + + var $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + $limit ??= 100; + parameters['limit'] = $limit; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(ChatGetObjectsSharedInRoomApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/share{?objectType*,lastKnownMessageId*,limit*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( @@ -4638,8 +4941,7 @@ class ChatClient { final ChatShareObjectToChatApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4660,21 +4962,42 @@ class ChatClient { } // coverage:ignore-end - queryParameters['objectType'] = objectType; - queryParameters['objectId'] = objectId; + final $objectType = jsonSerializers.serialize(objectType, specifiedType: const FullType(String)); + parameters['objectType'] = $objectType; + + final $objectId = jsonSerializers.serialize(objectId, specifiedType: const FullType(String)); + parameters['objectId'] = $objectId; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - queryParameters['metaData'] = metaData ?? ''; - queryParameters['actorDisplayName'] = actorDisplayName ?? ''; - queryParameters['referenceId'] = referenceId ?? ''; - pathParameters['apiVersion'] = (apiVersion ?? ChatShareObjectToChatApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/share').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $metaData = jsonSerializers.serialize(metaData, specifiedType: const FullType(String)); + $metaData ??= ''; + parameters['metaData'] = $metaData; + + var $actorDisplayName = jsonSerializers.serialize(actorDisplayName, specifiedType: const FullType(String)); + $actorDisplayName ??= ''; + parameters['actorDisplayName'] = $actorDisplayName; + var $referenceId = jsonSerializers.serialize(referenceId, specifiedType: const FullType(String)); + $referenceId ??= ''; + parameters['referenceId'] = $referenceId; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(ChatShareObjectToChatApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/share{?objectType*,objectId*,metaData*,actorDisplayName*,referenceId*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -4748,8 +5071,7 @@ class ChatClient { final ChatGetObjectsSharedInRoomOverviewApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4771,17 +5093,27 @@ class ChatClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - queryParameters['limit'] = (limit ?? 7).toString(); - pathParameters['apiVersion'] = (apiVersion ?? ChatGetObjectsSharedInRoomOverviewApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/share/overview').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + var $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + $limit ??= 7; + parameters['limit'] = $limit; + + var $apiVersion = jsonSerializers.serialize( + apiVersion, + specifiedType: const FullType(ChatGetObjectsSharedInRoomOverviewApiVersion), + ); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/share/overview{?limit*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -4856,8 +5188,7 @@ class FederationClient { final FederationAcceptShareApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4880,16 +5211,21 @@ class FederationClient { } // coverage:ignore-end - pathParameters['id'] = id.toString(); - pathParameters['apiVersion'] = (apiVersion ?? FederationAcceptShareApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/federation/invitation/{id}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + parameters['id'] = $id; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(FederationAcceptShareApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/federation/invitation/{id}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -4958,8 +5294,7 @@ class FederationClient { final FederationRejectShareApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -4982,16 +5317,21 @@ class FederationClient { } // coverage:ignore-end - pathParameters['id'] = id.toString(); - pathParameters['apiVersion'] = (apiVersion ?? FederationRejectShareApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/federation/invitation/{id}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int)); + parameters['id'] = $id; + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(FederationRejectShareApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/federation/invitation/{id}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -5053,8 +5393,7 @@ class FederationClient { final FederationGetSharesApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -5077,15 +5416,17 @@ class FederationClient { } // coverage:ignore-end - pathParameters['apiVersion'] = (apiVersion ?? FederationGetSharesApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/federation/invitation').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(FederationGetSharesApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/federation/invitation').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -5170,8 +5511,7 @@ class FilesIntegrationClient { final FilesIntegrationGetRoomByFileIdApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -5195,14 +5535,19 @@ class FilesIntegrationClient { // coverage:ignore-end dynamite_utils.checkPattern(fileId, RegExp(r'^.+$'), 'fileId'); - pathParameters['fileId'] = fileId; - pathParameters['apiVersion'] = (apiVersion ?? FilesIntegrationGetRoomByFileIdApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/file/{fileId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $fileId = jsonSerializers.serialize(fileId, specifiedType: const FullType(String)); + parameters['fileId'] = $fileId; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(FilesIntegrationGetRoomByFileIdApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/file/{fileId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -5283,8 +5628,7 @@ class FilesIntegrationClient { final FilesIntegrationGetRoomByShareTokenApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -5306,16 +5650,22 @@ class FilesIntegrationClient { // coverage:ignore-end dynamite_utils.checkPattern(shareToken, RegExp(r'^.+$'), 'shareToken'); - pathParameters['shareToken'] = shareToken; - pathParameters['apiVersion'] = (apiVersion ?? FilesIntegrationGetRoomByShareTokenApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/publicshare/{shareToken}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $shareToken = jsonSerializers.serialize(shareToken, specifiedType: const FullType(String)); + parameters['shareToken'] = $shareToken; + var $apiVersion = jsonSerializers.serialize( + apiVersion, + specifiedType: const FullType(FilesIntegrationGetRoomByShareTokenApiVersion), + ); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/publicshare/{shareToken}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -5397,8 +5747,7 @@ class GuestClient { final GuestSetDisplayNameApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -5419,17 +5768,25 @@ class GuestClient { } // coverage:ignore-end - queryParameters['displayName'] = displayName; + final $displayName = jsonSerializers.serialize(displayName, specifiedType: const FullType(String)); + parameters['displayName'] = $displayName; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? GuestSetDisplayNameApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/guest/{token}/name').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(GuestSetDisplayNameApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/guest/{token}/name{?displayName*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -5530,8 +5887,7 @@ class HostedSignalingServerClient { final HostedSignalingServerRequestTrialApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -5554,20 +5910,37 @@ class HostedSignalingServerClient { } // coverage:ignore-end - queryParameters['url'] = url; - queryParameters['name'] = name; - queryParameters['email'] = email; - queryParameters['language'] = language; - queryParameters['country'] = country; - pathParameters['apiVersion'] = (apiVersion ?? HostedSignalingServerRequestTrialApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/hostedsignalingserver/requesttrial').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $url = jsonSerializers.serialize(url, specifiedType: const FullType(String)); + parameters['url'] = $url; + + final $name = jsonSerializers.serialize(name, specifiedType: const FullType(String)); + parameters['name'] = $name; + final $email = jsonSerializers.serialize(email, specifiedType: const FullType(String)); + parameters['email'] = $email; + + final $language = jsonSerializers.serialize(language, specifiedType: const FullType(String)); + parameters['language'] = $language; + + final $country = jsonSerializers.serialize(country, specifiedType: const FullType(String)); + parameters['country'] = $country; + + var $apiVersion = jsonSerializers.serialize( + apiVersion, + specifiedType: const FullType(HostedSignalingServerRequestTrialApiVersion), + ); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/spreed/api/{apiVersion}/hostedsignalingserver/requesttrial{?url*,name*,email*,language*,country*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -5637,8 +6010,7 @@ class HostedSignalingServerClient { final HostedSignalingServerDeleteAccountApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -5661,15 +6033,20 @@ class HostedSignalingServerClient { } // coverage:ignore-end - pathParameters['apiVersion'] = (apiVersion ?? HostedSignalingServerDeleteAccountApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/hostedsignalingserver/delete').expand(pathParameters), + var $apiVersion = jsonSerializers.serialize( + apiVersion, + specifiedType: const FullType(HostedSignalingServerDeleteAccountApiVersion), ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/hostedsignalingserver/delete').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -5742,8 +6119,7 @@ class MatterbridgeClient { final MatterbridgeGetBridgeOfRoomApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -5767,14 +6143,19 @@ class MatterbridgeClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? MatterbridgeGetBridgeOfRoomApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bridge/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(MatterbridgeGetBridgeOfRoomApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bridge/{token}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -5853,8 +6234,7 @@ class MatterbridgeClient { final MatterbridgeEditBridgeOfRoomApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -5877,26 +6257,35 @@ class MatterbridgeClient { } // coverage:ignore-end - queryParameters['enabled'] = enabled.toString(); + final $enabled = jsonSerializers.serialize(enabled, specifiedType: const FullType(int)); + parameters['enabled'] = $enabled; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - if (parts != null) { - queryParameters['parts'] = jsonSerializers.serialize( - parts, - specifiedType: const FullType(ContentString, [ - FullType(BuiltList, [ - FullType(BuiltMap, [FullType(String), FullType(JsonObject)]), - ]), + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $parts = jsonSerializers.serialize( + parts, + specifiedType: const FullType(ContentString, [ + FullType(BuiltList, [ + FullType(BuiltMap, [FullType(String), FullType(JsonObject)]), ]), - ); - } - pathParameters['apiVersion'] = (apiVersion ?? MatterbridgeEditBridgeOfRoomApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bridge/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + ]), + ); + parameters['parts'] = $parts; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(MatterbridgeEditBridgeOfRoomApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bridge/{token}{?enabled*,parts*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -5965,8 +6354,7 @@ class MatterbridgeClient { final MatterbridgeDeleteBridgeOfRoomApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -5990,14 +6378,19 @@ class MatterbridgeClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? MatterbridgeDeleteBridgeOfRoomApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bridge/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(MatterbridgeDeleteBridgeOfRoomApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bridge/{token}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -6064,8 +6457,7 @@ class MatterbridgeClient { final MatterbridgeGetBridgeProcessStateApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -6089,16 +6481,22 @@ class MatterbridgeClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? MatterbridgeGetBridgeProcessStateApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bridge/{token}/process').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + var $apiVersion = jsonSerializers.serialize( + apiVersion, + specifiedType: const FullType(MatterbridgeGetBridgeProcessStateApiVersion), + ); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bridge/{token}/process').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -6172,8 +6570,7 @@ class MatterbridgeSettingsClient { final MatterbridgeSettingsStopAllBridgesApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -6196,13 +6593,18 @@ class MatterbridgeSettingsClient { } // coverage:ignore-end - pathParameters['apiVersion'] = (apiVersion ?? MatterbridgeSettingsStopAllBridgesApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bridge').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $apiVersion = jsonSerializers.serialize( + apiVersion, + specifiedType: const FullType(MatterbridgeSettingsStopAllBridgesApiVersion), + ); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bridge').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -6272,8 +6674,7 @@ class MatterbridgeSettingsClient { final MatterbridgeSettingsGetMatterbridgeVersionApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -6296,13 +6697,18 @@ class MatterbridgeSettingsClient { } // coverage:ignore-end - pathParameters['apiVersion'] = (apiVersion ?? MatterbridgeSettingsGetMatterbridgeVersionApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bridge/version').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $apiVersion = jsonSerializers.serialize( + apiVersion, + specifiedType: const FullType(MatterbridgeSettingsGetMatterbridgeVersionApiVersion), + ); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/bridge/version').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -6397,8 +6803,7 @@ class PollClient { final PollCreatePollApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -6419,19 +6824,35 @@ class PollClient { } // coverage:ignore-end - queryParameters['question'] = question; - queryParameters['options[]'] = options.map((final e) => e); - queryParameters['resultMode'] = resultMode.toString(); - queryParameters['maxVotes'] = maxVotes.toString(); + final $question = jsonSerializers.serialize(question, specifiedType: const FullType(String)); + parameters['question'] = $question; + + final $options = jsonSerializers.serialize(options, specifiedType: const FullType(BuiltList, [FullType(String)])); + parameters['options%5B%5D'] = $options; + + final $resultMode = jsonSerializers.serialize(resultMode, specifiedType: const FullType(int)); + parameters['resultMode'] = $resultMode; + + final $maxVotes = jsonSerializers.serialize(maxVotes, specifiedType: const FullType(int)); + parameters['maxVotes'] = $maxVotes; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? PollCreatePollApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/poll/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(PollCreatePollApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/spreed/api/{apiVersion}/poll/{token}{?question*,options%5B%5D*,resultMode*,maxVotes*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -6505,8 +6926,7 @@ class PollClient { final PollShowPollApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -6528,17 +6948,22 @@ class PollClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['pollId'] = pollId.toString(); - pathParameters['apiVersion'] = (apiVersion ?? PollShowPollApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/poll/{token}/{pollId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $pollId = jsonSerializers.serialize(pollId, specifiedType: const FullType(int)); + parameters['pollId'] = $pollId; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(PollShowPollApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/poll/{token}/{pollId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -6619,8 +7044,7 @@ class PollClient { final PollVotePollApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -6642,18 +7066,28 @@ class PollClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['pollId'] = pollId.toString(); - queryParameters['optionIds[]'] = (optionIds ?? const []).map((final e) => e.toString()); - pathParameters['apiVersion'] = (apiVersion ?? PollVotePollApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/poll/{token}/{pollId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $pollId = jsonSerializers.serialize(pollId, specifiedType: const FullType(int)); + parameters['pollId'] = $pollId; + + var $optionIds = jsonSerializers.serialize(optionIds, specifiedType: const FullType(BuiltList, [FullType(int)])); + $optionIds ??= []; + parameters['optionIds%5B%5D'] = $optionIds; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(PollVotePollApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/poll/{token}/{pollId}{?optionIds%5B%5D*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -6733,8 +7167,7 @@ class PollClient { final PollClosePollApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -6756,17 +7189,22 @@ class PollClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['pollId'] = pollId.toString(); - pathParameters['apiVersion'] = (apiVersion ?? PollClosePollApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/poll/{token}/{pollId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $pollId = jsonSerializers.serialize(pollId, specifiedType: const FullType(int)); + parameters['pollId'] = $pollId; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(PollClosePollApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/poll/{token}/{pollId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -6847,8 +7285,7 @@ class PublicShareAuthClient { final PublicShareAuthCreateRoomApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -6869,14 +7306,21 @@ class PublicShareAuthClient { } // coverage:ignore-end - queryParameters['shareToken'] = shareToken; - pathParameters['apiVersion'] = (apiVersion ?? PublicShareAuthCreateRoomApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/publicshareauth').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $shareToken = jsonSerializers.serialize(shareToken, specifiedType: const FullType(String)); + parameters['shareToken'] = $shareToken; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(PublicShareAuthCreateRoomApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/publicshareauth{?shareToken*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -6961,8 +7405,7 @@ class ReactionClient { final ReactionGetReactionsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -6982,22 +7425,30 @@ class ReactionClient { ); } -// coverage:ignore-end - dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['messageId'] = messageId.toString(); - if (reaction != null) { - queryParameters['reaction'] = reaction; - } - pathParameters['apiVersion'] = (apiVersion ?? ReactionGetReactionsApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/reaction/{token}/{messageId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } +// coverage:ignore-end + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $messageId = jsonSerializers.serialize(messageId, specifiedType: const FullType(int)); + parameters['messageId'] = $messageId; + + final $reaction = jsonSerializers.serialize(reaction, specifiedType: const FullType(String)); + parameters['reaction'] = $reaction; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(ReactionGetReactionsApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/reaction/{token}/{messageId}{?reaction*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -7080,8 +7531,7 @@ class ReactionClient { final ReactionReactApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -7102,19 +7552,28 @@ class ReactionClient { } // coverage:ignore-end - queryParameters['reaction'] = reaction; + final $reaction = jsonSerializers.serialize(reaction, specifiedType: const FullType(String)); + parameters['reaction'] = $reaction; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['messageId'] = messageId.toString(); - pathParameters['apiVersion'] = (apiVersion ?? ReactionReactApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/reaction/{token}/{messageId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $messageId = jsonSerializers.serialize(messageId, specifiedType: const FullType(int)); + parameters['messageId'] = $messageId; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(ReactionReactApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/reaction/{token}/{messageId}{?reaction*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -7195,8 +7654,7 @@ class ReactionClient { final ReactionDeleteApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -7217,19 +7675,28 @@ class ReactionClient { } // coverage:ignore-end - queryParameters['reaction'] = reaction; + final $reaction = jsonSerializers.serialize(reaction, specifiedType: const FullType(String)); + parameters['reaction'] = $reaction; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['messageId'] = messageId.toString(); - pathParameters['apiVersion'] = (apiVersion ?? ReactionDeleteApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/reaction/{token}/{messageId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $messageId = jsonSerializers.serialize(messageId, specifiedType: const FullType(int)); + parameters['messageId'] = $messageId; + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(ReactionDeleteApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/reaction/{token}/{messageId}{?reaction*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -7310,8 +7777,7 @@ class RecordingClient { final RecordingGetWelcomeMessageApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -7334,16 +7800,21 @@ class RecordingClient { } // coverage:ignore-end - pathParameters['serverId'] = serverId.toString(); - pathParameters['apiVersion'] = (apiVersion ?? RecordingGetWelcomeMessageApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/recording/welcome/{serverId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $serverId = jsonSerializers.serialize(serverId, specifiedType: const FullType(int)); + parameters['serverId'] = $serverId; + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RecordingGetWelcomeMessageApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/recording/welcome/{serverId}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -7417,8 +7888,7 @@ class RecordingClient { final RecordingStartApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -7441,17 +7911,24 @@ class RecordingClient { } // coverage:ignore-end - queryParameters['status'] = status.toString(); + final $status = jsonSerializers.serialize(status, specifiedType: const FullType(int)); + parameters['status'] = $status; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RecordingStartApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/recording/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RecordingStartApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/recording/{token}{?status*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -7520,8 +7997,7 @@ class RecordingClient { final RecordingStopApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -7545,15 +8021,18 @@ class RecordingClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RecordingStopApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/recording/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RecordingStopApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/recording/{token}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -7629,8 +8108,7 @@ class RecordingClient { final RecordingStoreApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -7651,18 +8129,24 @@ class RecordingClient { } // coverage:ignore-end - queryParameters['owner'] = owner; + final $owner = jsonSerializers.serialize(owner, specifiedType: const FullType(String)); + parameters['owner'] = $owner; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RecordingStoreApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/recording/{token}/store').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RecordingStoreApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/recording/{token}/store{?owner*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -7736,8 +8220,7 @@ class RecordingClient { final RecordingNotificationDismissApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -7760,18 +8243,26 @@ class RecordingClient { } // coverage:ignore-end - queryParameters['timestamp'] = timestamp.toString(); + final $timestamp = jsonSerializers.serialize(timestamp, specifiedType: const FullType(int)); + parameters['timestamp'] = $timestamp; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RecordingNotificationDismissApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/recording/{token}/notification').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RecordingNotificationDismissApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/recording/{token}/notification{?timestamp*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -7850,8 +8341,7 @@ class RecordingClient { final RecordingShareToChatApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -7874,19 +8364,29 @@ class RecordingClient { } // coverage:ignore-end - queryParameters['fileId'] = fileId.toString(); - queryParameters['timestamp'] = timestamp.toString(); + final $fileId = jsonSerializers.serialize(fileId, specifiedType: const FullType(int)); + parameters['fileId'] = $fileId; + + final $timestamp = jsonSerializers.serialize(timestamp, specifiedType: const FullType(int)); + parameters['timestamp'] = $timestamp; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RecordingShareToChatApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/recording/{token}/share-chat').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RecordingShareToChatApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/recording/{token}/share-chat{?fileId*,timestamp*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -7969,8 +8469,7 @@ class RoomClient { final RoomGetRoomsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -7993,16 +8492,30 @@ class RoomClient { } // coverage:ignore-end - queryParameters['noStatusUpdate'] = (noStatusUpdate ?? 0).toString(); - queryParameters['includeStatus'] = (includeStatus ?? 0).toString(); - queryParameters['modifiedSince'] = (modifiedSince ?? 0).toString(); - pathParameters['apiVersion'] = (apiVersion ?? RoomGetRoomsApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $noStatusUpdate = jsonSerializers.serialize(noStatusUpdate, specifiedType: const FullType(int)); + $noStatusUpdate ??= 0; + parameters['noStatusUpdate'] = $noStatusUpdate; + var $includeStatus = jsonSerializers.serialize(includeStatus, specifiedType: const FullType(int)); + $includeStatus ??= 0; + parameters['includeStatus'] = $includeStatus; + + var $modifiedSince = jsonSerializers.serialize(modifiedSince, specifiedType: const FullType(int)); + $modifiedSince ??= 0; + parameters['modifiedSince'] = $modifiedSince; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomGetRoomsApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room{?noStatusUpdate*,includeStatus*,modifiedSince*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -8102,8 +8615,7 @@ class RoomClient { final RoomCreateRoomApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -8126,19 +8638,42 @@ class RoomClient { } // coverage:ignore-end - queryParameters['roomType'] = roomType.toString(); - queryParameters['invite'] = invite ?? ''; - queryParameters['roomName'] = roomName ?? ''; - queryParameters['source'] = source ?? ''; - queryParameters['objectType'] = objectType ?? ''; - queryParameters['objectId'] = objectId ?? ''; - pathParameters['apiVersion'] = (apiVersion ?? RoomCreateRoomApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $roomType = jsonSerializers.serialize(roomType, specifiedType: const FullType(int)); + parameters['roomType'] = $roomType; + + var $invite = jsonSerializers.serialize(invite, specifiedType: const FullType(String)); + $invite ??= ''; + parameters['invite'] = $invite; + + var $roomName = jsonSerializers.serialize(roomName, specifiedType: const FullType(String)); + $roomName ??= ''; + parameters['roomName'] = $roomName; + var $source = jsonSerializers.serialize(source, specifiedType: const FullType(String)); + $source ??= ''; + parameters['source'] = $source; + + var $objectType = jsonSerializers.serialize(objectType, specifiedType: const FullType(String)); + $objectType ??= ''; + parameters['objectType'] = $objectType; + + var $objectId = jsonSerializers.serialize(objectId, specifiedType: const FullType(String)); + $objectId ??= ''; + parameters['objectId'] = $objectId; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomCreateRoomApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/spreed/api/{apiVersion}/room{?roomType*,invite*,roomName*,source*,objectType*,objectId*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -8205,8 +8740,7 @@ class RoomClient { final RoomGetListedRoomsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -8229,14 +8763,22 @@ class RoomClient { } // coverage:ignore-end - queryParameters['searchTerm'] = searchTerm ?? ''; - pathParameters['apiVersion'] = (apiVersion ?? RoomGetListedRoomsApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/listed-room').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $searchTerm = jsonSerializers.serialize(searchTerm, specifiedType: const FullType(String)); + $searchTerm ??= ''; + parameters['searchTerm'] = $searchTerm; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomGetListedRoomsApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/listed-room{?searchTerm*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -8305,8 +8847,7 @@ class RoomClient { final RoomGetNoteToSelfConversationApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -8329,14 +8870,16 @@ class RoomClient { } // coverage:ignore-end - pathParameters['apiVersion'] = (apiVersion ?? RoomGetNoteToSelfConversationApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/note-to-self').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomGetNoteToSelfConversationApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/note-to-self').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( @@ -8408,8 +8951,7 @@ class RoomClient { final RoomGetSingleRoomApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -8431,14 +8973,18 @@ class RoomClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomGetSingleRoomApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomGetSingleRoomApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -8512,8 +9058,7 @@ class RoomClient { final RoomRenameRoomApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -8534,16 +9079,23 @@ class RoomClient { } // coverage:ignore-end - queryParameters['roomName'] = roomName; + final $roomName = jsonSerializers.serialize(roomName, specifiedType: const FullType(String)); + parameters['roomName'] = $roomName; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomRenameRoomApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomRenameRoomApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}{?roomName*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -8612,8 +9164,7 @@ class RoomClient { final RoomDeleteRoomApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -8635,14 +9186,18 @@ class RoomClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomDeleteRoomApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomDeleteRoomApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -8711,8 +9266,7 @@ class RoomClient { final RoomGetBreakoutRoomsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -8736,16 +9290,21 @@ class RoomClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomGetBreakoutRoomsApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/breakout-rooms').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomGetBreakoutRoomsApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/breakout-rooms').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -8814,8 +9373,7 @@ class RoomClient { final RoomMakePublicApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -8839,15 +9397,19 @@ class RoomClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomMakePublicApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/public').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomMakePublicApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/public').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -8916,8 +9478,7 @@ class RoomClient { final RoomMakePrivateApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -8941,15 +9502,19 @@ class RoomClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomMakePrivateApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/public').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomMakePrivateApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/public').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -9023,8 +9588,7 @@ class RoomClient { final RoomSetDescriptionApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -9045,18 +9609,26 @@ class RoomClient { } // coverage:ignore-end - queryParameters['description'] = description; + final $description = jsonSerializers.serialize(description, specifiedType: const FullType(String)); + parameters['description'] = $description; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomSetDescriptionApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/description').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomSetDescriptionApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/description{?description*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -9130,8 +9702,7 @@ class RoomClient { final RoomSetReadOnlyApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -9154,18 +9725,24 @@ class RoomClient { } // coverage:ignore-end - queryParameters['state'] = state.toString(); + final $state = jsonSerializers.serialize(state, specifiedType: const FullType(int)); + parameters['state'] = $state; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomSetReadOnlyApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/read-only').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomSetReadOnlyApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/read-only{?state*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -9239,8 +9816,7 @@ class RoomClient { final RoomSetListableApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -9263,18 +9839,24 @@ class RoomClient { } // coverage:ignore-end - queryParameters['scope'] = scope.toString(); + final $scope = jsonSerializers.serialize(scope, specifiedType: const FullType(int)); + parameters['scope'] = $scope; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomSetListableApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/listable').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomSetListableApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/listable{?scope*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -9350,8 +9932,7 @@ class RoomClient { final RoomSetPasswordApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -9372,18 +9953,24 @@ class RoomClient { } // coverage:ignore-end - queryParameters['password'] = password; + final $password = jsonSerializers.serialize(password, specifiedType: const FullType(String)); + parameters['password'] = $password; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomSetPasswordApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/password').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomSetPasswordApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/password{?password*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -9462,8 +10049,7 @@ class RoomClient { final RoomSetPermissionsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -9484,20 +10070,30 @@ class RoomClient { } // coverage:ignore-end - queryParameters['permissions'] = permissions.toString(); + final $permissions = jsonSerializers.serialize(permissions, specifiedType: const FullType(int)); + parameters['permissions'] = $permissions; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + dynamite_utils.checkPattern(mode, RegExp(r'^(call|default)$'), 'mode'); - pathParameters['mode'] = mode; - pathParameters['apiVersion'] = (apiVersion ?? RoomSetPermissionsApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/permissions/{mode}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $mode = jsonSerializers.serialize(mode, specifiedType: const FullType(String)); + parameters['mode'] = $mode; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomSetPermissionsApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/permissions/{mode}{?permissions*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -9571,8 +10167,7 @@ class RoomClient { final RoomGetParticipantsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -9594,17 +10189,26 @@ class RoomClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - queryParameters['includeStatus'] = (includeStatus ?? 0).toString(); - pathParameters['apiVersion'] = (apiVersion ?? RoomGetParticipantsApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/participants').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $includeStatus = jsonSerializers.serialize(includeStatus, specifiedType: const FullType(int)); + $includeStatus ??= 0; + parameters['includeStatus'] = $includeStatus; + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomGetParticipantsApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/participants{?includeStatus*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -9687,8 +10291,7 @@ class RoomClient { final RoomAddParticipantToRoomApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -9711,19 +10314,30 @@ class RoomClient { } // coverage:ignore-end - queryParameters['newParticipant'] = newParticipant; + final $newParticipant = jsonSerializers.serialize(newParticipant, specifiedType: const FullType(String)); + parameters['newParticipant'] = $newParticipant; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - queryParameters['source'] = source ?? 'users'; - pathParameters['apiVersion'] = (apiVersion ?? RoomAddParticipantToRoomApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/participants').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $source = jsonSerializers.serialize(source, specifiedType: const FullType(String)); + $source ??= 'users'; + parameters['source'] = $source; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomAddParticipantToRoomApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/participants{?newParticipant*,source*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -9802,8 +10416,7 @@ class RoomClient { final RoomGetBreakoutRoomParticipantsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -9825,18 +10438,27 @@ class RoomClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - queryParameters['includeStatus'] = (includeStatus ?? 0).toString(); - pathParameters['apiVersion'] = (apiVersion ?? RoomGetBreakoutRoomParticipantsApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/breakout-rooms/participants') - .expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $includeStatus = jsonSerializers.serialize(includeStatus, specifiedType: const FullType(int)); + $includeStatus ??= 0; + parameters['includeStatus'] = $includeStatus; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomGetBreakoutRoomParticipantsApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/breakout-rooms/participants{?includeStatus*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( @@ -9908,8 +10530,7 @@ class RoomClient { final RoomRemoveSelfFromRoomApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -9933,16 +10554,21 @@ class RoomClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomRemoveSelfFromRoomApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/participants/self').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomRemoveSelfFromRoomApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/participants/self').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -10020,8 +10646,7 @@ class RoomClient { final RoomRemoveAttendeeFromRoomApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -10042,18 +10667,25 @@ class RoomClient { } // coverage:ignore-end - queryParameters['attendeeId'] = attendeeId.toString(); + final $attendeeId = jsonSerializers.serialize(attendeeId, specifiedType: const FullType(int)); + parameters['attendeeId'] = $attendeeId; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomRemoveAttendeeFromRoomApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/attendees').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomRemoveAttendeeFromRoomApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/attendees{?attendeeId*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -10141,8 +10773,7 @@ class RoomClient { final RoomSetAttendeePermissionsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -10163,20 +10794,33 @@ class RoomClient { } // coverage:ignore-end - queryParameters['attendeeId'] = attendeeId.toString(); - queryParameters['method'] = method; - queryParameters['permissions'] = permissions.toString(); + final $attendeeId = jsonSerializers.serialize(attendeeId, specifiedType: const FullType(int)); + parameters['attendeeId'] = $attendeeId; + + final $method = jsonSerializers.serialize(method, specifiedType: const FullType(String)); + parameters['method'] = $method; + + final $permissions = jsonSerializers.serialize(permissions, specifiedType: const FullType(int)); + parameters['permissions'] = $permissions; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomSetAttendeePermissionsApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/attendees/permissions').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomSetAttendeePermissionsApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/attendees/permissions{?attendeeId*,method*,permissions*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -10255,8 +10899,7 @@ class RoomClient { final RoomSetAllAttendeesPermissionsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -10277,20 +10920,30 @@ class RoomClient { } // coverage:ignore-end - queryParameters['method'] = method; - queryParameters['permissions'] = permissions.toString(); + final $method = jsonSerializers.serialize(method, specifiedType: const FullType(String)); + parameters['method'] = $method; + + final $permissions = jsonSerializers.serialize(permissions, specifiedType: const FullType(int)); + parameters['permissions'] = $permissions; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomSetAllAttendeesPermissionsApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/attendees/permissions/all') - .expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomSetAllAttendeesPermissionsApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/attendees/permissions/all{?method*,permissions*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -10373,8 +11026,7 @@ class RoomClient { final RoomJoinRoomApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -10396,18 +11048,29 @@ class RoomClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - queryParameters['password'] = password ?? ''; - queryParameters['force'] = (force ?? 1).toString(); - pathParameters['apiVersion'] = (apiVersion ?? RoomJoinRoomApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/participants/active').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $password = jsonSerializers.serialize(password, specifiedType: const FullType(String)); + $password ??= ''; + parameters['password'] = $password; + + var $force = jsonSerializers.serialize(force, specifiedType: const FullType(int)); + $force ??= 1; + parameters['force'] = $force; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomJoinRoomApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/participants/active{?password*,force*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -10474,8 +11137,7 @@ class RoomClient { final RoomLeaveRoomApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -10497,16 +11159,20 @@ class RoomClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomLeaveRoomApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/participants/active').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomLeaveRoomApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/participants/active').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -10580,8 +11246,7 @@ class RoomClient { final RoomResendInvitationsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -10605,20 +11270,26 @@ class RoomClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - if (attendeeId != null) { - queryParameters['attendeeId'] = attendeeId.toString(); - } - pathParameters['apiVersion'] = (apiVersion ?? RoomResendInvitationsApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/participants/resend-invitations') - .expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + final $attendeeId = jsonSerializers.serialize(attendeeId, specifiedType: const FullType(int)); + parameters['attendeeId'] = $attendeeId; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomResendInvitationsApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/participants/resend-invitations{?attendeeId*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -10692,8 +11363,7 @@ class RoomClient { final RoomSetSessionStateApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -10714,18 +11384,26 @@ class RoomClient { } // coverage:ignore-end - queryParameters['state'] = state.toString(); + final $state = jsonSerializers.serialize(state, specifiedType: const FullType(int)); + parameters['state'] = $state; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomSetSessionStateApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/participants/state').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomSetSessionStateApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/participants/state{?state*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -10803,8 +11481,7 @@ class RoomClient { final RoomPromoteModeratorApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -10825,18 +11502,25 @@ class RoomClient { } // coverage:ignore-end - queryParameters['attendeeId'] = attendeeId.toString(); + final $attendeeId = jsonSerializers.serialize(attendeeId, specifiedType: const FullType(int)); + parameters['attendeeId'] = $attendeeId; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomPromoteModeratorApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/moderators').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomPromoteModeratorApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/moderators{?attendeeId*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -10914,8 +11598,7 @@ class RoomClient { final RoomDemoteModeratorApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -10936,18 +11619,25 @@ class RoomClient { } // coverage:ignore-end - queryParameters['attendeeId'] = attendeeId.toString(); + final $attendeeId = jsonSerializers.serialize(attendeeId, specifiedType: const FullType(int)); + parameters['attendeeId'] = $attendeeId; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomDemoteModeratorApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/moderators').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomDemoteModeratorApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/moderators{?attendeeId*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -11014,8 +11704,7 @@ class RoomClient { final RoomAddToFavoritesApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -11039,16 +11728,20 @@ class RoomClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomAddToFavoritesApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/favorite').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomAddToFavoritesApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/favorite').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -11115,8 +11808,7 @@ class RoomClient { final RoomRemoveFromFavoritesApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -11140,16 +11832,20 @@ class RoomClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomRemoveFromFavoritesApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/favorite').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomRemoveFromFavoritesApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/favorite').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -11223,8 +11919,7 @@ class RoomClient { final RoomSetNotificationLevelApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -11247,17 +11942,25 @@ class RoomClient { } // coverage:ignore-end - queryParameters['level'] = level.toString(); + final $level = jsonSerializers.serialize(level, specifiedType: const FullType(int)); + parameters['level'] = $level; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomSetNotificationLevelApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/notify').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomSetNotificationLevelApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/notify{?level*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -11331,8 +12034,7 @@ class RoomClient { final RoomSetNotificationCallsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -11355,18 +12057,25 @@ class RoomClient { } // coverage:ignore-end - queryParameters['level'] = level.toString(); + final $level = jsonSerializers.serialize(level, specifiedType: const FullType(int)); + parameters['level'] = $level; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomSetNotificationCallsApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/notify-calls').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomSetNotificationCallsApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/notify-calls{?level*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -11445,8 +12154,7 @@ class RoomClient { final RoomSetLobbyApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -11469,21 +12177,28 @@ class RoomClient { } // coverage:ignore-end - queryParameters['state'] = state.toString(); + final $state = jsonSerializers.serialize(state, specifiedType: const FullType(int)); + parameters['state'] = $state; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - if (timer != null) { - queryParameters['timer'] = timer.toString(); - } - pathParameters['apiVersion'] = (apiVersion ?? RoomSetLobbyApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/webinar/lobby').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + final $timer = jsonSerializers.serialize(timer, specifiedType: const FullType(int)); + parameters['timer'] = $timer; + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomSetLobbyApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/webinar/lobby{?state*,timer*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -11563,8 +12278,7 @@ class RoomClient { final RoomSetsipEnabledApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -11587,18 +12301,24 @@ class RoomClient { } // coverage:ignore-end - queryParameters['state'] = state.toString(); + final $state = jsonSerializers.serialize(state, specifiedType: const FullType(int)); + parameters['state'] = $state; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomSetsipEnabledApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/webinar/sip').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomSetsipEnabledApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/webinar/sip{?state*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -11674,8 +12394,7 @@ class RoomClient { final RoomSetRecordingConsentApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -11698,18 +12417,26 @@ class RoomClient { } // coverage:ignore-end - queryParameters['recordingConsent'] = recordingConsent.toString(); + final $recordingConsent = jsonSerializers.serialize(recordingConsent, specifiedType: const FullType(int)); + parameters['recordingConsent'] = $recordingConsent; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomSetRecordingConsentApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/recording-consent').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomSetRecordingConsentApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/recording-consent{?recordingConsent*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -11783,8 +12510,7 @@ class RoomClient { final RoomSetMessageExpirationApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -11805,18 +12531,26 @@ class RoomClient { } // coverage:ignore-end - queryParameters['seconds'] = seconds.toString(); + final $seconds = jsonSerializers.serialize(seconds, specifiedType: const FullType(int)); + parameters['seconds'] = $seconds; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? RoomSetMessageExpirationApiVersion.v4).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/message-expiration').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(RoomSetMessageExpirationApiVersion)); + $apiVersion ??= 'v4'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/room/{token}/message-expiration{?seconds*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -11903,8 +12637,7 @@ class SettingsClient { final SettingsSetsipSettingsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -11927,16 +12660,32 @@ class SettingsClient { } // coverage:ignore-end - queryParameters['sipGroups[]'] = (sipGroups ?? const []).map((final e) => e); - queryParameters['dialInInfo'] = dialInInfo ?? ''; - queryParameters['sharedSecret'] = sharedSecret ?? ''; - pathParameters['apiVersion'] = (apiVersion ?? SettingsSetsipSettingsApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/settings/sip').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $sipGroups = jsonSerializers.serialize(sipGroups, specifiedType: const FullType(BuiltList, [FullType(String)])); + $sipGroups ??= []; + parameters['sipGroups%5B%5D'] = $sipGroups; + + var $dialInInfo = jsonSerializers.serialize(dialInInfo, specifiedType: const FullType(String)); + $dialInInfo ??= ''; + parameters['dialInInfo'] = $dialInInfo; + var $sharedSecret = jsonSerializers.serialize(sharedSecret, specifiedType: const FullType(String)); + $sharedSecret ??= ''; + parameters['sharedSecret'] = $sharedSecret; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(SettingsSetsipSettingsApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate( + '/ocs/v2.php/apps/spreed/api/{apiVersion}/settings/sip{?sipGroups%5B%5D*,dialInInfo*,sharedSecret*}', + ).expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -12010,8 +12759,7 @@ class SettingsClient { final SettingsSetUserSettingApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -12034,20 +12782,27 @@ class SettingsClient { } // coverage:ignore-end - queryParameters['key'] = key; - if (value != null) { - queryParameters['value'] = jsonSerializers.serialize( - value, - specifiedType: const FullType(ContentString, [FullType(SettingsSetUserSettingValue)]), - ); - } - pathParameters['apiVersion'] = (apiVersion ?? SettingsSetUserSettingApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/settings/user').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $key = jsonSerializers.serialize(key, specifiedType: const FullType(String)); + parameters['key'] = $key; + + final $value = jsonSerializers.serialize( + value, + specifiedType: const FullType(ContentString, [FullType(SettingsSetUserSettingValue)]), + ); + parameters['value'] = $value; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(SettingsSetUserSettingApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/settings/user{?key*,value*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -12124,8 +12879,7 @@ class SignalingClient { final SignalingGetSettingsApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -12146,15 +12900,22 @@ class SignalingClient { } // coverage:ignore-end - queryParameters['token'] = token ?? ''; - pathParameters['apiVersion'] = (apiVersion ?? SignalingGetSettingsApiVersion.v3).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/signaling/settings').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + $token ??= ''; + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(SignalingGetSettingsApiVersion)); + $apiVersion ??= 'v3'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/signaling/settings{?token*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -12231,8 +12992,7 @@ class SignalingClient { final SignalingGetWelcomeMessageApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -12255,16 +13015,21 @@ class SignalingClient { } // coverage:ignore-end - pathParameters['serverId'] = serverId.toString(); - pathParameters['apiVersion'] = (apiVersion ?? SignalingGetWelcomeMessageApiVersion.v3).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/signaling/welcome/{serverId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $serverId = jsonSerializers.serialize(serverId, specifiedType: const FullType(int)); + parameters['serverId'] = $serverId; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(SignalingGetWelcomeMessageApiVersion)); + $apiVersion ??= 'v3'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/signaling/welcome/{serverId}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -12337,8 +13102,7 @@ class SignalingClient { final SignalingPullMessagesApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -12360,15 +13124,19 @@ class SignalingClient { // coverage:ignore-end dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? SignalingPullMessagesApiVersion.v3).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/signaling/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(SignalingPullMessagesApiVersion)); + $apiVersion ??= 'v3'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/signaling/{token}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -12442,8 +13210,7 @@ class SignalingClient { final SignalingSendMessagesApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -12464,17 +13231,25 @@ class SignalingClient { } // coverage:ignore-end - queryParameters['messages'] = messages; + final $messages = jsonSerializers.serialize(messages, specifiedType: const FullType(String)); + parameters['messages'] = $messages; + dynamite_utils.checkPattern(token, RegExp(r'^[a-z0-9]{4,30}$'), 'token'); - pathParameters['token'] = token; - pathParameters['apiVersion'] = (apiVersion ?? SignalingSendMessagesApiVersion.v3).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = - Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/signaling/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + + var $apiVersion = + jsonSerializers.serialize(apiVersion, specifiedType: const FullType(SignalingSendMessagesApiVersion)); + $apiVersion ??= 'v3'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/spreed/api/{apiVersion}/signaling/{token}{?messages*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -12537,8 +13312,7 @@ class TempAvatarClient { /// * [postAvatar] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse postAvatarRaw({final bool? oCSAPIRequest}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -12561,12 +13335,11 @@ class TempAvatarClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/temp-user-avatar').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/temp-user-avatar').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -12625,8 +13398,7 @@ class TempAvatarClient { DynamiteRawResponse deleteAvatarRaw({ final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -12649,12 +13421,11 @@ class TempAvatarClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/temp-user-avatar').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/spreed/temp-user-avatar').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', diff --git a/packages/nextcloud/lib/src/api/theming.openapi.dart b/packages/nextcloud/lib/src/api/theming.openapi.dart index 9d573a581f3..52c0db69cdd 100644 --- a/packages/nextcloud/lib/src/api/theming.openapi.dart +++ b/packages/nextcloud/lib/src/api/theming.openapi.dart @@ -93,8 +93,7 @@ class IconClient { /// * [getFavicon] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse getFaviconRaw({final String? app}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'image/x-icon', }; @@ -115,12 +114,11 @@ class IconClient { } // coverage:ignore-end - pathParameters['app'] = app ?? 'core'; - var uri = Uri.parse(UriTemplate('/index.php/apps/theming/favicon/{app}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $app = jsonSerializers.serialize(app, specifiedType: const FullType(String)); + $app ??= 'core'; + parameters['app'] = $app; + final uri = Uri.parse(UriTemplate('/index.php/apps/theming/favicon/{app}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -177,8 +175,7 @@ class IconClient { /// * [getTouchIcon] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse getTouchIconRaw({final String? app}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'image/png', }; @@ -199,12 +196,11 @@ class IconClient { } // coverage:ignore-end - pathParameters['app'] = app ?? 'core'; - var uri = Uri.parse(UriTemplate('/index.php/apps/theming/icon/{app}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $app = jsonSerializers.serialize(app, specifiedType: const FullType(String)); + $app ??= 'core'; + parameters['app'] = $app; + final uri = Uri.parse(UriTemplate('/index.php/apps/theming/icon/{app}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -270,8 +266,7 @@ class IconClient { required final String app, required final String image, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'image/svg+xml', }; @@ -292,14 +287,14 @@ class IconClient { } // coverage:ignore-end - pathParameters['app'] = app; + final $app = jsonSerializers.serialize(app, specifiedType: const FullType(String)); + parameters['app'] = $app; + dynamite_utils.checkPattern(image, RegExp(r'^.+$'), 'image'); - pathParameters['image'] = image; - var uri = Uri.parse(UriTemplate('/index.php/apps/theming/img/{app}/{image}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $image = jsonSerializers.serialize(image, specifiedType: const FullType(String)); + parameters['image'] = $image; + final uri = Uri.parse(UriTemplate('/index.php/apps/theming/img/{app}/{image}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -376,8 +371,7 @@ class ThemingClient { final int? plain, final int? withCustomCss, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'text/css', }; @@ -398,14 +392,20 @@ class ThemingClient { } // coverage:ignore-end - pathParameters['themeId'] = themeId; - queryParameters['plain'] = (plain ?? 0).toString(); - queryParameters['withCustomCss'] = (withCustomCss ?? 0).toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/theming/theme/{themeId}.css').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $themeId = jsonSerializers.serialize(themeId, specifiedType: const FullType(String)); + parameters['themeId'] = $themeId; + + var $plain = jsonSerializers.serialize(plain, specifiedType: const FullType(int)); + $plain ??= 0; + parameters['plain'] = $plain; + var $withCustomCss = jsonSerializers.serialize(withCustomCss, specifiedType: const FullType(int)); + $withCustomCss ??= 0; + parameters['withCustomCss'] = $withCustomCss; + + final uri = Uri.parse( + UriTemplate('/index.php/apps/theming/theme/{themeId}.css{?plain*,withCustomCss*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -471,8 +471,7 @@ class ThemingClient { required final String key, final int? useSvg, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': '*/*', }; @@ -493,13 +492,14 @@ class ThemingClient { } // coverage:ignore-end - pathParameters['key'] = key; - queryParameters['useSvg'] = (useSvg ?? 1).toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/theming/image/{key}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $key = jsonSerializers.serialize(key, specifiedType: const FullType(String)); + parameters['key'] = $key; + var $useSvg = jsonSerializers.serialize(useSvg, specifiedType: const FullType(int)); + $useSvg ??= 1; + parameters['useSvg'] = $useSvg; + + final uri = Uri.parse(UriTemplate('/index.php/apps/theming/image/{key}{?useSvg*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -554,8 +554,7 @@ class ThemingClient { /// * [getManifest] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse getManifestRaw({required final String app}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -576,12 +575,10 @@ class ThemingClient { } // coverage:ignore-end - pathParameters['app'] = app; - var uri = Uri.parse(UriTemplate('/index.php/apps/theming/manifest/{app}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $app = jsonSerializers.serialize(app, specifiedType: const FullType(String)); + parameters['app'] = $app; + final uri = Uri.parse(UriTemplate('/index.php/apps/theming/manifest/{app}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -642,8 +639,7 @@ class UserThemeClient { /// * [getBackground] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse getBackgroundRaw({final bool? oCSAPIRequest}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': '*/*', }; @@ -666,12 +662,11 @@ class UserThemeClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/theming/background').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/index.php/apps/theming/background').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -747,8 +742,7 @@ class UserThemeClient { final String? color, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -771,17 +765,21 @@ class UserThemeClient { } // coverage:ignore-end - pathParameters['type'] = type; - queryParameters['value'] = value ?? ''; - if (color != null) { - queryParameters['color'] = color; - } - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/theming/background/{type}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $type = jsonSerializers.serialize(type, specifiedType: const FullType(String)); + parameters['type'] = $type; + + var $value = jsonSerializers.serialize(value, specifiedType: const FullType(String)); + $value ??= ''; + parameters['value'] = $value; + + final $color = jsonSerializers.serialize(color, specifiedType: const FullType(String)); + parameters['color'] = $color; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/index.php/apps/theming/background/{type}{?value*,color*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'post', @@ -834,8 +832,7 @@ class UserThemeClient { /// * [deleteBackground] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse deleteBackgroundRaw({final bool? oCSAPIRequest}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -858,12 +855,11 @@ class UserThemeClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/theming/background/custom').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/index.php/apps/theming/background/custom').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -929,8 +925,7 @@ class UserThemeClient { required final String themeId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -953,13 +948,14 @@ class UserThemeClient { } // coverage:ignore-end - pathParameters['themeId'] = themeId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/theming/api/v1/theme/{themeId}/enable').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $themeId = jsonSerializers.serialize(themeId, specifiedType: const FullType(String)); + parameters['themeId'] = $themeId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/theming/api/v1/theme/{themeId}/enable').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -1025,8 +1021,7 @@ class UserThemeClient { required final String themeId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1049,13 +1044,14 @@ class UserThemeClient { } // coverage:ignore-end - pathParameters['themeId'] = themeId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/theming/api/v1/theme/{themeId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $themeId = jsonSerializers.serialize(themeId, specifiedType: const FullType(String)); + parameters['themeId'] = $themeId; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/theming/api/v1/theme/{themeId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', diff --git a/packages/nextcloud/lib/src/api/updatenotification.openapi.dart b/packages/nextcloud/lib/src/api/updatenotification.openapi.dart index de4bba8ef81..a707e0d9507 100644 --- a/packages/nextcloud/lib/src/api/updatenotification.openapi.dart +++ b/packages/nextcloud/lib/src/api/updatenotification.openapi.dart @@ -103,8 +103,7 @@ class ApiClient { final ApiGetAppListApiVersion? apiVersion, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -127,16 +126,20 @@ class ApiClient { } // coverage:ignore-end - pathParameters['newVersion'] = newVersion; - pathParameters['apiVersion'] = (apiVersion ?? ApiGetAppListApiVersion.v1).name; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/updatenotification/api/{apiVersion}/applist/{newVersion}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $newVersion = jsonSerializers.serialize(newVersion, specifiedType: const FullType(String)); + parameters['newVersion'] = $newVersion; + + var $apiVersion = jsonSerializers.serialize(apiVersion, specifiedType: const FullType(ApiGetAppListApiVersion)); + $apiVersion ??= 'v1'; + parameters['apiVersion'] = $apiVersion; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/updatenotification/api/{apiVersion}/applist/{newVersion}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', diff --git a/packages/nextcloud/lib/src/api/uppush.openapi.dart b/packages/nextcloud/lib/src/api/uppush.openapi.dart index a51dcaa8227..d1a580cef51 100644 --- a/packages/nextcloud/lib/src/api/uppush.openapi.dart +++ b/packages/nextcloud/lib/src/api/uppush.openapi.dart @@ -67,8 +67,7 @@ class Client extends DynamiteClient { /// * [check] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse checkRaw() { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -91,11 +90,7 @@ class Client extends DynamiteClient { } // coverage:ignore-end - var uri = Uri.parse(UriTemplate('/index.php/apps/uppush').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/index.php/apps/uppush').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'get', @@ -154,8 +149,7 @@ class Client extends DynamiteClient { /// * [setKeepalive] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse setKeepaliveRaw({required final int keepalive}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -178,12 +172,10 @@ class Client extends DynamiteClient { } // coverage:ignore-end - queryParameters['keepalive'] = keepalive.toString(); - var uri = Uri.parse(UriTemplate('/index.php/apps/uppush/keepalive').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $keepalive = jsonSerializers.serialize(keepalive, specifiedType: const FullType(int)); + parameters['keepalive'] = $keepalive; + final uri = Uri.parse(UriTemplate('/index.php/apps/uppush/keepalive{?keepalive*}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'put', @@ -238,8 +230,7 @@ class Client extends DynamiteClient { /// * [createDevice] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse createDeviceRaw({required final String deviceName}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -262,12 +253,10 @@ class Client extends DynamiteClient { } // coverage:ignore-end - queryParameters['deviceName'] = deviceName; - var uri = Uri.parse(UriTemplate('/index.php/apps/uppush/device').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $deviceName = jsonSerializers.serialize(deviceName, specifiedType: const FullType(String)); + parameters['deviceName'] = $deviceName; + final uri = Uri.parse(UriTemplate('/index.php/apps/uppush/device{?deviceName*}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'put', @@ -318,8 +307,7 @@ class Client extends DynamiteClient { /// * [syncDevice] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse syncDeviceRaw({required final String deviceId}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -342,12 +330,10 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['deviceId'] = deviceId; - var uri = Uri.parse(UriTemplate('/index.php/apps/uppush/device/{deviceId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $deviceId = jsonSerializers.serialize(deviceId, specifiedType: const FullType(String)); + parameters['deviceId'] = $deviceId; + final uri = Uri.parse(UriTemplate('/index.php/apps/uppush/device/{deviceId}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'get', @@ -396,8 +382,7 @@ class Client extends DynamiteClient { /// * [deleteDevice] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse deleteDeviceRaw({required final String deviceId}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -420,12 +405,10 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['deviceId'] = deviceId; - var uri = Uri.parse(UriTemplate('/index.php/apps/uppush/device/{deviceId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $deviceId = jsonSerializers.serialize(deviceId, specifiedType: const FullType(String)); + parameters['deviceId'] = $deviceId; + final uri = Uri.parse(UriTemplate('/index.php/apps/uppush/device/{deviceId}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'delete', @@ -487,8 +470,7 @@ class Client extends DynamiteClient { required final String deviceId, required final String appName, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -511,13 +493,13 @@ class Client extends DynamiteClient { } // coverage:ignore-end - queryParameters['deviceId'] = deviceId; - queryParameters['appName'] = appName; - var uri = Uri.parse(UriTemplate('/index.php/apps/uppush/app').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $deviceId = jsonSerializers.serialize(deviceId, specifiedType: const FullType(String)); + parameters['deviceId'] = $deviceId; + + final $appName = jsonSerializers.serialize(appName, specifiedType: const FullType(String)); + parameters['appName'] = $appName; + final uri = Uri.parse(UriTemplate('/index.php/apps/uppush/app{?deviceId*,appName*}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'put', @@ -564,8 +546,7 @@ class Client extends DynamiteClient { /// * [deleteApp] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse deleteAppRaw({required final String token}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -588,12 +569,10 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['token'] = token; - var uri = Uri.parse(UriTemplate('/index.php/apps/uppush/app/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + final uri = Uri.parse(UriTemplate('/index.php/apps/uppush/app/{token}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'delete', @@ -644,8 +623,7 @@ class Client extends DynamiteClient { DynamiteRawResponse unifiedpushDiscoveryRaw({ required final String token, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -668,12 +646,10 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['token'] = token; - var uri = Uri.parse(UriTemplate('/index.php/apps/uppush/push/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + final uri = Uri.parse(UriTemplate('/index.php/apps/uppush/push/{token}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'get', @@ -720,8 +696,7 @@ class Client extends DynamiteClient { /// * [push] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse pushRaw({required final String token}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -744,12 +719,10 @@ class Client extends DynamiteClient { } // coverage:ignore-end - pathParameters['token'] = token; - var uri = Uri.parse(UriTemplate('/index.php/apps/uppush/push/{token}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $token = jsonSerializers.serialize(token, specifiedType: const FullType(String)); + parameters['token'] = $token; + final uri = Uri.parse(UriTemplate('/index.php/apps/uppush/push/{token}').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'post', @@ -794,8 +767,7 @@ class Client extends DynamiteClient { /// * [gatewayMatrixDiscovery] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse gatewayMatrixDiscoveryRaw() { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -818,11 +790,7 @@ class Client extends DynamiteClient { } // coverage:ignore-end - var uri = Uri.parse(UriTemplate('/index.php/apps/uppush/gateway/matrix').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/index.php/apps/uppush/gateway/matrix').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'get', @@ -867,8 +835,7 @@ class Client extends DynamiteClient { /// * [gatewayMatrix] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse gatewayMatrixRaw() { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -891,11 +858,7 @@ class Client extends DynamiteClient { } // coverage:ignore-end - var uri = Uri.parse(UriTemplate('/index.php/apps/uppush/gateway/matrix').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } - + final uri = Uri.parse(UriTemplate('/index.php/apps/uppush/gateway/matrix').expand(parameters)); return DynamiteRawResponse( response: executeRequest( 'post', diff --git a/packages/nextcloud/lib/src/api/user_status.openapi.dart b/packages/nextcloud/lib/src/api/user_status.openapi.dart index b7345cb8d19..80c0f719543 100644 --- a/packages/nextcloud/lib/src/api/user_status.openapi.dart +++ b/packages/nextcloud/lib/src/api/user_status.openapi.dart @@ -106,8 +106,7 @@ class HeartbeatClient { required final String status, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -130,13 +129,14 @@ class HeartbeatClient { } // coverage:ignore-end - queryParameters['status'] = status; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/user_status/api/v1/heartbeat').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $status = jsonSerializers.serialize(status, specifiedType: const FullType(String)); + parameters['status'] = $status; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/user_status/api/v1/heartbeat{?status*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -197,8 +197,7 @@ class PredefinedStatusClient { /// * [findAll] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse findAllRaw({final bool? oCSAPIRequest}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -221,12 +220,11 @@ class PredefinedStatusClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/user_status/api/v1/predefined_statuses').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/user_status/api/v1/predefined_statuses').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -299,8 +297,7 @@ class StatusesClient { final int? offset, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -323,18 +320,18 @@ class StatusesClient { } // coverage:ignore-end - if (limit != null) { - queryParameters['limit'] = limit.toString(); - } - if (offset != null) { - queryParameters['offset'] = offset.toString(); - } - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/user_status/api/v1/statuses').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int)); + parameters['limit'] = $limit; + + final $offset = jsonSerializers.serialize(offset, specifiedType: const FullType(int)); + parameters['offset'] = $offset; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = + Uri.parse(UriTemplate('/ocs/v2.php/apps/user_status/api/v1/statuses{?limit*,offset*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -398,8 +395,7 @@ class StatusesClient { required final String userId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -422,13 +418,14 @@ class StatusesClient { } // coverage:ignore-end - pathParameters['userId'] = userId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/user_status/api/v1/statuses/{userId}').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $userId = jsonSerializers.serialize(userId, specifiedType: const FullType(String)); + parameters['userId'] = $userId; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/user_status/api/v1/statuses/{userId}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -491,8 +488,7 @@ class UserStatusClient { /// * [getStatus] for an operation that returns a [DynamiteResponse] with a stable API. @experimental DynamiteRawResponse getStatusRaw({final bool? oCSAPIRequest}) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -515,12 +511,11 @@ class UserStatusClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/user_status/api/v1/user_status').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/user_status/api/v1/user_status').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -584,8 +579,7 @@ class UserStatusClient { required final String statusType, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -608,13 +602,16 @@ class UserStatusClient { } // coverage:ignore-end - queryParameters['statusType'] = statusType; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/user_status/api/v1/user_status/status').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $statusType = jsonSerializers.serialize(statusType, specifiedType: const FullType(String)); + parameters['statusType'] = $statusType; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/user_status/api/v1/user_status/status{?statusType*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -683,8 +680,7 @@ class UserStatusClient { final int? clearAt, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -707,18 +703,20 @@ class UserStatusClient { } // coverage:ignore-end - queryParameters['messageId'] = messageId; - if (clearAt != null) { - queryParameters['clearAt'] = clearAt.toString(); - } - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/user_status/api/v1/user_status/message/predefined').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $messageId = jsonSerializers.serialize(messageId, specifiedType: const FullType(String)); + parameters['messageId'] = $messageId; + final $clearAt = jsonSerializers.serialize(clearAt, specifiedType: const FullType(int)); + parameters['clearAt'] = $clearAt; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/user_status/api/v1/user_status/message/predefined{?messageId*,clearAt*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -792,8 +790,7 @@ class UserStatusClient { final int? clearAt, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -816,23 +813,23 @@ class UserStatusClient { } // coverage:ignore-end - if (statusIcon != null) { - queryParameters['statusIcon'] = statusIcon; - } - if (message != null) { - queryParameters['message'] = message; - } - if (clearAt != null) { - queryParameters['clearAt'] = clearAt.toString(); - } - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/user_status/api/v1/user_status/message/custom').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $statusIcon = jsonSerializers.serialize(statusIcon, specifiedType: const FullType(String)); + parameters['statusIcon'] = $statusIcon; + + final $message = jsonSerializers.serialize(message, specifiedType: const FullType(String)); + parameters['message'] = $message; + final $clearAt = jsonSerializers.serialize(clearAt, specifiedType: const FullType(int)); + parameters['clearAt'] = $clearAt; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/user_status/api/v1/user_status/message/custom{?statusIcon*,message*,clearAt*}') + .expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -889,8 +886,7 @@ class UserStatusClient { DynamiteRawResponse clearMessageRaw({ final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -913,12 +909,11 @@ class UserStatusClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/user_status/api/v1/user_status/message').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/user_status/api/v1/user_status/message').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', @@ -980,8 +975,7 @@ class UserStatusClient { required final String messageId, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -1004,15 +998,16 @@ class UserStatusClient { } // coverage:ignore-end - pathParameters['messageId'] = messageId; - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse( - UriTemplate('/ocs/v2.php/apps/user_status/api/v1/user_status/revert/{messageId}').expand(pathParameters), - ); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $messageId = jsonSerializers.serialize(messageId, specifiedType: const FullType(String)); + parameters['messageId'] = $messageId; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/user_status/api/v1/user_status/revert/{messageId}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'delete', diff --git a/packages/nextcloud/lib/src/api/weather_status.openapi.dart b/packages/nextcloud/lib/src/api/weather_status.openapi.dart index 2e9462b2acf..a621ed8252f 100644 --- a/packages/nextcloud/lib/src/api/weather_status.openapi.dart +++ b/packages/nextcloud/lib/src/api/weather_status.openapi.dart @@ -92,8 +92,7 @@ class WeatherStatusClient { required final int mode, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -116,13 +115,14 @@ class WeatherStatusClient { } // coverage:ignore-end - queryParameters['mode'] = mode.toString(); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/weather_status/api/v1/mode').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $mode = jsonSerializers.serialize(mode, specifiedType: const FullType(int)); + parameters['mode'] = $mode; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/weather_status/api/v1/mode{?mode*}').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -179,8 +179,7 @@ class WeatherStatusClient { DynamiteRawResponse usePersonalAddressRaw({ final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -203,12 +202,11 @@ class WeatherStatusClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/weather_status/api/v1/use-personal').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/weather_status/api/v1/use-personal').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -265,8 +263,7 @@ class WeatherStatusClient { DynamiteRawResponse getLocationRaw({ final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -289,12 +286,11 @@ class WeatherStatusClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/weather_status/api/v1/location').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/weather_status/api/v1/location').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -366,8 +362,7 @@ class WeatherStatusClient { final double? lon, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -390,21 +385,22 @@ class WeatherStatusClient { } // coverage:ignore-end - if (address != null) { - queryParameters['address'] = address; - } - if (lat != null) { - queryParameters['lat'] = lat.toString(); - } - if (lon != null) { - queryParameters['lon'] = lon.toString(); - } - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/weather_status/api/v1/location').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $address = jsonSerializers.serialize(address, specifiedType: const FullType(String)); + parameters['address'] = $address; + + final $lat = jsonSerializers.serialize(lat, specifiedType: const FullType(double)); + parameters['lat'] = $lat; + final $lon = jsonSerializers.serialize(lon, specifiedType: const FullType(double)); + parameters['lon'] = $lon; + + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/weather_status/api/v1/location{?address*,lat*,lon*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', @@ -463,8 +459,7 @@ class WeatherStatusClient { DynamiteRawResponse getForecastRaw({ final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -487,12 +482,11 @@ class WeatherStatusClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/weather_status/api/v1/forecast').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/weather_status/api/v1/forecast').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -549,8 +543,7 @@ class WeatherStatusClient { DynamiteRawResponse getFavoritesRaw({ final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -573,12 +566,11 @@ class WeatherStatusClient { } // coverage:ignore-end - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/weather_status/api/v1/favorites').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + final uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/weather_status/api/v1/favorites').expand(parameters)); return DynamiteRawResponse( response: _rootClient.executeRequest( 'get', @@ -640,8 +632,7 @@ class WeatherStatusClient { required final BuiltList favorites, final bool? oCSAPIRequest, }) { - final pathParameters = {}; - final queryParameters = {}; + final parameters = {}; final headers = { 'Accept': 'application/json', }; @@ -664,13 +655,17 @@ class WeatherStatusClient { } // coverage:ignore-end - queryParameters['favorites[]'] = favorites.map((final e) => e); - headers['OCS-APIRequest'] = (oCSAPIRequest ?? true).toString(); - var uri = Uri.parse(UriTemplate('/ocs/v2.php/apps/weather_status/api/v1/favorites').expand(pathParameters)); - if (queryParameters.isNotEmpty) { - uri = uri.replace(queryParameters: queryParameters); - } + final $favorites = + jsonSerializers.serialize(favorites, specifiedType: const FullType(BuiltList, [FullType(String)])); + parameters['favorites%5B%5D'] = $favorites; + var $oCSAPIRequest = jsonSerializers.serialize(oCSAPIRequest, specifiedType: const FullType(bool)); + $oCSAPIRequest ??= true; + headers['OCS-APIRequest'] = $oCSAPIRequest.toString(); + + final uri = Uri.parse( + UriTemplate('/ocs/v2.php/apps/weather_status/api/v1/favorites{?favorites%5B%5D*}').expand(parameters), + ); return DynamiteRawResponse( response: _rootClient.executeRequest( 'put', diff --git a/packages/nextcloud/test/fixtures/core/autocomplete/get.regexp b/packages/nextcloud/test/fixtures/core/autocomplete/get.regexp index 4d147619fcb..a11d2ec1935 100644 --- a/packages/nextcloud/test/fixtures/core/autocomplete/get.regexp +++ b/packages/nextcloud/test/fixtures/core/autocomplete/get.regexp @@ -1,4 +1,4 @@ -GET http://localhost/ocs/v2\.php/core/autocomplete/get\?search&itemType=call&itemId=new&shareTypes%5B%5D=1&limit=10 +GET http://localhost/ocs/v2\.php/core/autocomplete/get\?search=&itemType=call&itemId=new&shareTypes%5B%5D=1&limit=10 user-agent: Dart/3\.2 \(dart:io\) accept: application/json accept-encoding: gzip diff --git a/packages/nextcloud/test/fixtures/core/unified_search/get_providers.regexp b/packages/nextcloud/test/fixtures/core/unified_search/get_providers.regexp index 057a2acfd2e..567a076f3f8 100644 --- a/packages/nextcloud/test/fixtures/core/unified_search/get_providers.regexp +++ b/packages/nextcloud/test/fixtures/core/unified_search/get_providers.regexp @@ -1,4 +1,4 @@ -GET http://localhost/ocs/v2\.php/search/providers\?from +GET http://localhost/ocs/v2\.php/search/providers\?from= user-agent: Dart/3\.2 \(dart:io\) accept: application/json accept-encoding: gzip diff --git a/packages/nextcloud/test/fixtures/core/unified_search/search.regexp b/packages/nextcloud/test/fixtures/core/unified_search/search.regexp index b62f5b6ce4a..1398dcedc7c 100644 --- a/packages/nextcloud/test/fixtures/core/unified_search/search.regexp +++ b/packages/nextcloud/test/fixtures/core/unified_search/search.regexp @@ -1,4 +1,4 @@ -GET http://localhost/ocs/v2\.php/search/providers/settings/search\?term=Personal\+info&from +GET http://localhost/ocs/v2\.php/search/providers/settings/search\?term=Personal%20info&from= user-agent: Dart/3\.2 \(dart:io\) accept: application/json accept-encoding: gzip diff --git a/packages/nextcloud/test/fixtures/notes/delete_note.regexp b/packages/nextcloud/test/fixtures/notes/delete_note.regexp index a0b5315b8fd..5ca8ae0032b 100644 --- a/packages/nextcloud/test/fixtures/notes/delete_note.regexp +++ b/packages/nextcloud/test/fixtures/notes/delete_note.regexp @@ -1,10 +1,10 @@ -POST http://localhost/index\.php/apps/notes/api/v1/notes\?category&title=a&content&modified=0&favorite=0 +POST http://localhost/index\.php/apps/notes/api/v1/notes\?category=&title=a&content=&modified=0&favorite=0 user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked accept-encoding: gzip authorization: Basic mock -GET http://localhost/index\.php/apps/notes/api/v1/notes\?exclude&pruneBefore=0&chunkSize=0 +GET http://localhost/index\.php/apps/notes/api/v1/notes\?exclude=&pruneBefore=0&chunkSize=0 user-agent: Dart/3\.2 \(dart:io\) accept: application/json accept-encoding: gzip @@ -16,7 +16,7 @@ accept: application/json transfer-encoding: chunked accept-encoding: gzip authorization: Basic mock -GET http://localhost/index\.php/apps/notes/api/v1/notes\?exclude&pruneBefore=0&chunkSize=0 +GET http://localhost/index\.php/apps/notes/api/v1/notes\?exclude=&pruneBefore=0&chunkSize=0 user-agent: Dart/3\.2 \(dart:io\) accept: application/json accept-encoding: gzip diff --git a/packages/nextcloud/test/fixtures/notes/get_note.regexp b/packages/nextcloud/test/fixtures/notes/get_note.regexp index b1775f3b838..6b244a21902 100644 --- a/packages/nextcloud/test/fixtures/notes/get_note.regexp +++ b/packages/nextcloud/test/fixtures/notes/get_note.regexp @@ -1,10 +1,10 @@ -POST http://localhost/index\.php/apps/notes/api/v1/notes\?category&title=a&content&modified=0&favorite=0 +POST http://localhost/index\.php/apps/notes/api/v1/notes\?category=&title=a&content=&modified=0&favorite=0 user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked accept-encoding: gzip authorization: Basic mock -GET http://localhost/index\.php/apps/notes/api/v1/notes/[0-9]+\?exclude +GET http://localhost/index\.php/apps/notes/api/v1/notes/[0-9]+\?exclude= user-agent: Dart/3\.2 \(dart:io\) accept: application/json accept-encoding: gzip diff --git a/packages/nextcloud/test/fixtures/notes/get_notes.regexp b/packages/nextcloud/test/fixtures/notes/get_notes.regexp index 70e6b248d9a..00dba05782b 100644 --- a/packages/nextcloud/test/fixtures/notes/get_notes.regexp +++ b/packages/nextcloud/test/fixtures/notes/get_notes.regexp @@ -1,16 +1,16 @@ -POST http://localhost/index\.php/apps/notes/api/v1/notes\?category&title=a&content&modified=0&favorite=0 +POST http://localhost/index\.php/apps/notes/api/v1/notes\?category=&title=a&content=&modified=0&favorite=0 user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked accept-encoding: gzip authorization: Basic mock -POST http://localhost/index\.php/apps/notes/api/v1/notes\?category&title=b&content&modified=0&favorite=0 +POST http://localhost/index\.php/apps/notes/api/v1/notes\?category=&title=b&content=&modified=0&favorite=0 user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked accept-encoding: gzip authorization: Basic mock -GET http://localhost/index\.php/apps/notes/api/v1/notes\?exclude&pruneBefore=0&chunkSize=0 +GET http://localhost/index\.php/apps/notes/api/v1/notes\?exclude=&pruneBefore=0&chunkSize=0 user-agent: Dart/3\.2 \(dart:io\) accept: application/json accept-encoding: gzip diff --git a/packages/nextcloud/test/fixtures/notes/update_note.regexp b/packages/nextcloud/test/fixtures/notes/update_note.regexp index f71c204f2a2..dde09e34502 100644 --- a/packages/nextcloud/test/fixtures/notes/update_note.regexp +++ b/packages/nextcloud/test/fixtures/notes/update_note.regexp @@ -1,4 +1,4 @@ -POST http://localhost/index\.php/apps/notes/api/v1/notes\?category&title=a&content&modified=0&favorite=0 +POST http://localhost/index\.php/apps/notes/api/v1/notes\?category=&title=a&content=&modified=0&favorite=0 user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked @@ -10,7 +10,7 @@ accept: application/json transfer-encoding: chunked accept-encoding: gzip authorization: Basic mock -GET http://localhost/index\.php/apps/notes/api/v1/notes/[0-9]+\?exclude +GET http://localhost/index\.php/apps/notes/api/v1/notes/[0-9]+\?exclude= user-agent: Dart/3\.2 \(dart:io\) accept: application/json accept-encoding: gzip diff --git a/packages/nextcloud/test/fixtures/notes/update_note_fail_changed_on_server.regexp b/packages/nextcloud/test/fixtures/notes/update_note_fail_changed_on_server.regexp index 34fbfe64c3d..661facc9dd6 100644 --- a/packages/nextcloud/test/fixtures/notes/update_note_fail_changed_on_server.regexp +++ b/packages/nextcloud/test/fixtures/notes/update_note_fail_changed_on_server.regexp @@ -1,4 +1,4 @@ -POST http://localhost/index\.php/apps/notes/api/v1/notes\?category&title=a&content&modified=0&favorite=0 +POST http://localhost/index\.php/apps/notes/api/v1/notes\?category=&title=a&content=&modified=0&favorite=0 user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked diff --git a/packages/nextcloud/test/fixtures/notifications/push/register_and_remove_push_device.regexp b/packages/nextcloud/test/fixtures/notifications/push/register_and_remove_push_device.regexp index a931c5fbe91..f299a3d00d3 100644 --- a/packages/nextcloud/test/fixtures/notifications/push/register_and_remove_push_device.regexp +++ b/packages/nextcloud/test/fixtures/notifications/push/register_and_remove_push_device.regexp @@ -1,4 +1,4 @@ -POST http://localhost/ocs/v2\.php/apps/notifications/api/v2/push\?pushTokenHash=[a-z0-9]{128}&devicePublicKey=-----BEGIN\+PUBLIC\+KEY-----[a-zA-Z0-9%]+-----END\+PUBLIC\+KEY-----&proxyServer=https%3A%2F%2Fexample\.com%2F +POST http://localhost/ocs/v2\.php/apps/notifications/api/v2/push\?pushTokenHash=[a-z0-9]{128}&devicePublicKey=-----BEGIN%20PUBLIC%20KEY-----[a-zA-Z0-9%]+-----END%20PUBLIC%20KEY-----&proxyServer=https%3A%2F%2Fexample\.com%2F user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked diff --git a/packages/nextcloud/test/fixtures/spreed/call/start_and_end_call.regexp b/packages/nextcloud/test/fixtures/spreed/call/start_and_end_call.regexp index fe4b0c4930b..f5ac4738830 100644 --- a/packages/nextcloud/test/fixtures/spreed/call/start_and_end_call.regexp +++ b/packages/nextcloud/test/fixtures/spreed/call/start_and_end_call.regexp @@ -1,11 +1,11 @@ -POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=3&invite&roomName=Test&source&objectType&objectId +POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=3&invite=&roomName=Test&source=&objectType=&objectId= user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked accept-encoding: gzip authorization: Bearer mock ocs-apirequest: true -POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room/[a-z0-9]{8}/participants/active\?password&force=1 +POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room/[a-z0-9]{8}/participants/active\?password=&force=1 user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked diff --git a/packages/nextcloud/test/fixtures/spreed/chat/get_messages/directly.regexp b/packages/nextcloud/test/fixtures/spreed/chat/get_messages/directly.regexp index 54824ab5418..3f4c4927380 100644 --- a/packages/nextcloud/test/fixtures/spreed/chat/get_messages/directly.regexp +++ b/packages/nextcloud/test/fixtures/spreed/chat/get_messages/directly.regexp @@ -1,18 +1,18 @@ -POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=1&invite=user2&roomName&source&objectType&objectId +POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=1&invite=user2&roomName=&source=&objectType=&objectId= user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked accept-encoding: gzip authorization: Bearer mock ocs-apirequest: true -POST http://localhost/ocs/v2\.php/apps/spreed/api/v1/chat/[a-z0-9]{8}\?message=bla&actorDisplayName&referenceId&replyTo=0&silent=0 +POST http://localhost/ocs/v2\.php/apps/spreed/api/v1/chat/[a-z0-9]{8}\?message=bla&actorDisplayName=&referenceId=&replyTo=0&silent=0 user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked accept-encoding: gzip authorization: Bearer mock ocs-apirequest: true -POST http://localhost/ocs/v2\.php/apps/spreed/api/v1/chat/[a-z0-9]{8}\?message=123&actorDisplayName&referenceId&replyTo=2&silent=0 +POST http://localhost/ocs/v2\.php/apps/spreed/api/v1/chat/[a-z0-9]{8}\?message=123&actorDisplayName=&referenceId=&replyTo=2&silent=0 user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked diff --git a/packages/nextcloud/test/fixtures/spreed/chat/get_messages/polling.regexp b/packages/nextcloud/test/fixtures/spreed/chat/get_messages/polling.regexp index b71e1dac558..966004b0127 100644 --- a/packages/nextcloud/test/fixtures/spreed/chat/get_messages/polling.regexp +++ b/packages/nextcloud/test/fixtures/spreed/chat/get_messages/polling.regexp @@ -1,11 +1,11 @@ -POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=3&invite&roomName=Test&source&objectType&objectId +POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=3&invite=&roomName=Test&source=&objectType=&objectId= user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked accept-encoding: gzip authorization: Bearer mock ocs-apirequest: true -POST http://localhost/ocs/v2\.php/apps/spreed/api/v1/chat/[a-z0-9]{8}\?message=bla&actorDisplayName&referenceId&replyTo=0&silent=0 +POST http://localhost/ocs/v2\.php/apps/spreed/api/v1/chat/[a-z0-9]{8}\?message=bla&actorDisplayName=&referenceId=&replyTo=0&silent=0 user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked @@ -19,7 +19,7 @@ accept-encoding: gzip content-length: 0 authorization: Bearer mock ocs-apirequest: true -POST http://localhost/ocs/v2\.php/apps/spreed/api/v1/chat/[a-z0-9]{8}\?message=123&actorDisplayName&referenceId&replyTo=0&silent=0 +POST http://localhost/ocs/v2\.php/apps/spreed/api/v1/chat/[a-z0-9]{8}\?message=123&actorDisplayName=&referenceId=&replyTo=0&silent=0 user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked diff --git a/packages/nextcloud/test/fixtures/spreed/chat/send_message.regexp b/packages/nextcloud/test/fixtures/spreed/chat/send_message.regexp index e30739835c8..a3295729def 100644 --- a/packages/nextcloud/test/fixtures/spreed/chat/send_message.regexp +++ b/packages/nextcloud/test/fixtures/spreed/chat/send_message.regexp @@ -1,11 +1,11 @@ -POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=1&invite=user2&roomName&source&objectType&objectId +POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=1&invite=user2&roomName=&source=&objectType=&objectId= user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked accept-encoding: gzip authorization: Bearer mock ocs-apirequest: true -POST http://localhost/ocs/v2\.php/apps/spreed/api/v1/chat/[a-z0-9]{8}\?message=bla&actorDisplayName&referenceId&replyTo=0&silent=0 +POST http://localhost/ocs/v2\.php/apps/spreed/api/v1/chat/[a-z0-9]{8}\?message=bla&actorDisplayName=&referenceId=&replyTo=0&silent=0 user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked diff --git a/packages/nextcloud/test/fixtures/spreed/room/create_room/group.regexp b/packages/nextcloud/test/fixtures/spreed/room/create_room/group.regexp index 304b5023847..65ff979d659 100644 --- a/packages/nextcloud/test/fixtures/spreed/room/create_room/group.regexp +++ b/packages/nextcloud/test/fixtures/spreed/room/create_room/group.regexp @@ -1,4 +1,4 @@ -POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=2&invite=admin&roomName&source&objectType&objectId +POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=2&invite=admin&roomName=&source=&objectType=&objectId= user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked diff --git a/packages/nextcloud/test/fixtures/spreed/room/create_room/one-to-one.regexp b/packages/nextcloud/test/fixtures/spreed/room/create_room/one-to-one.regexp index 8f21fdd27df..4aecd4b3af9 100644 --- a/packages/nextcloud/test/fixtures/spreed/room/create_room/one-to-one.regexp +++ b/packages/nextcloud/test/fixtures/spreed/room/create_room/one-to-one.regexp @@ -1,4 +1,4 @@ -POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=1&invite=user2&roomName&source&objectType&objectId +POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=1&invite=user2&roomName=&source=&objectType=&objectId= user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked diff --git a/packages/nextcloud/test/fixtures/spreed/room/create_room/public.regexp b/packages/nextcloud/test/fixtures/spreed/room/create_room/public.regexp index a2548b38ad3..2d733463a0d 100644 --- a/packages/nextcloud/test/fixtures/spreed/room/create_room/public.regexp +++ b/packages/nextcloud/test/fixtures/spreed/room/create_room/public.regexp @@ -1,4 +1,4 @@ -POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=3&invite&roomName=abc&source&objectType&objectId +POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=3&invite=&roomName=abc&source=&objectType=&objectId= user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked diff --git a/packages/nextcloud/test/fixtures/spreed/room/session.regexp b/packages/nextcloud/test/fixtures/spreed/room/session.regexp index 3477028fc36..60a4641a987 100644 --- a/packages/nextcloud/test/fixtures/spreed/room/session.regexp +++ b/packages/nextcloud/test/fixtures/spreed/room/session.regexp @@ -1,11 +1,11 @@ -POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=3&invite&roomName=Test&source&objectType&objectId +POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=3&invite=&roomName=Test&source=&objectType=&objectId= user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked accept-encoding: gzip authorization: Bearer mock ocs-apirequest: true -POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room/[a-z0-9]{8}/participants/active\?password&force=1 +POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room/[a-z0-9]{8}/participants/active\?password=&force=1 user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked diff --git a/packages/nextcloud/test/fixtures/spreed/signaling/get_settings.regexp b/packages/nextcloud/test/fixtures/spreed/signaling/get_settings.regexp index 511e72c81d3..0a6364bf565 100644 --- a/packages/nextcloud/test/fixtures/spreed/signaling/get_settings.regexp +++ b/packages/nextcloud/test/fixtures/spreed/signaling/get_settings.regexp @@ -1,4 +1,4 @@ -POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=3&invite&roomName=Test&source&objectType&objectId +POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=3&invite=&roomName=Test&source=&objectType=&objectId= user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked diff --git a/packages/nextcloud/test/fixtures/spreed/signaling/send_and_receive_messages.regexp b/packages/nextcloud/test/fixtures/spreed/signaling/send_and_receive_messages.regexp index e40f8fa8ea7..303e881003a 100644 --- a/packages/nextcloud/test/fixtures/spreed/signaling/send_and_receive_messages.regexp +++ b/packages/nextcloud/test/fixtures/spreed/signaling/send_and_receive_messages.regexp @@ -1,11 +1,11 @@ -POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=1&invite=user2&roomName&source&objectType&objectId +POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room\?roomType=1&invite=user2&roomName=&source=&objectType=&objectId= user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked accept-encoding: gzip authorization: Bearer mock ocs-apirequest: true -POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room/[a-z0-9]{8}/participants/active\?password&force=1 +POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room/[a-z0-9]{8}/participants/active\?password=&force=1 user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked @@ -19,7 +19,7 @@ transfer-encoding: chunked accept-encoding: gzip authorization: Bearer mock ocs-apirequest: true -POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room/[a-z0-9]{8}/participants/active\?password&force=1 +POST http://localhost/ocs/v2\.php/apps/spreed/api/v4/room/[a-z0-9]{8}/participants/active\?password=&force=1 user-agent: Dart/3\.2 \(dart:io\) accept: application/json transfer-encoding: chunked