-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replaced httpclient with Okhttp. (bunq/sdk_java#25) #73
Changes from 3 commits
00cc743
2d0d89f
362ad29
3bd78cf
fb26ecb
1dcdc43
01577e0
2235a4a
0393ba5
609b35e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,33 @@ | ||
package com.bunq.sdk.context; | ||
|
||
import com.bunq.sdk.exception.UncaughtExceptionError; | ||
import java.net.URI; | ||
import java.net.URISyntaxException; | ||
|
||
/** | ||
* Enum for the API environment types and their URIs. | ||
*/ | ||
public enum ApiEnvironmentType { | ||
|
||
PRODUCTION("https://api.bunq.com/v1/"), | ||
SANDBOX("https://sandbox.public.api.bunq.com/v1/"); | ||
PRODUCTION("api.bunq.com", "v1"), | ||
SANDBOX("sandbox.public.api.bunq.com", "v1"); | ||
|
||
/** | ||
* Base URI of each given environment. | ||
*/ | ||
private String baseUri; | ||
private String apiVersion; | ||
|
||
ApiEnvironmentType(String baseUri) { | ||
ApiEnvironmentType(String baseUri, String apiVersion) { | ||
this.baseUri = baseUri; | ||
this.apiVersion = apiVersion; | ||
} | ||
|
||
/** | ||
* @return Base URI of the environment. | ||
*/ | ||
URI getBaseUri() { | ||
try { | ||
return new URI(this.baseUri); | ||
} catch (URISyntaxException exception) { | ||
throw new UncaughtExceptionError(exception); | ||
} | ||
String getBaseUri() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Intended to be default access instead of private public or protected? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, so that it can only be accessed publicly via ApiContext. |
||
return this.baseUri; | ||
} | ||
|
||
String getApiVersion() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. |
||
return this.apiVersion; | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo