-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor AmazonShipping options and formatting
- Adjusted spacing in the AddAmazonShippingClient method for consistency. - Removed 'required' keyword from ClientId, ClientSecret, and RefreshToken properties in AmazonShippingApiOptions, making them optional. - Assigned default values of string.Empty to ClientId, ClientSecret, and RefreshToken.
- Loading branch information
Brandon Moffett
committed
Dec 14, 2024
1 parent
f8ede64
commit acd3024
Showing
2 changed files
with
6 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ public static IServiceCollection AddAmazonShippingClient( | |
string sectionName = nameof(AmazonShippingApiOptions), | ||
Action<AmazonShippingApiOptions, IServiceProvider>? configure = null) | ||
{ | ||
//services.AddChangeTokenOptions<AmazonShippingApiOptions>(sectionName, null, (options, config) => configure?.Invoke(options, config)); | ||
services.AddChangeTokenOptions<AmazonShippingApiOptions>(sectionName, null, (options, config) => configure?.Invoke(options,config)); | ||
Check warning on line 15 in src/EasyKeys.Shipping.Amazon.Abstractions/DependencyInjection/AmazonShippingServiceCollectionExtensions.cs
|
||
services.AddSingleton<IAmazonApiAuthenticatorService, AmazonApiAuthenticatorService>(); | ||
// add generated api clients | ||
Check warning on line 17 in src/EasyKeys.Shipping.Amazon.Abstractions/DependencyInjection/AmazonShippingServiceCollectionExtensions.cs
|
||
// services.AddHttpClient<AuthorizationApi>(); | ||
|
15 changes: 5 additions & 10 deletions
15
src/EasyKeys.Shipping.Amazon.Abstractions/Options/AmazonShippingApiOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
namespace EasyKeys.Shipping.Amazon.Abstractions.Options; | ||
|
||
namespace EasyKeys.Shipping.Amazon.Abstractions.Options; | ||
public class AmazonShippingApiOptions | ||
{ | ||
required public string ClientId { get; set; } | ||
public string ClientId { get; set; } = string.Empty; | ||
|
||
required public string ClientSecret { get; set; } | ||
required public string RefreshToken { get; set; } | ||
public string ClientSecret { get; set; } = string.Empty; | ||
|
||
public string RefreshToken { get; set; } = string.Empty; | ||
} |