Skip to content

Commit

Permalink
Rename name of checklist API to API Product
Browse files Browse the repository at this point in the history
  • Loading branch information
HiranyaKavishani committed Oct 6, 2023
1 parent d2b2889 commit db93064
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public APIProductInfoDTO version(String version) {
return this;
}


@ApiModelProperty(example = "1.0.0", value = "")
@JsonProperty("version")
public String getVersion() {
Expand Down Expand Up @@ -221,7 +221,7 @@ public APIProductInfoDTO monetizedInfo(Boolean monetizedInfo) {
return this;
}


@ApiModelProperty(example = "true", value = "")
@JsonProperty("monetizedInfo")
public Boolean isMonetizedInfo() {
Expand All @@ -238,7 +238,7 @@ public APIProductInfoDTO businessOwner(String businessOwner) {
return this;
}


@ApiModelProperty(example = "Business Owner", value = "")
@JsonProperty("businessOwner")
public String getBusinessOwner() {
Expand All @@ -255,7 +255,7 @@ public APIProductInfoDTO businessOwnerEmail(String businessOwnerEmail) {
return this;
}


@ApiModelProperty(example = "[email protected]", value = "")
@JsonProperty("businessOwnerEmail")
public String getBusinessOwnerEmail() {
Expand All @@ -272,7 +272,7 @@ public APIProductInfoDTO technicalOwner(String technicalOwner) {
return this;
}


@ApiModelProperty(example = "Technical Owner", value = "")
@JsonProperty("TechnicalOwner")
public String getTechnicalOwner() {
Expand All @@ -289,7 +289,7 @@ public APIProductInfoDTO technicalOwnerEmail(String technicalOwnerEmail) {
return this;
}


@ApiModelProperty(example = "[email protected]", value = "")
@JsonProperty("TechnicalOwnerEmail")
public String getTechnicalOwnerEmail() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,7 @@ private static void setMaxTpsFromModelToApiDTO(API api, APIDTO dto) {
* @return REST API DTO representation of API Lifecycle state information
*/
public static LifecycleStateDTO fromLifecycleModelToDTO(Map<String, Object> apiLCData,
boolean apiOlderVersionExist) {
boolean apiOlderVersionExist, String apiType) {

LifecycleStateDTO lifecycleStateDTO = new LifecycleStateDTO();

Expand Down Expand Up @@ -1601,7 +1601,12 @@ public static LifecycleStateDTO fromLifecycleModelToDTO(Map<String, Object> apiL
}

LifecycleStateCheckItemsDTO checkItemsDTO = new LifecycleStateCheckItemsDTO();
checkItemsDTO.setName(checkListItem.getName());
if (APIConstants.API_PRODUCT.equals(apiType)) {
checkItemsDTO.setName(checkListItem.getName().replace(APIConstants.API_IDENTIFIER_TYPE,
APIConstants.API_PRODUCT_IDENTIFIER_TYPE));
} else {
checkItemsDTO.setName(checkListItem.getName());
}
checkItemsDTO.setValue(Boolean.getBoolean(checkListItem.getValue()));
//todo: Set targets properly
checkItemsDTO.setRequiredStates(new ArrayList<>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1997,15 +1997,16 @@ public static LifecycleStateDTO getLifecycleStateInformation(Identifier identifi

APIProvider apiProvider = RestApiCommonUtil.getLoggedInUserProvider();
Map<String, Object> apiLCData = apiProvider.getAPILifeCycleData(identifier.getUUID(), organization);
String apiType;
if (identifier instanceof APIProductIdentifier) {
apiType = APIConstants.API_PRODUCT;
} else {
apiType = APIConstants.API_IDENTIFIER_TYPE;
}

if (apiLCData == null) {
String type;
if (identifier instanceof APIProductIdentifier) {
type = APIConstants.API_PRODUCT;
} else {
type = APIConstants.API_IDENTIFIER_TYPE;
}
throw new APIManagementException("Error while getting lifecycle state for " + type + " with ID "
+ identifier, ExceptionCodes.from(ExceptionCodes.LIFECYCLE_STATE_INFORMATION_NOT_FOUND, type,
throw new APIManagementException("Error while getting lifecycle state for " + apiType + " with ID "
+ identifier, ExceptionCodes.from(ExceptionCodes.LIFECYCLE_STATE_INFORMATION_NOT_FOUND, apiType,
identifier.getUUID()));
} else {
boolean apiOlderVersionExist = false;
Expand All @@ -2021,7 +2022,7 @@ public static LifecycleStateDTO getLifecycleStateInformation(Identifier identifi
break;
}
}
return APIMappingUtil.fromLifecycleModelToDTO(apiLCData, apiOlderVersionExist);
return APIMappingUtil.fromLifecycleModelToDTO(apiLCData, apiOlderVersionExist, apiType);
}
}

Expand Down

0 comments on commit db93064

Please sign in to comment.