diff --git a/packages/kiota_abstractions/lib/src/abstract_query_parameters.dart b/packages/kiota_abstractions/lib/src/abstract_query_parameters.dart index 35da492..7a23d02 100644 --- a/packages/kiota_abstractions/lib/src/abstract_query_parameters.dart +++ b/packages/kiota_abstractions/lib/src/abstract_query_parameters.dart @@ -1,6 +1,7 @@ part of '../kiota_abstractions.dart'; /// Type definition for query parameters. -abstract class AbstractQueryParameters{ - Map getQueryParameters(); +abstract class AbstractQueryParameters { + ///Return a map representation of the query parameters for the request + Map toMap(); } diff --git a/packages/kiota_abstractions/lib/src/default_query_parameters.dart b/packages/kiota_abstractions/lib/src/default_query_parameters.dart index f3f4c34..8362cd5 100644 --- a/packages/kiota_abstractions/lib/src/default_query_parameters.dart +++ b/packages/kiota_abstractions/lib/src/default_query_parameters.dart @@ -1,11 +1,11 @@ part of '../kiota_abstractions.dart'; /// Type definition for query parameters. -class DefaultQueryParameters extends AbstractQueryParameters{ +class DefaultQueryParameters extends AbstractQueryParameters { Map queryParameters = {}; @override - Map getQueryParameters(){ + Map toMap() { return queryParameters; } } diff --git a/packages/kiota_abstractions/lib/src/extensions/request_information_extensions.dart b/packages/kiota_abstractions/lib/src/extensions/request_information_extensions.dart index df6f545..4e02dff 100644 --- a/packages/kiota_abstractions/lib/src/extensions/request_information_extensions.dart +++ b/packages/kiota_abstractions/lib/src/extensions/request_information_extensions.dart @@ -137,15 +137,18 @@ extension RequestInformationExtensions on RequestInformation { content = writer.getSerializedContent(); } - void configure(void Function(RequestConfiguration)? configurator, T Function()? createParameters) { + void configure( + void Function(RequestConfiguration)? configurator, + T Function()? createParameters) { if (configurator == null || createParameters == null) { return; } - final config = RequestConfiguration(HttpHeaders(), [], createParameters()); + final config = + RequestConfiguration(HttpHeaders(), [], createParameters()); configurator(config); - addQueryParameters(config.queryParameters.getQueryParameters()); + addQueryParameters(config.queryParameters.toMap()); addHeaders(config.headers); addRequestOptions(config.options); } diff --git a/packages/kiota_abstractions/lib/src/request_configuration.dart b/packages/kiota_abstractions/lib/src/request_configuration.dart index 6d9f2fc..0f4ad07 100644 --- a/packages/kiota_abstractions/lib/src/request_configuration.dart +++ b/packages/kiota_abstractions/lib/src/request_configuration.dart @@ -2,8 +2,8 @@ part of '../kiota_abstractions.dart'; /// Request configuration type for [BaseRequestBuilder]s. class RequestConfiguration { - const RequestConfiguration(this.headers, this.options, this.queryParameters); + /// The HTTP headers of the request. final HttpHeaders headers;