Skip to content

Commit

Permalink
Rename Method to HttpMethod (closes #3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoboss committed Feb 9, 2024
1 parent 6e59366 commit a6abc8b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/kiota_abstractions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ part 'src/api_client_builder.dart';
part 'src/base_request_builder.dart';
part 'src/extensions/map_extensions.dart';
part 'src/extensions/request_information_extensions.dart';
part 'src/method.dart';
part 'src/http_method.dart';
part 'src/multipart_body.dart';
part 'src/request_adapter.dart';
part 'src/request_headers.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/method.dart → lib/src/http_method.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
part of '../kiota_abstractions.dart';

/// Represents the HTTP method used by a request.
enum Method {
enum HttpMethod {
/// The GET method requests a representation of the specified resource. Requests using GET should only retrieve data.
get,

Expand Down
4 changes: 2 additions & 2 deletions lib/src/request_information.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class RequestInformation {
/// The path parameters to use for the URL template when generating the URI.
Map<String, dynamic> pathParameters;

/// The HTTP [Method] of the request.
Method? httpMethod;
/// The HTTP [HttpMethod] of the request.
HttpMethod? httpMethod;

/// The query parameters to use for the URL when generating the URI.
Map<String, dynamic> queryParameters;
Expand Down
18 changes: 9 additions & 9 deletions test/request_information_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void main() {

test('SetUriExtractsQueryParameters', () {
final example = RequestInformation(
httpMethod: Method.get,
httpMethod: HttpMethod.get,
urlTemplate: 'http://localhost/{path}/me?foo={foo}',
);

Expand All @@ -46,7 +46,7 @@ void main() {
test('Adds and removes request options', () {
// Arrange
final testRequest = RequestInformation(
httpMethod: Method.get,
httpMethod: HttpMethod.get,
)..uri = Uri.parse('http://localhost');

final testRequestOption = MockRequestOption();
Expand All @@ -67,7 +67,7 @@ void main() {
test('Sets path parameters of DateTime type', () {
// Arrange as the request builders would
final requestInfo = RequestInformation(
httpMethod: Method.get,
httpMethod: HttpMethod.get,
urlTemplate:
"http://localhost/getDirectRoutingCalls(fromDateTime='{fromDateTime}',toDateTime='{toDateTime}')",
);
Expand All @@ -93,7 +93,7 @@ void main() {
test('Sets path parameters of boolean type', () {
// Arrange as the request builders would
final requestInfo = RequestInformation(
httpMethod: Method.get,
httpMethod: HttpMethod.get,
urlTemplate: 'http://localhost/users{?%24count}',
);

Expand All @@ -107,7 +107,7 @@ void main() {
test('Builds URL on provided base URL', () {
// Arrange as the request builders would
final requestInfo = RequestInformation(
httpMethod: Method.get,
httpMethod: HttpMethod.get,
urlTemplate: '{+baseurl}/users{?%24count}',
);

Expand All @@ -124,7 +124,7 @@ void main() {

// Arrange as the request builders would
final requestInfo = RequestInformation(
httpMethod: Method.get,
httpMethod: HttpMethod.get,
urlTemplate: '{+baseurl}/users{?%24count}',
)..pathParameters = <String, Object>{
'baseurl': proxyUrl,
Expand All @@ -141,7 +141,7 @@ void main() {
test('Get URI resolves parameters case-sensitive', () {
// Arrange
final testRequest = RequestInformation(
httpMethod: Method.get,
httpMethod: HttpMethod.get,
urlTemplate:
'http://localhost/{URITemplate}/ParameterMapping?IsCaseSensitive={IsCaseSensitive}',
);
Expand All @@ -160,7 +160,7 @@ void main() {
test('Sets enum value in path parameters', () {
// Arrange
final testRequest = RequestInformation(
httpMethod: Method.get,
httpMethod: HttpMethod.get,
urlTemplate: 'http://localhost/{dataset}',
);

Expand All @@ -174,7 +174,7 @@ void main() {
test('Sets multiple enum values in path parameters', () {
// Arrange
final testRequest = RequestInformation(
httpMethod: Method.get,
httpMethod: HttpMethod.get,
urlTemplate: 'http://localhost/{dataset}',
);

Expand Down

0 comments on commit a6abc8b

Please sign in to comment.