Skip to content

Commit

Permalink
rename UPS_OAUTH_CARRIER_ACCOUNT_TYPES
Browse files Browse the repository at this point in the history
  • Loading branch information
jchen293 committed Jul 10, 2024
1 parent c458c35 commit 5d3318e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/easypost/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public abstract static class CarrierAccountTypes {
}

public abstract static class UpsAccountTypes {
public static final List<String> CARRIER_TYPES_WITH_CUSTOM_WORKFLOW = ImmutableList.of("UpsAccount",
public static final List<String> UPS_OAUTH_CARRIER_ACCOUNT_TYPES = ImmutableList.of("UpsAccount",
"UpsMailInnovationsAccount", "UpsSurepostAccount");
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/easypost/service/CarrierAccountService.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public CarrierAccount update(String id, final Map<String, Object> params) throws
Map<String, Object> wrappedParams = new HashMap<String, Object>();
wrappedParams.put(selectTopLayerKey(type), params);

String endpoint = (Constants.UpsAccountTypes.CARRIER_TYPES_WITH_CUSTOM_WORKFLOW.contains(type)
String endpoint = (Constants.UpsAccountTypes.UPS_OAUTH_CARRIER_ACCOUNT_TYPES.contains(type)
? "ups_oauth_registrations/"
: "carrier_accounts/") + id;

Expand Down Expand Up @@ -123,7 +123,7 @@ public void delete(String id) throws EasyPostException {
private static String selectCarrierAccountCreationEndpoint(final String carrierAccountType) {
if (Constants.CarrierAccountTypes.CARRIER_TYPES_WITH_CUSTOM_WORKFLOW.contains(carrierAccountType)) {
return "carrier_accounts/register";
} else if (Constants.UpsAccountTypes.CARRIER_TYPES_WITH_CUSTOM_WORKFLOW.contains(carrierAccountType)) {
} else if (Constants.UpsAccountTypes.UPS_OAUTH_CARRIER_ACCOUNT_TYPES.contains(carrierAccountType)) {
return "ups_oauth_registrations";
} else {
return "carrier_accounts";
Expand All @@ -143,7 +143,7 @@ private static String selectTopLayerKey(final String carrierAccountType) throws
String.format(Constants.ErrorMessages.MISSING_REQUIRED_PARAMETER, "carrier account type"));
}

return Constants.UpsAccountTypes.CARRIER_TYPES_WITH_CUSTOM_WORKFLOW.contains(carrierAccountType)
return Constants.UpsAccountTypes.UPS_OAUTH_CARRIER_ACCOUNT_TYPES.contains(carrierAccountType)
? "ups_oauth_registrations"
: "carrier_account";
}
Expand Down

0 comments on commit 5d3318e

Please sign in to comment.