Class RestAPIPublisherImpl

java.lang.Object
org.wso2.am.integration.test.impl.RestAPIPublisherImpl

public class RestAPIPublisherImpl extends Object
This util class performs the actions related to APIDTOobjects.
  • Field Details

  • Constructor Details

    • RestAPIPublisherImpl

      @Deprecated public RestAPIPublisherImpl()
      Deprecated.
    • RestAPIPublisherImpl

      public RestAPIPublisherImpl(String username, String password, String tenantDomain, String publisherURL)
  • Method Details

    • getAccessToken

      public String getAccessToken()
    • setAccessToken

      public void setAccessToken(String accessToken)
    • addAPI

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addAPI(APIRequest apiRequest) throws ApiException
      \ This method is used to create an API.
      Parameters:
      apiRequest -
      Returns:
      HttpResponse
      Throws:
      ApiException - throws of an error occurred when creating the API.
    • addAPIWithMalformedContext

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addAPIWithMalformedContext(APIRequest apiRequest)
    • addAPI

      public APIDTO addAPI(APIRequest apiRequest, String osVersion) throws ApiException
      \ This method is used to create an API.
      Parameters:
      apiRequest -
      Returns:
      HttpResponse
      Throws:
      ApiException - throws of an error occurred when creating the API.
    • addAPI

      public APIDTO addAPI(APIDTO apidto, String osVersion) throws ApiException
      Throws:
      ApiException
    • updateAPIThumbnail

      public FileInfoDTO updateAPIThumbnail(String apiId, File file) throws ApiException
      Throws:
      ApiException
    • createNewAPIVersion

      public String createNewAPIVersion(String newVersion, String apiId, boolean defaultVersion) throws ApiException
      This method is used to create a new API of the existing API.
      Parameters:
      newVersion - new API version
      apiId - old API ID
      defaultVersion - is this the
      Returns:
      apiID of the newly created api version.
      Throws:
      ApiException - Throws if an error occurs when creating the new API version.
    • changeAPILifeCycleStatus

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse changeAPILifeCycleStatus(String apiId, String action, String lifecycleChecklist) throws ApiException, APIManagerIntegrationTestException
      This method is used to publish the created API.
      Parameters:
      apiId - API id that need to published. return ApiResponse change response.
      action - API id that need to published.
      Throws:
      ApiException - throws if an error occurred when publishing the API.
      APIManagerIntegrationTestException
    • changeAPILifeCycleStatus

      public WorkflowResponseDTO changeAPILifeCycleStatus(String apiId, String action) throws ApiException, APIManagerIntegrationTestException
      Throws:
      ApiException
      APIManagerIntegrationTestException
    • deprecateAPI

      public void deprecateAPI(String apiId) throws ApiException
      This method is used to deprecate the created API.
      Parameters:
      apiId - API id that need to published.
      Throws:
      ApiException - throws if an error occurred when publishing the API.
    • deployPrototypeAPI

      public void deployPrototypeAPI(String apiId) throws ApiException
      This method is used to deploy the api as a prototype.
      Parameters:
      apiId - API id that need to be prototyped.
      Throws:
      ApiException - throws if an error occurred when publishing the API.
    • blockAPI

      public void blockAPI(String apiId) throws ApiException
      This method is used to block the created API.
      Parameters:
      apiId - API id that need to published.
      Throws:
      ApiException - throws if an error occurred when publishing the API.
    • getLifecycleStatus

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getLifecycleStatus(String apiId) throws ApiException
      Throws:
      ApiException
    • getLifecycleStatusDTO

      public LifecycleStateDTO getLifecycleStatusDTO(String apiId) throws ApiException
      Throws:
      ApiException
    • getLifecycleHistory

      public LifecycleHistoryDTO getLifecycleHistory(String apiId) throws ApiException
      Throws:
      ApiException
    • copyAPI

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse copyAPI(String newVersion, String apiId, Boolean isDefault) throws ApiException
      copy API from existing API
      Parameters:
      newVersion - - new version of the API
      apiId - - existing API Id
      isDefault - - make the default version
      Returns:
      - http response object
      Throws:
      APIManagerIntegrationTestException - - Throws if error occurred at API copy operation
      ApiException
    • copyAPIProduct

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse copyAPIProduct(String newVersion, String apiProductId, Boolean isDefault) throws ApiException
      copy API from existing API Product
      Parameters:
      newVersion - - new version of the API Product
      apiProductId - - existing API Product Id
      isDefault - - make the default version
      Returns:
      - http response object
      Throws:
      APIManagerIntegrationTestException - - Throws if error occurred at API Product copy operation
      ApiException
    • copyAPIWithReturnDTO

      public APIDTO copyAPIWithReturnDTO(String newVersion, String apiId, Boolean isDefault) throws ApiException
      Parameters:
      newVersion -
      apiId -
      isDefault -
      Returns:
      Throws:
      ApiException
    • addSequenceBackend

      public void addSequenceBackend(File file, String apiId, String type) throws ApiException
      Add Sequence Backend to the API Endpoint
      Parameters:
      file - Sequence Backend file
      apiId - APIID
      type - Key Type
      Throws:
      ApiException - API Exception if an error occurs
    • updateAPI

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse updateAPI(APIRequest apiRequest, String apiId) throws ApiException
      Facilitate update API
      Parameters:
      apiRequest - - constructed API request object
      Returns:
      http response object
      Throws:
      APIManagerIntegrationTestException - - throws if update API fails
      ApiException
    • updateAPI

      public APIDTO updateAPI(APIDTO apidto, String apiId) throws ApiException
      Throws:
      ApiException
    • getAPI

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAPI(String apiId) throws ApiException
      Method to get API information
      Parameters:
      apiId - - API id
      Returns:
      http response object
      Throws:
      ApiException - - Throws if api information cannot be retrieved.
    • deleteAPI

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse deleteAPI(String apiId) throws ApiException
      delete API
      Parameters:
      apiId - - API id
      Returns:
      http response object
      Throws:
      ApiException - - Throws if API delete fails
    • generateMockScript

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse generateMockScript(String apiId) throws ApiException
      Throws:
      ApiException
    • getGenerateMockScript

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getGenerateMockScript(String apiId) throws ApiException
      Throws:
      ApiException
    • removeDocumentation

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse removeDocumentation(String apiId, String docId) throws ApiException
      Remove document
      Parameters:
      apiId - - API id
      docId - - document id
      Returns:
      http response object
      Throws:
      ApiException - - Throws if remove API document fails
    • revokeAccessToken

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse revokeAccessToken(String accessToken, String consumerKey, String authUser) throws APIManagerIntegrationTestException
      revoke access token
      Parameters:
      accessToken - - access token already received
      consumerKey - - consumer key returned
      authUser - - user name
      Returns:
      http response object
      Throws:
      APIManagerIntegrationTestException - - throws if access token revoke fails
    • updatePermissions

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse updatePermissions(String tierName, String permissionType, String roles) throws APIManagerIntegrationTestException
      update permissions to API access
      Parameters:
      tierName - - name of api throttling tier
      permissionType - - permission type
      roles - - roles of permission
      Returns:
      http response object
      Throws:
      APIManagerIntegrationTestException - - throws if permission update fails
    • updateResourceOfAPI

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse updateResourceOfAPI(String apiId, String api) throws APIManagerIntegrationTestException
      Update resources of API
      Parameters:
      apiId - - API Id
      Returns:
      http response object
      Throws:
      APIManagerIntegrationTestException - - throws if API resource update fails
    • checkValidEndpoint

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse checkValidEndpoint(String endpointUrl, String apiId) throws ApiException
      Check whether the Endpoint is valid
      Parameters:
      endpointUrl - url of the endpoint
      apiId - id of the api which the endpoint to be validated
      Returns:
      HttpResponse - Response of the getAPI request
      Throws:
      ApiException - - Check for valid endpoint fails.
    • changeAPILifeCycleStatusToPublish

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse changeAPILifeCycleStatusToPublish(String apiId, boolean isRequireReSubscription) throws ApiException
      Change the API Lifecycle status to Publish with the option of Re-subscription is required or not
      Parameters:
      apiId - - API ID
      isRequireReSubscription - - true if Re-subscription is required else false.
      Returns:
      HttpResponse - Response of the API publish event
      Throws:
      APIManagerIntegrationTestException - - Exception Throws in checkAuthentication() and when do the REST service calls to do the lifecycle change.
      ApiException
    • getTierPermissionsPage

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getTierPermissionsPage() throws APIManagerIntegrationTestException
      Retrieve the Tier Permission Page
      Returns:
      HttpResponse - Response that contains the Tier Permission Page
      Throws:
      APIManagerIntegrationTestException - - Exception throws from checkAuthentication() method and HTTPSClientUtils.doGet() method call
    • addDocument

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addDocument(String apiId, DocumentDTO body) throws ApiException
      Adding a documentation
      Parameters:
      apiId - - Id of the API.
      body - - document Body.
      Returns:
      HttpResponse - Response with Document adding result.
      Throws:
      ApiException - - Exception throws if error occurred when adding document.
    • addContentDocument

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addContentDocument(String apiId, String docId, String docContent) throws ApiException
      Adding a content to the document
      Parameters:
      apiId - - Id of the API.
      docId - - document Id.
      docContent - - document content
      Returns:
      HttpResponse - Response with Document adding result.
      Throws:
      ApiException - - Exception throws if error occurred when adding document.
    • updateContentDocument

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse updateContentDocument(String apiId, String docId, File docContent) throws ApiException
      Updating the document content using file
      Parameters:
      apiId - - Id of the API.
      docId - - document Id.
      docContent - - file content
      Returns:
      HttpResponse - Response with Document adding result.
      Throws:
      ApiException - - Exception throws if error occurred when adding document.
    • updateDocument

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse updateDocument(String apiId, String docId, DocumentDTO documentDTO) throws ApiException
      Update API document.
      Parameters:
      apiId - api Id
      docId - document Id
      documentDTO - documentation object.
      Returns:
      Throws:
      ApiException - Exception throws if error occurred when updating document.
    • getDocuments

      public DocumentListDTO getDocuments(String apiId) throws ApiException
      This method is used to get documents Get Documents for the given limit and offset values
      Parameters:
      apiId - apiId
      Returns:
      Documents for the given limit and offset values
      Throws:
      ApiException
    • getDocumentContent

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getDocumentContent(String apiId, String documentId) throws ApiException
      This method is used to get the content of API documents
      Parameters:
      apiId - UUID of the API
      documentId - UUID of the API document
      Returns:
      Throws:
      ApiException
    • deleteDocument

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse deleteDocument(String apiId, String documentId) throws ApiException
      delete Document
      Parameters:
      apiId - - API id
      documentId - - API id
      Returns:
      http response object
      Throws:
      ApiException - - Throws if API delete fails
    • addSharedScope

      public ScopeDTO addSharedScope(ScopeDTO scopeDTO) throws ApiException
      Add a shared scope
      Parameters:
      scopeDTO -
      Returns:
      ScopeDTO - Returns the added shared scope
      Throws:
      ApiException
    • removeSharedScope

      public void removeSharedScope(String id) throws ApiException
      Remove a shared scope
      Parameters:
      id - id of the scope to delete
      Throws:
      ApiException
    • updateSharedScope

      public ScopeDTO updateSharedScope(String uuid, ScopeDTO scopeDTO) throws ApiException
      Update a shared scopes
      Parameters:
      uuid -
      scopeDTO -
      Returns:
      ScopeDTO - Returns the updated shared scope
      Throws:
      ApiException
    • getSharedScopeById

      public ScopeDTO getSharedScopeById(String uuid) throws ApiException
      Get a shared scope
      Parameters:
      uuid -
      Returns:
      ScopeDTO - Returns the updated shared scope
      Throws:
      ApiException
    • deleteSharedScope

      public void deleteSharedScope(String uuid) throws ApiException
      Delete a shared scope
      Parameters:
      uuid -
      Throws:
      ApiException
    • getAllSharedScopes

      public ScopeListDTO getAllSharedScopes() throws ApiException
      Get all shared scopes
      Returns:
      ScopeListDTO - Returns all the shared scopes
      Throws:
      ApiException
    • getAllAPIs

      Retrieve the All APIs available for the user in Publisher.
      Returns:
      HttpResponse - Response that contains all available APIs for the user
      Throws:
      APIManagerIntegrationTestException - - Exception throws from checkAuthentication() method and HTTPSClientUtils.doGet() method call
      ApiException
    • searchAPIs

      public SearchResultListDTO searchAPIs(String query) throws ApiException
      Retrieve the APIs according to the search query in Publisher.
      Parameters:
      query - - The query on which the APIs needs to be filtered
      Returns:
      SearchResultListDTO - The search results of the query
      Throws:
      ApiException
    • getAPIs

      public APIListDTO getAPIs(int offset, int limit) throws ApiException
      This method is used to upload endpoint certificates Get APIs for the given limit and offset values
      Parameters:
      offset - starting position
      limit - maximum number of APIs to return
      Returns:
      APIs for the given limit and offset values
      Throws:
      ApiException
    • uploadEndpointCertificate

      public ApiResponse<CertMetadataDTO> uploadEndpointCertificate(File certificate, String alias, String endpoint) throws ApiException
      This method is used to upload certificates
      Parameters:
      certificate - certificate
      alias - alis
      endpoint - endpoint.
      Returns:
      Throws:
      ApiException - if an error occurred while uploading the certificate.
    • getTiers

      public ThrottlingPolicyListDTO getTiers(String policyLevel) throws ApiException
      This method is used to get all throttling tiers.
      Returns:
      - Response that contains all the available tiers
      Throws:
      ApiException
    • getSubscriptionPolicies

      public SubscriptionPolicyListDTO getSubscriptionPolicies(String tierQuotaTypes) throws ApiException
      Throws:
      ApiException
    • validateRoles

      public ApiResponse<Void> validateRoles(String roleId) throws ApiException
      This method is used to validate roles.
      Parameters:
      roleId - role Id
      Returns:
      HttpResponse
      Throws:
      APIManagerIntegrationTestException
      ApiException
    • getSwaggerByID

      public String getSwaggerByID(String apiId) throws ApiException
      Throws:
      ApiException
    • getAPIProductSwaggerByID

      public String getAPIProductSwaggerByID(String apiProductId) throws ApiException
      Throws:
      ApiException
    • updateSwagger

      public String updateSwagger(String apiId, String definition) throws ApiException
      Throws:
      ApiException
    • validateOASDefinition

      public OpenAPIDefinitionValidationResponseDTO validateOASDefinition(File oasDefinition) throws ApiException
      Throws:
      ApiException
    • getAPIByID

      public APIDTO getAPIByID(String apiId, String tenantDomain) throws ApiException
      Throws:
      ApiException
    • getAPIByID

      public APIDTO getAPIByID(String apiId) throws ApiException
      Throws:
      ApiException
    • importOASDefinition

      public APIDTO importOASDefinition(File file, String properties) throws ApiException
      Throws:
      ApiException
    • createMCPServerFromOpenAPI

      public MCPServerDTO createMCPServerFromOpenAPI(File file, String properties) throws ApiException
      Throws:
      ApiException
    • createMCPServerFromAPI

      public MCPServerDTO createMCPServerFromAPI(MCPServerDTO mcPServerDTO) throws ApiException
      Throws:
      ApiException
    • createMCPServerProxy

      public MCPServerDTO createMCPServerProxy(MCPServerProxyRequestDTO mcpServerProxyRequest) throws ApiException
      Throws:
      ApiException
    • getMCPServer

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getMCPServer(String mcpServerId)
    • updateMCPServer

      public MCPServerDTO updateMCPServer(String mcpServerId, MCPServerDTO mcPServerDTO) throws ApiException
      Throws:
      ApiException
    • getMCPServerBackend

      public BackendDTO getMCPServerBackend(String mcpServerId, String backendId) throws ApiException
      Throws:
      ApiException
    • updateMCPServerBackend

      public BackendDTO updateMCPServerBackend(String mcpServerId, String backendId, BackendDTO backend) throws ApiException
      Throws:
      ApiException
    • addMCPServerRevision

      public APIRevisionDTO addMCPServerRevision(String mcpServerId, APIRevisionDTO apiRevision) throws ApiException
      Throws:
      ApiException
    • deleteMCPServerRevision

      public APIRevisionListDTO deleteMCPServerRevision(String mcpServerId, String revisionId) throws ApiException
      Throws:
      ApiException
    • getMCPServerRevisions

      public APIRevisionListDTO getMCPServerRevisions(String mcpServerId) throws ApiException
      Throws:
      ApiException
    • deployMCPServerRevision

      public List<APIRevisionDeploymentDTO> deployMCPServerRevision(String mcpServerId, String revisionId, List<APIRevisionDeploymentDTO> revisionDeploymentList) throws ApiException
      Throws:
      ApiException
    • changeMCPServerLifecycle

      public WorkflowResponseDTO changeMCPServerLifecycle(String action, String mcpServerId, String lifecycleChecklist) throws ApiException
      Throws:
      ApiException
    • deleteMCPServer

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse deleteMCPServer(String mcpServerId) throws ApiException
      Throws:
      ApiException
    • importOASDefinitionResponse

      public ApiResponse<APIDTO> importOASDefinitionResponse(File file, String properties) throws ApiException
      Throws:
      ApiException
    • validateGraphqlSchemaDefinition

      public GraphQLValidationResponseDTO validateGraphqlSchemaDefinition(File schemaDefinition) throws ApiException
      Throws:
      ApiException
    • validateGraphqlSchemaDefinitionByURL

      public GraphQLValidationResponseDTO validateGraphqlSchemaDefinitionByURL(String url, Boolean useIntrospection) throws ApiException
      Throws:
      ApiException
    • importGraphqlSchemaDefinition

      public APIDTO importGraphqlSchemaDefinition(File file, String properties) throws ApiException
      Throws:
      ApiException
    • importGraphqlSchemaDefinitionByURL

      public APIDTO importGraphqlSchemaDefinitionByURL(String url, String properties) throws ApiException
      Throws:
      ApiException
    • getGraphqlSchemaDefinition

      public GraphQLSchemaDTO getGraphqlSchemaDefinition(String apiId) throws ApiException
      Throws:
      ApiException
    • updateGraphqlSchemaDefinition

      public void updateGraphqlSchemaDefinition(String apiId, String schemaDefinition) throws ApiException
      Throws:
      ApiException
    • importGraphqlSchemaDefinitionWithInvalidContext

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse importGraphqlSchemaDefinitionWithInvalidContext(File file, String properties) throws ApiException
      Throws:
      ApiException
    • validateWsdlDefinition

      public WSDLValidationResponseDTO validateWsdlDefinition(String url, File wsdlDefinition) throws ApiException
      Throws:
      ApiException
    • importWSDLSchemaDefinition

      public APIDTO importWSDLSchemaDefinition(File file, String url, String properties, String type) throws ApiException
      Throws:
      ApiException
    • getWSDLSchemaDefinitionOfAPI

      public ApiResponse<Void> getWSDLSchemaDefinitionOfAPI(String apiId) throws ApiException
      Throws:
      ApiException
    • importAsyncAPIDefinition

      public ApiResponse<APIDTO> importAsyncAPIDefinition(File file, String properties) throws ApiException
      Throws:
      ApiException
    • getApiResourcePolicies

      public ResourcePolicyListDTO getApiResourcePolicies(String apiId, String sequenceType, String resourcePath, String verb) throws ApiException
      Throws:
      ApiException
    • updateApiResourcePolicies

      public ResourcePolicyInfoDTO updateApiResourcePolicies(String apiId, String resourcePolicyId, String resourcePath, ResourcePolicyInfoDTO resourcePolicyInfoDTO, String verb) throws ApiException
      Throws:
      ApiException
    • validateAsyncAPISchemaDefinition

      public AsyncAPISpecificationValidationResponseDTO validateAsyncAPISchemaDefinition(String url, File file) throws ApiException
      Throws:
      ApiException
    • importAsyncAPISchemaDefinition

      public APIDTO importAsyncAPISchemaDefinition(File file, String url, String properties) throws ApiException
      Throws:
      ApiException
    • getAsyncAPIDefinitionOfAPI

      public ApiResponse<Void> getAsyncAPIDefinitionOfAPI(String apiId) throws ApiException
      Throws:
      ApiException
    • addAPI

      public APIDTO addAPI(APICreationRequestBean apiCreationRequestBean) throws ApiException
      Throws:
      ApiException
    • uploadCertificate

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse uploadCertificate(File certificate, String alias, String apiId, String tier, String keyType) throws ApiException
      This method is used to upload certificates
      Parameters:
      certificate - certificate
      alias - alis
      keyType - key type (whether PRODUCTION or SANDBOX)
      Returns:
      Throws:
      ApiException - if an error occurred while uploading the certificate.
    • updateAPI

      public APIDTO updateAPI(APIDTO apidto) throws ApiException
      Update an API
      Parameters:
      apidto -
      Returns:
      Throws:
      ApiException
    • updateAPIWithHttpInfo

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse updateAPIWithHttpInfo(APIDTO apidto)
      Update an API
      Parameters:
      apidto -
      Returns:
      Throws:
      ApiException
    • getSubscriptionByAPIID

      public SubscriptionListDTO getSubscriptionByAPIID(String apiID) throws ApiException
      Get subscription of an API
      Parameters:
      apiID -
      Returns:
      Throws:
      ApiException
    • getAllApiProducts

      public APIProductListDTO getAllApiProducts() throws ApiException
      Throws:
      ApiException
    • getApiProduct

      public APIProductDTO getApiProduct(String apiProductId) throws ApiException
      Throws:
      ApiException
    • addApiProduct

      public APIProductDTO addApiProduct(APIProductDTO apiProductDTO) throws ApiException
      Throws:
      ApiException
    • deleteApiProduct

      public void deleteApiProduct(String apiProductId) throws ApiException
      Throws:
      ApiException
    • getAuditApi

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAuditApi(String apiId) throws ApiException
      Method to retrieve the Audit Report of an API
      Parameters:
      apiId - apiId of the API
      Returns:
      HttpResponse response
      Throws:
      ApiException
    • getGraphQLSchemaTypeListResponse

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getGraphQLSchemaTypeListResponse(String apiId) throws ApiException
      Method to retrieve the GraphQL Schema Type List
      Parameters:
      apiId - apiId of the API
      Returns:
      HttpResponse response
      Throws:
      ApiException
    • getGraphQLSchemaTypeList

      public GraphQLSchemaTypeListDTO getGraphQLSchemaTypeList(String apiId) throws ApiException
      Method to retrieve the GraphQL Schema Type List
      Parameters:
      apiId - apiId of the API
      Returns:
      GraphQLSchemaTypeListDTO GraphQLSchemaTypeList object
      Throws:
      ApiException
    • addGraphQLComplexityDetails

      public void addGraphQLComplexityDetails(GraphQLQueryComplexityInfoDTO graphQLQueryComplexityInfoDTO, String apiID) throws ApiException
      Method to add GraphQL Complexity Info of an API
      Parameters:
      graphQLQueryComplexityInfoDTO - GraphQL Complexity Object
      apiID -
      Throws:
      ApiException
    • getGraphQLComplexityResponse

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getGraphQLComplexityResponse(String apiId) throws ApiException
      Method to retrieve the GraphQL Complexity Details
      Parameters:
      apiId - apiId of the API
      Returns:
      HttpResponse response
      Throws:
      ApiException
    • addAPIRevision

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addAPIRevision(APIRevisionRequest apiRevisionRequest) throws ApiException
      This method is used to create an API Revision.
      Parameters:
      apiRevisionRequest - API Revision create object body
      Returns:
      HttpResponse
      Throws:
      ApiException - throws of an error occurred when creating the API Revision.
    • addAPIRevision

      public APIRevisionDTO addAPIRevision(String apiId) throws ApiException
      This method is used to create an API Revision.
      Parameters:
      apiId - API Revision create object body
      Returns:
      HttpResponse
      Throws:
      ApiException - throws of an error occurred when creating the API Revision.
    • getAPIRevisions

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAPIRevisions(String apiUUID, String query) throws ApiException
      Method to get API Revisions per API
      Parameters:
      apiUUID - - API uuid
      query - - Search query
      Returns:
      http response object
      Throws:
      ApiException - - Throws if api information cannot be retrieved.
    • deployAPIRevision

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse deployAPIRevision(String apiUUID, String revisionUUID, List<APIRevisionDeployUndeployRequest> apiRevisionDeployRequestList, String apiType) throws ApiException, APIManagerIntegrationTestException
      This method is used to deploy API Revision to Gateways.
      Parameters:
      apiRevisionDeployRequestList - API Revision deploy object body
      Returns:
      HttpResponse
      Throws:
      ApiException - throws of an error occurred when creating the API Revision.
      APIManagerIntegrationTestException
    • deployAPIRevision

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse deployAPIRevision(String apiUUID, String revisionUUID, APIRevisionDeployUndeployRequest apiRevisionDeployRequest, String apiType) throws ApiException, APIManagerIntegrationTestException
      This method is used to deploy API Revision to Gateways.
      Parameters:
      apiUUID - UUID of API
      revisionUUID - UUID of API Revision
      apiRevisionDeployRequest - API Revision deploy object body
      apiType - API Type
      Returns:
      HttpResponse
      Throws:
      ApiException - throws of an error occurred when creating the API Revision.
      APIManagerIntegrationTestException
    • undeployAPIRevision

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse undeployAPIRevision(String apiUUID, String revisionUUID, List<APIRevisionDeployUndeployRequest> apiRevisionUndeployRequestList) throws ApiException, APIManagerIntegrationTestException
      This method is used to undeploy API Revision to Gateways.
      Parameters:
      apiUUID - API UUID
      revisionUUID - API Revision UUID
      apiRevisionUndeployRequestList - API Revision undeploy object body
      Returns:
      HttpResponse
      Throws:
      ApiException - throws of an error occurred when undeploying the API Revision.
      APIManagerIntegrationTestException
    • restoreAPIRevision

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse restoreAPIRevision(String apiUUID, String revisionUUID) throws ApiException
      This method is used to restore an API Revision.
      Parameters:
      apiUUID - API UUID
      revisionUUID - API Revision UUID
      Returns:
      HttpResponse
      Throws:
      ApiException - throws of an error occurred when creating the API Revision.
    • deleteAPIRevision

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse deleteAPIRevision(String apiUUID, String revisionUUID) throws ApiException
      This method is used to delete an API Revision.
      Parameters:
      apiUUID - API UUID
      revisionUUID - API Revision UUID
      Returns:
      HttpResponse
      Throws:
      ApiException - throws of an error occurred when creating the API Revision.
    • addAPIProductRevision

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addAPIProductRevision(APIRevisionRequest apiRevisionRequest) throws ApiException
      This method is used to create an API Product Revision.
      Parameters:
      apiRevisionRequest - API Revision create object body
      Returns:
      HttpResponse
      Throws:
      ApiException - throws of an error occurred when creating the API Revision.
    • getAPIProductRevisions

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAPIProductRevisions(String apiUUID, String query) throws ApiException
      Method to get API Product Revisions per API
      Parameters:
      apiUUID - - API uuid
      query - - Search query
      Returns:
      http response object
      Throws:
      ApiException - - Throws if api information cannot be retrieved.
    • deployAPIProductRevision

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse deployAPIProductRevision(String apiUUID, String revisionUUID, List<APIRevisionDeployUndeployRequest> apiRevisionDeployRequestList, String apiType) throws ApiException, APIManagerIntegrationTestException
      This method is used to deploy API Product Revision to Gateways.
      Parameters:
      apiRevisionDeployRequestList - API Revision deploy object body
      Returns:
      HttpResponse
      Throws:
      ApiException - throws of an error occurred when creating the API Revision.
      APIManagerIntegrationTestException
    • undeployAPIProductRevision

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse undeployAPIProductRevision(String apiUUID, String revisionUUID, List<APIRevisionDeployUndeployRequest> apiRevisionUndeployRequestList) throws ApiException, APIManagerIntegrationTestException
      This method is used to undeploy API Product Revision to Gateways.
      Parameters:
      apiUUID - API UUID
      revisionUUID - API Revision UUID
      apiRevisionUndeployRequestList - API Revision undeploy object body
      Returns:
      HttpResponse
      Throws:
      ApiException - throws of an error occurred when undeploying the API Revision.
      APIManagerIntegrationTestException
    • restoreAPIProductRevision

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse restoreAPIProductRevision(String apiUUID, String revisionUUID) throws ApiException
      This method is used to restore an API Product Revision.
      Parameters:
      apiUUID - API UUID
      revisionUUID - API Revision UUID
      Returns:
      HttpResponse
      Throws:
      ApiException - throws of an error occurred when creating the API Revision.
    • deleteAPIProductRevision

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse deleteAPIProductRevision(String apiUUID, String revisionUUID) throws ApiException
      This method is used to delete an API product Revision.
      Parameters:
      apiUUID - API UUID
      revisionUUID - API Revision UUID
      Returns:
      HttpResponse
      Throws:
      ApiException - throws of an error occurred when creating the API Revision.
    • generateInternalApiKey

      public ApiResponse<APIKeyDTO> generateInternalApiKey(String apiId) throws ApiException
      Throws:
      ApiException
    • addComment

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addComment(String apiId, String comment, String category, String replyTo) throws ApiException
      Add comment to given API
      Parameters:
      apiId - api Id
      comment - comment to add
      category - category of the comment
      replyTo - comment id of the root comment to add replies
      Returns:
      http response of add comment
      Throws:
      ApiException - throws if add comment fails
    • getComment

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getComment(String commentId, String apiId, String tenantDomain, boolean includeCommentorInfo, Integer limit, Integer offset) throws ApiException
      Get Comment from given API
      Parameters:
      commentId - comment Id
      apiId - api Id
      tenantDomain - tenant domain
      limit - for pagination
      offset - for pagination
      Returns:
      http response get comment
      Throws:
      ApiException - throws if get comment fails
    • getComments

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getComments(String apiId, String tenantDomain, boolean includeCommentorInfo, Integer limit, Integer offset) throws ApiException
      Get all the comments from given API
      Parameters:
      apiId - api Id
      tenantDomain - tenant domain
      limit - for pagination
      offset - for pagination
      Returns:
      http response get comment
      Throws:
      ApiException - throws if get comment fails
    • getReplies

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getReplies(String commentId, String apiId, String tenantDomain, boolean includeCommentorInfo, Integer limit, Integer offset) throws ApiException
      Get replies of a comment from given API
      Parameters:
      commentId - comment Id
      apiId - api Id
      tenantDomain - tenant domain
      limit - for pagination
      offset - for pagination
      Returns:
      http response get comment
      Throws:
      ApiException - throws if get comment fails
    • editComment

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse editComment(String commentId, String apiId, String comment, String category) throws ApiException
      Get Comment from given API
      Parameters:
      commentId - comment Id
      apiId - api Id
      comment - comment to add
      category - category of the comment
      Returns:
      http response get comment
      Throws:
      ApiException - throws if get comment fails
    • removeComment

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse removeComment(String commentId, String apiId) throws ApiException
      Remove comment in given API
      Parameters:
      commentId - comment Id
      apiId - api Id
      Throws:
      ApiException - throws if remove comment fails
    • updateAPIProduct

      public ApiResponse<APIProductDTO> updateAPIProduct(APIProductDTO apiProductDTO) throws ApiException
      Throws:
      ApiException
    • getEndpointCertificiates

      public CertificatesDTO getEndpointCertificiates(String endpoint, String alias) throws ApiException
      Throws:
      ApiException
    • getendpointCertificateContent

      public CertificateInfoDTO getendpointCertificateContent(String alias) throws ApiException
      Throws:
      ApiException
    • deleteEndpointCertificate

      public ApiResponse<Void> deleteEndpointCertificate(String alias) throws ApiException
      Throws:
      ApiException
    • changeAPIProductLifeCycleStatus

      public WorkflowResponseDTO changeAPIProductLifeCycleStatus(String apiProductId, String action, String lifecycleChecklist) throws ApiException, APIManagerIntegrationTestException
      Change the lifecycle status of API Product
      Parameters:
      apiProductId - UUID of api product
      action - Lifecycle state change action
      lifecycleChecklist - Lifecycle check list
      Returns:
      WorkflowResponseDTO object
      Throws:
      ApiException - If error when changing the lifecycle state of api product
      APIManagerIntegrationTestException
    • getLifecycleStatusOfApiProduct

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getLifecycleStatusOfApiProduct(String apiProductId) throws ApiException
      Get lifecycle state information of an API Product
      Parameters:
      apiProductId - UUID of API Product
      Returns:
      Http Response object
      Throws:
      ApiException - If error when retrieving the lifecycle state information of an api product
    • getLifecycleHistoryOfApiProduct

      public LifecycleHistoryDTO getLifecycleHistoryOfApiProduct(String apiProductId) throws ApiException
      Get lifecycle state change history of an API Product
      Parameters:
      apiProductId - UUID of API Product
      Returns:
      LifecycleHistoryDTO object
      Throws:
      ApiException - If error when retrieving the lifecycle state change history of API Product
    • getAllCommonOperationPolicies

      public Map<String,String> getAllCommonOperationPolicies() throws ApiException
      Method to get all common operation policies
      Returns:
      A map of policy name and policy UUID
      Throws:
      ApiException - - Throws if policy information cannot be retrieved.
    • getAllCommonOperationPolicies

      public Map<String,String> getAllCommonOperationPolicies(Integer limit, Integer offset, String query) throws ApiException
      Method to get all common operation policies passing limit, offset and query as parameters
      Parameters:
      limit - limit
      offset - offset
      query - query
      Returns:
      A map of policy name and policy UUID
      Throws:
      ApiException - - Throws if policy information cannot be retrieved.
    • getAllCommonOperationPolicies

      public Map<String,String> getAllCommonOperationPolicies(int limit) throws ApiException
      Throws:
      ApiException
    • getAllAPISpecificOperationPolicies

      public Map<String,String> getAllAPISpecificOperationPolicies(String apiId) throws ApiException
      Method to get all API specific operation policies
      Parameters:
      apiId - - API uuid
      Returns:
      A map of policy name and policy UUID
      Throws:
      ApiException - - Throws if policy information cannot be retrieved.
    • getCommonOperationPolicy

      public OperationPolicyDataDTO getCommonOperationPolicy(String policyId) throws ApiException
      Method to get Common operation policy by PolicyID
      Parameters:
      policyId - - PolicyUUID
      Returns:
      OperationPolicyDataDTO
      Throws:
      ApiException - - Throws if policy information cannot be retrieved.
    • getAPISpecificOperationPolicy

      public OperationPolicyDataDTO getAPISpecificOperationPolicy(String policyId, String apiId) throws ApiException
      Method to get API specific operation policy by policyId
      Parameters:
      policyId - - PolicyUUID
      Returns:
      OperationPolicyDataDTO
      Throws:
      ApiException - - Throws if policy information cannot be retrieved.
    • addCommonOperationPolicy

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addCommonOperationPolicy(File policySpecFile, File synapsePolicyDefinitionFile, File ccPolicyDefinitionFile) throws ApiException
      Add common operation policy
      Parameters:
      policySpecFile - - Policy specification file
      synapsePolicyDefinitionFile - - Synapse policy definition
      ccPolicyDefinitionFile - - Choreo connect policy definition
      Returns:
      - http response of add common policy
      Throws:
      ApiException - - throws if add common policy fails
    • addAPISpecificOperationPolicy

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addAPISpecificOperationPolicy(String apiId, File policySpecFile, File synapsePolicyDefinitionFile, File ccPolicyDefinitionFile) throws ApiException
      Add an API specific operation policy
      Parameters:
      apiId - - UUID of the API
      policySpecFile - - Policy specification file
      synapsePolicyDefinitionFile - - Synapse policy definition
      ccPolicyDefinitionFile - - Choreo connect policy definition
      Returns:
      - http response of add common policy
      Throws:
      ApiException - - throws if add common policy fails
    • deleteCommonOperationPolicy

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse deleteCommonOperationPolicy(String policyId) throws ApiException
      Delete common operation policy
      Parameters:
      policyId - - Policy Id
      Throws:
      ApiException - - throws if remove comment fails
    • deleteAPISpecificPolicy

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse deleteAPISpecificPolicy(String policyId, String apiId) throws ApiException
      Delete API specific policy in given API
      Parameters:
      policyId - - policy Id
      apiId - - api Id
      Throws:
      ApiException - - throws if remove comment fails
    • importOperationPolicy

      public ApiResponse<Void> importOperationPolicy(File file) throws ApiException
      Import Operation Policy.
      Parameters:
      file - Policy File.
      Returns:
      Throws:
      ApiException
    • mapPolicyNameToId

      public Map<String,String> mapPolicyNameToId(OperationPolicyDataListDTO policyList)
    • addGatewayPolicy

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addGatewayPolicy(GatewayPolicyMappingsDTO gatewayPolicyMappingsDTO)
      Add a new gateway policy
      Parameters:
      gatewayPolicyMappingsDTO - Gateway policy mapping DTO
      Returns:
      http response of add gateway policy
      Throws:
      ApiException - - throws if add gateway policy fails
    • deployGatewayPolicy

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse deployGatewayPolicy(String gatewayPolicyMappingId, List<GatewayPolicyDeploymentDTO> gatewayPolicyDeploymentDTO)
      Deploy gateway policy
      Parameters:
      gatewayPolicyMappingId - Gateway policy mapping Id
      gatewayPolicyDeploymentDTO - Gateway policy deployment DTO
      Returns:
      http response of add gateway policy
      Throws:
      ApiException - - throws if add gateway policy fails
    • deleteGatewayPolicy

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse deleteGatewayPolicy(String gatewayPolicyMappingId)
      Delete gateway policy
      Parameters:
      gatewayPolicyMappingId - Gateway policy mapping Id to be deleted
      Returns:
      http response of add gateway policy
      Throws:
      ApiException - - throws if add gateway policy fails
    • getGatewayPolicy

      public GatewayPolicyMappingsDTO getGatewayPolicy(String gatewayPolicyMappingId) throws ApiException
      Get gateway policy by policy mapping UUID
      Parameters:
      gatewayPolicyMappingId - Gateway policy mapping Id to be retrieved
      Returns:
      GatewayPolicyMappingsDTO Gateway policy mapping DTO
      Throws:
      ApiException - - throws if add gateway policy fails
    • updateGatewayPolicy

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse updateGatewayPolicy(String gatewayPolicyMappingId, GatewayPolicyMappingsDTO gatewayPolicyMappingsDTO)
      Update gateway policy
      Parameters:
      gatewayPolicyMappingId - Gateway policy mapping Id
      gatewayPolicyMappingsDTO - Gateway policy mapping DTO
      Returns:
      http response of add gateway policy
      Throws:
      ApiException - - throws if add gateway policy fails
    • getCertificateUsage

      public ApiResponse<APIMetadataListDTO> getCertificateUsage(String alias, Integer limit, Integer offset) throws ApiException
      Get the Certificate usage.
      Parameters:
      alias - Alias of the certificate
      limit - Number of results needed
      offset - Offset
      Returns:
      ApiResponse object
      Throws:
      ApiException - If error when fetching certificate usage
    • getLinterCustomRules

      public String getLinterCustomRules() throws ApiException
      Retrieve linter custom rules
      Returns:
      - linter custom rules JSONObject
      Throws:
      ApiException - - throws if get linter custom rules fails
    • getSettings

      public SettingsDTO getSettings() throws ApiException
      Throws:
      ApiException
    • changeSubscriptionBusinessPlan

      public void changeSubscriptionBusinessPlan(String subscriptionId, String businessPlan, String ifMatch) throws ApiException
      Changes the business plan of a subscription.
      Parameters:
      subscriptionId - the ID of the subscription to be updated
      businessPlan - the new business plan to be assigned to the subscription
      ifMatch - the ETag value to check for concurrency control
      Throws:
      ApiException - if an error occurs while changing the business plan
    • addApiEndpoint

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse addApiEndpoint(String apiId, String name, String deploymentStage, Object endpointConfig) throws ApiException
      This method is used to add an API Endpoint.
      Parameters:
      apiId - API UUID
      name - API endpoint name
      deploymentStage - Deployment stage: Production or Sandbox
      endpointConfig - Endpoint configuration object
      Returns:
      HttpResponse
      Throws:
      ApiException - throws if an error occurred when creating the API Endpoint
    • updateApiEndpoint

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse updateApiEndpoint(String apiId, String endpointId, String name, String deploymentStage, Object endpointConfig) throws ApiException
      Update an API endpoint with name and deployment stage
      Parameters:
      apiId - API ID
      endpointId - API endpoint ID
      name - Endpoint name
      deploymentStage - Deployment stage
      endpointConfig - API endpoint configuration
      Returns:
      HttpResponse
      Throws:
      ApiException - throws if an error occurred when updating the API endpoint
    • deleteApiEndpoint

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse deleteApiEndpoint(String apiId, String endpointId) throws ApiException
      Delete an API endpoint
      Parameters:
      apiId - API ID
      endpointId - API endpoint ID
      Returns:
      HttpResponse
      Throws:
      ApiException - throws if an error occurred when deleting the API endpoint
    • getApiEndpoints

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getApiEndpoints(String apiId)
      Get API endpoints for a given API UUID.
      Parameters:
      apiId - API UUID
      Returns:
      HttpResponse
      Throws:
      ApiException - throws if an error occurred when retrieving the API endpoints
    • getApiEndpoint

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getApiEndpoint(String apiId, String endpointId) throws ApiException
      Get a specific API endpoint by endpoint ID.
      Parameters:
      apiId - API UUID
      endpointId - API endpoint ID
      Returns:
      HttpResponse
      Throws:
      ApiException - throws if an error occurred when retrieving the API endpoint
    • getAIServiceProviderModels

      public org.wso2.carbon.automation.test.utils.http.client.HttpResponse getAIServiceProviderModels(String aiServiceProviderId)
      Get AI Service Provider's model list
      Parameters:
      aiServiceProviderId - AI service provider ID
      Returns:
      HttpResponse