Skip to content

Commit

Permalink
Formatting, comment added and method renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
joanne-ter-maat authored and ricardoboss committed Oct 17, 2024
1 parent aa92680 commit e816bc8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
part of '../kiota_abstractions.dart';

/// Type definition for query parameters.
abstract class AbstractQueryParameters{
Map<String, dynamic> getQueryParameters();
abstract class AbstractQueryParameters {
///Return a map representation of the query parameters for the request
Map<String, dynamic> toMap();
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
part of '../kiota_abstractions.dart';

/// Type definition for query parameters.
class DefaultQueryParameters extends AbstractQueryParameters{
class DefaultQueryParameters extends AbstractQueryParameters {
Map<String, dynamic> queryParameters = {};

@override
Map<String, dynamic> getQueryParameters(){
Map<String, dynamic> toMap() {
return queryParameters;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,18 @@ extension RequestInformationExtensions on RequestInformation {
content = writer.getSerializedContent();
}

void configure<T extends AbstractQueryParameters>(void Function(RequestConfiguration<T>)? configurator, T Function()? createParameters) {
void configure<T extends AbstractQueryParameters>(
void Function(RequestConfiguration<T>)? configurator,
T Function()? createParameters) {
if (configurator == null || createParameters == null) {
return;
}

final config = RequestConfiguration<T>(HttpHeaders(), [], createParameters());
final config =
RequestConfiguration<T>(HttpHeaders(), [], createParameters());
configurator(config);

addQueryParameters(config.queryParameters.getQueryParameters());
addQueryParameters(config.queryParameters.toMap());
addHeaders(config.headers);
addRequestOptions(config.options);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ part of '../kiota_abstractions.dart';

/// Request configuration type for [BaseRequestBuilder]s.
class RequestConfiguration<T extends AbstractQueryParameters> {

const RequestConfiguration(this.headers, this.options, this.queryParameters);

/// The HTTP headers of the request.
final HttpHeaders headers;

Expand Down

0 comments on commit e816bc8

Please sign in to comment.