Skip to content

Commit

Permalink
Add lastUpdatedTimestamp for APIs and API Products DTO
Browse files Browse the repository at this point in the history
Update test cases to test wso2/api-manager#1860
  • Loading branch information
dulanjalidilmi committed Jun 15, 2023
1 parent 1081695 commit 53e4ceb
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16118,6 +16118,7 @@ components:
display: false
name: name
value: value
lastUpdatedTimestamp: lastUpdatedTimestamp
wsdlInfo:
type: WSDL
hasThumbnail: false
Expand Down Expand Up @@ -16416,6 +16417,8 @@ components:
type: string
createdTime:
type: string
lastUpdatedTimestamp:
type: string
lastUpdatedTime:
type: string
x-otherScopes:
Expand Down Expand Up @@ -16922,6 +16925,7 @@ components:
value: value
revisionedApiProductId: 01234567-0123-0123-0123-012345678901
accessControlRoles: []
lastUpdatedTimestamp: lastUpdatedTimestamp
hasThumbnail: false
visibility: PUBLIC
transport:
Expand Down Expand Up @@ -17146,6 +17150,8 @@ components:
$ref: '#/components/schemas/APICorsConfiguration'
createdTime:
type: string
lastUpdatedTimestamp:
type: string
lastUpdatedTime:
type: string
gatewayVendor:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Name | Type | Description | Notes
**websubSubscriptionConfiguration** | [**WebsubSubscriptionConfigurationDTO**](WebsubSubscriptionConfigurationDTO.md) | | [optional]
**workflowStatus** | **String** | | [optional]
**createdTime** | **String** | | [optional]
**lastUpdatedTimestamp** | **String** | | [optional]
**lastUpdatedTime** | **String** | | [optional]
**endpointConfig** | [**Object**](.md) | Endpoint configuration of the API. This can be used to provide different types of endpoints including Simple REST Endpoints, Loadbalanced and Failover. `Simple REST Endpoint` { \"endpoint_type\": \"http\", \"sandbox_endpoints\": { \"url\": \"https://localhost:9443/am/sample/pizzashack/v1/api/\" }, \"production_endpoints\": { \"url\": \"https://localhost:9443/am/sample/pizzashack/v1/api/\" } } `Loadbalanced Endpoint` { \"endpoint_type\": \"load_balance\", \"algoCombo\": \"org.apache.synapse.endpoints.algorithms.RoundRobin\", \"sessionManagement\": \"\", \"sandbox_endpoints\": [ { \"url\": \"https://localhost:9443/am/sample/pizzashack/v1/api/1\" }, { \"endpoint_type\": \"http\", \"template_not_supported\": false, \"url\": \"https://localhost:9443/am/sample/pizzashack/v1/api/2\" } ], \"production_endpoints\": [ { \"url\": \"https://localhost:9443/am/sample/pizzashack/v1/api/3\" }, { \"endpoint_type\": \"http\", \"template_not_supported\": false, \"url\": \"https://localhost:9443/am/sample/pizzashack/v1/api/4\" } ], \"sessionTimeOut\": \"\", \"algoClassName\": \"org.apache.synapse.endpoints.algorithms.RoundRobin\" } `Failover Endpoint` { \"production_failovers\":[ { \"endpoint_type\":\"http\", \"template_not_supported\":false, \"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/1\" } ], \"endpoint_type\":\"failover\", \"sandbox_endpoints\":{ \"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/2\" }, \"production_endpoints\":{ \"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/3\" }, \"sandbox_failovers\":[ { \"endpoint_type\":\"http\", \"template_not_supported\":false, \"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/4\" } ] } `Default Endpoint` { \"endpoint_type\":\"default\", \"sandbox_endpoints\":{ \"url\":\"default\" }, \"production_endpoints\":{ \"url\":\"default\" } } `Endpoint from Endpoint Registry` { \"endpoint_type\": \"Registry\", \"endpoint_id\": \"{registry-name:entry-name:version}\", } | [optional]
**endpointImplementationType** | [**EndpointImplementationTypeEnum**](#EndpointImplementationTypeEnum) | | [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Name | Type | Description | Notes
**businessInformation** | [**APIProductBusinessInformationDTO**](APIProductBusinessInformationDTO.md) | | [optional]
**corsConfiguration** | [**APICorsConfigurationDTO**](APICorsConfigurationDTO.md) | | [optional]
**createdTime** | **String** | | [optional]
**lastUpdatedTimestamp** | **String** | | [optional]
**lastUpdatedTime** | **String** | | [optional]
**gatewayVendor** | **String** | | [optional]
**apis** | [**List<ProductAPIDTO>**](ProductAPIDTO.md) | APIs and resources in the API Product. | [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,10 @@ public AccessControlEnum read(final JsonReader jsonReader) throws IOException {
@SerializedName(SERIALIZED_NAME_CREATED_TIME)
private String createdTime;

public static final String SERIALIZED_NAME_LAST_UPDATED_TIMESTAMP = "lastUpdatedTimestamp";
@SerializedName(SERIALIZED_NAME_LAST_UPDATED_TIMESTAMP)
private String lastUpdatedTimestamp;

public static final String SERIALIZED_NAME_LAST_UPDATED_TIME = "lastUpdatedTime";
@SerializedName(SERIALIZED_NAME_LAST_UPDATED_TIME)
private String lastUpdatedTime;
Expand Down Expand Up @@ -1556,6 +1560,29 @@ public void setCreatedTime(String createdTime) {
}


public APIDTO lastUpdatedTimestamp(String lastUpdatedTimestamp) {

this.lastUpdatedTimestamp = lastUpdatedTimestamp;
return this;
}

/**
* Get lastUpdatedTimestamp
* @return lastUpdatedTimestamp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")

public String getLastUpdatedTimestamp() {
return lastUpdatedTimestamp;
}


public void setLastUpdatedTimestamp(String lastUpdatedTimestamp) {
this.lastUpdatedTimestamp = lastUpdatedTimestamp;
}


public APIDTO lastUpdatedTime(String lastUpdatedTime) {

this.lastUpdatedTime = lastUpdatedTime;
Expand Down Expand Up @@ -1884,6 +1911,7 @@ public boolean equals(Object o) {
Objects.equals(this.websubSubscriptionConfiguration, API.websubSubscriptionConfiguration) &&
Objects.equals(this.workflowStatus, API.workflowStatus) &&
Objects.equals(this.createdTime, API.createdTime) &&
Objects.equals(this.lastUpdatedTimestamp, API.lastUpdatedTimestamp) &&
Objects.equals(this.lastUpdatedTime, API.lastUpdatedTime) &&
Objects.equals(this.endpointConfig, API.endpointConfig) &&
Objects.equals(this.endpointImplementationType, API.endpointImplementationType) &&
Expand All @@ -1900,7 +1928,7 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(id, name, description, context, version, provider, lifeCycleStatus, wsdlInfo, wsdlUrl, responseCachingEnabled, cacheTimeout, hasThumbnail, isDefaultVersion, isRevision, revisionedApiId, revisionId, enableSchemaValidation, enableSubscriberVerification, type, audience, transport, tags, policies, apiThrottlingPolicy, authorizationHeader, securityScheme, maxTps, visibility, visibleRoles, visibleTenants, mediationPolicies, subscriptionAvailability, subscriptionAvailableTenants, additionalProperties, additionalPropertiesMap, monetization, accessControl, accessControlRoles, businessInformation, corsConfiguration, websubSubscriptionConfiguration, workflowStatus, createdTime, lastUpdatedTime, endpointConfig, endpointImplementationType, scopes, operations, threatProtectionPolicies, categories, keyManagers, serviceInfo, advertiseInfo, gatewayVendor, asyncTransportProtocols);
return Objects.hash(id, name, description, context, version, provider, lifeCycleStatus, wsdlInfo, wsdlUrl, responseCachingEnabled, cacheTimeout, hasThumbnail, isDefaultVersion, isRevision, revisionedApiId, revisionId, enableSchemaValidation, enableSubscriberVerification, type, audience, transport, tags, policies, apiThrottlingPolicy, authorizationHeader, securityScheme, maxTps, visibility, visibleRoles, visibleTenants, mediationPolicies, subscriptionAvailability, subscriptionAvailableTenants, additionalProperties, additionalPropertiesMap, monetization, accessControl, accessControlRoles, businessInformation, corsConfiguration, websubSubscriptionConfiguration, workflowStatus, createdTime, lastUpdatedTimestamp, lastUpdatedTime, endpointConfig, endpointImplementationType, scopes, operations, threatProtectionPolicies, categories, keyManagers, serviceInfo, advertiseInfo, gatewayVendor, asyncTransportProtocols);
}


Expand Down Expand Up @@ -1951,6 +1979,7 @@ public String toString() {
sb.append(" websubSubscriptionConfiguration: ").append(toIndentedString(websubSubscriptionConfiguration)).append("\n");
sb.append(" workflowStatus: ").append(toIndentedString(workflowStatus)).append("\n");
sb.append(" createdTime: ").append(toIndentedString(createdTime)).append("\n");
sb.append(" lastUpdatedTimestamp: ").append(toIndentedString(lastUpdatedTimestamp)).append("\n");
sb.append(" lastUpdatedTime: ").append(toIndentedString(lastUpdatedTime)).append("\n");
sb.append(" endpointConfig: ").append(toIndentedString(endpointConfig)).append("\n");
sb.append(" endpointImplementationType: ").append(toIndentedString(endpointImplementationType)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,10 @@ public SubscriptionAvailabilityEnum read(final JsonReader jsonReader) throws IOE
@SerializedName(SERIALIZED_NAME_CREATED_TIME)
private String createdTime;

public static final String SERIALIZED_NAME_LAST_UPDATED_TIMESTAMP = "lastUpdatedTimestamp";
@SerializedName(SERIALIZED_NAME_LAST_UPDATED_TIMESTAMP)
private String lastUpdatedTimestamp;

public static final String SERIALIZED_NAME_LAST_UPDATED_TIME = "lastUpdatedTime";
@SerializedName(SERIALIZED_NAME_LAST_UPDATED_TIME)
private String lastUpdatedTime;
Expand Down Expand Up @@ -1147,6 +1151,29 @@ public void setCreatedTime(String createdTime) {
}


public APIProductDTO lastUpdatedTimestamp(String lastUpdatedTimestamp) {

this.lastUpdatedTimestamp = lastUpdatedTimestamp;
return this;
}

/**
* Get lastUpdatedTimestamp
* @return lastUpdatedTimestamp
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")

public String getLastUpdatedTimestamp() {
return lastUpdatedTimestamp;
}


public void setLastUpdatedTimestamp(String lastUpdatedTimestamp) {
this.lastUpdatedTimestamp = lastUpdatedTimestamp;
}


public APIProductDTO lastUpdatedTime(String lastUpdatedTime) {

this.lastUpdatedTime = lastUpdatedTime;
Expand Down Expand Up @@ -1327,6 +1354,7 @@ public boolean equals(Object o) {
Objects.equals(this.businessInformation, apIProduct.businessInformation) &&
Objects.equals(this.corsConfiguration, apIProduct.corsConfiguration) &&
Objects.equals(this.createdTime, apIProduct.createdTime) &&
Objects.equals(this.lastUpdatedTimestamp, apIProduct.lastUpdatedTimestamp) &&
Objects.equals(this.lastUpdatedTime, apIProduct.lastUpdatedTime) &&
Objects.equals(this.gatewayVendor, apIProduct.gatewayVendor) &&
Objects.equals(this.apis, apIProduct.apis) &&
Expand All @@ -1337,7 +1365,7 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(id, name, context, description, provider, hasThumbnail, state, enableSchemaValidation, isRevision, revisionedApiProductId, revisionId, responseCachingEnabled, cacheTimeout, visibility, visibleRoles, visibleTenants, accessControl, accessControlRoles, apiType, transport, tags, policies, apiThrottlingPolicy, authorizationHeader, securityScheme, subscriptionAvailability, subscriptionAvailableTenants, additionalProperties, additionalPropertiesMap, monetization, businessInformation, corsConfiguration, createdTime, lastUpdatedTime, gatewayVendor, apis, scopes, categories, workflowStatus);
return Objects.hash(id, name, context, description, provider, hasThumbnail, state, enableSchemaValidation, isRevision, revisionedApiProductId, revisionId, responseCachingEnabled, cacheTimeout, visibility, visibleRoles, visibleTenants, accessControl, accessControlRoles, apiType, transport, tags, policies, apiThrottlingPolicy, authorizationHeader, securityScheme, subscriptionAvailability, subscriptionAvailableTenants, additionalProperties, additionalPropertiesMap, monetization, businessInformation, corsConfiguration, createdTime, lastUpdatedTimestamp, lastUpdatedTime, gatewayVendor, apis, scopes, categories, workflowStatus);
}


Expand Down Expand Up @@ -1378,6 +1406,7 @@ public String toString() {
sb.append(" businessInformation: ").append(toIndentedString(businessInformation)).append("\n");
sb.append(" corsConfiguration: ").append(toIndentedString(corsConfiguration)).append("\n");
sb.append(" createdTime: ").append(toIndentedString(createdTime)).append("\n");
sb.append(" lastUpdatedTimestamp: ").append(toIndentedString(lastUpdatedTimestamp)).append("\n");
sb.append(" lastUpdatedTime: ").append(toIndentedString(lastUpdatedTime)).append("\n");
sb.append(" gatewayVendor: ").append(toIndentedString(gatewayVendor)).append("\n");
sb.append(" apis: ").append(toIndentedString(apis)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8839,6 +8839,8 @@ components:
example: APPROVED
createdTime:
type: string
lastUpdatedTimestamp:
type: string
lastUpdatedTime:
type: string
x-otherScopes:
Expand Down Expand Up @@ -9409,6 +9411,8 @@ components:
$ref: '#/components/schemas/APICorsConfiguration'
createdTime:
type: string
lastUpdatedTimestamp:
type: string
lastUpdatedTime:
type: string
gatewayVendor:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void testCreateAnAPIThroughThePublisherRest() throws Exception {
assertTrue(response.getData().contains(apiNameTest), "Invalid API Name");
assertTrue(response.getData().contains(apiVersion), "Invalid API Version");
assertTrue(response.getData().contains(apiContextTest), "Invalid API Context");

assertTrue(response.getData().contains("lastUpdatedTimestamp"), "Last Updated Timestamp is not available");
}

@Test(groups = {"wso2.am"}, description = "Remove an API Through the Publisher Rest API",
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,7 @@
<carbon.apimgt.ui.version>9.0.432</carbon.apimgt.ui.version>

<!-- APIM Component Version -->
<carbon.apimgt.version>9.28.149</carbon.apimgt.version>
<carbon.apimgt.version>9.28.153</carbon.apimgt.version>

<carbon.apimgt.imp.pkg.version>[9.0.0, 10.0.0)</carbon.apimgt.imp.pkg.version>

Expand Down

0 comments on commit 53e4ceb

Please sign in to comment.