File tree Expand file tree Collapse file tree 6 files changed +16
-11
lines changed
Expand file tree Collapse file tree 6 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ var customer = await client
8484 .WithOptions (options =>
8585 options with
8686 {
87- BaseUrl = new ( " https://example.com" ) ,
87+ BaseUrl = " https://example.com" ,
8888 Timeout = TimeSpan .FromSeconds (42 ),
8989 }
9090 )
Original file line number Diff line number Diff line change @@ -11,9 +11,8 @@ public TestBase()
1111 {
1212 client = new OrbClient ( )
1313 {
14- BaseUrl = new Uri (
15- Environment . GetEnvironmentVariable ( "TEST_API_BASE_URL" ) ?? "http://localhost:4010"
16- ) ,
14+ BaseUrl =
15+ Environment . GetEnvironmentVariable ( "TEST_API_BASE_URL" ) ?? "http://localhost:4010" ,
1716 APIKey = "My API Key" ,
1817 } ;
1918 }
Original file line number Diff line number Diff line change @@ -24,16 +24,16 @@ public struct ClientOptions()
2424 /// </summary>
2525 public HttpClient HttpClient { get ; set ; } = new ( ) ;
2626
27- Lazy < Uri > _baseUrl = new ( ( ) =>
28- new Uri ( Environment . GetEnvironmentVariable ( "ORB_BASE_URL" ) ?? "https://api.withorb.com/v1" )
27+ Lazy < string > _baseUrl = new ( ( ) =>
28+ Environment . GetEnvironmentVariable ( "ORB_BASE_URL" ) ?? EnvironmentUrl . Production
2929 ) ;
3030
3131 /// <summary>
3232 /// The base URL to use for every request.
3333 ///
34- /// <para>Defaults to the production environment: https://api.withorb.com/v1 </para>
34+ /// <para>Defaults to the production environment: <see cref="EnvironmentUrl.Production"/> </para>
3535 /// </summary>
36- public Uri BaseUrl
36+ public string BaseUrl
3737 {
3838 readonly get { return _baseUrl . Value ; }
3939 set { _baseUrl = new ( ( ) => value ) ; }
Original file line number Diff line number Diff line change 1+ namespace Orb . Core ;
2+
3+ public static class EnvironmentUrl
4+ {
5+ public static readonly string Production = "https://api.withorb.com/v1" ;
6+ }
Original file line number Diff line number Diff line change @@ -29,9 +29,9 @@ public interface IOrbClient
2929 /// <summary>
3030 /// The base URL to use for every request.
3131 ///
32- /// <para>Defaults to the production environment: https://api.withorb.com/v1 </para>
32+ /// <para>Defaults to the production environment: <see cref="EnvironmentUrl.Production"/> </para>
3333 /// </summary>
34- Uri BaseUrl { get ; init ; }
34+ string BaseUrl { get ; init ; }
3535
3636 /// <summary>
3737 /// Whether to validate every response before returning it.
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public HttpClient HttpClient
3131 }
3232
3333 /// <inheritdoc/>
34- public Uri BaseUrl
34+ public string BaseUrl
3535 {
3636 get { return this . _options . BaseUrl ; }
3737 init { this . _options . BaseUrl = value ; }
You can’t perform that action at this time.
0 commit comments