Skip to content
Open
1 change: 1 addition & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ jobs:
env:
TEST_REQUEST_API_KEY: ${{ secrets.TEST_REQUEST_API_KEY }}
TEST_CATALOG_API_KEY: ${{ secrets.TEST_CATALOG_API_KEY }}
TEST_CATALOG_FACETS_V2_API_KEY: ${{ secrets.TEST_CATALOG_FACETS_V2_API_KEY }}
TEST_API_TOKEN: ${{ secrets.TEST_API_TOKEN }}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package io.constructor.client;

import io.constructor.client.models.FacetConfigurationV2;

/**
* Constructor.io FacetConfiguration V2 Request.
*
* <p>This request class is used for v2 facet configuration operations which require
* path_in_metadata to be specified.
*/
public class FacetConfigurationV2Request {
private FacetConfigurationV2 facetConfiguration;
private String section;

/**
* Creates a facet configuration v2 request
*
* @param facetConfiguration the facet configuration to be created/updated
* @param section the section to which the facet belongs
*/
public FacetConfigurationV2Request(FacetConfigurationV2 facetConfiguration, String section) {
if (facetConfiguration == null) {
throw new IllegalArgumentException("facetConfiguration is required");
}
if (section == null) {
throw new IllegalArgumentException("section is required");
}

this.facetConfiguration = facetConfiguration;
this.section = section;
}

/**
* Creates a facet configuration v2 request with default section "Products"
*
* @param facetConfiguration the facet configuration to be created/updated
*/
public FacetConfigurationV2Request(FacetConfigurationV2 facetConfiguration) {
this(facetConfiguration, ConstructorIO.DEFAULT_SECTION);
}

/**
* @param facetConfiguration the facet configuration to be created/updated
*/
public void setFacetConfiguration(FacetConfigurationV2 facetConfiguration) {
this.facetConfiguration = facetConfiguration;
}

/**
* @return the facet configuration to be created/updated
*/
public FacetConfigurationV2 getFacetConfiguration() {
return facetConfiguration;
}

/**
* @param section the section to set
*/
public void setSection(String section) {
this.section = section;
}

/**
* @return the section
*/
public String getSection() {
return section;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
package io.constructor.client;

/**
* Constructor.io Facet Configurations V2 GET Request.
*
* <p>This request class is used for listing v2 facet configurations (GET /v2/facets).
*/
public class FacetConfigurationsV2GetRequest {
private String section;

// Pagination parameters
private Integer page;
private Integer numResultsPerPage;
private Integer offset;

/**
* Creates a facet configurations v2 GET request
*
* @param section the section to which the facet configurations belong
*/
public FacetConfigurationsV2GetRequest(String section) {
if (section == null) {
throw new IllegalArgumentException("section is required");
}
this.section = section;
}

/** Creates a facet configurations v2 GET request with default section "Products" */
public FacetConfigurationsV2GetRequest() {
this.section = ConstructorIO.DEFAULT_SECTION;
}

/**
* @return the section
*/
public String getSection() {
return section;
}

/**
* @param section the section to set
*/
public void setSection(String section) {
this.section = section;
}

/**
* @return the page number
*/
public Integer getPage() {
return page;
}

/**
* @param page the page number to set
*/
public void setPage(Integer page) {
this.page = page;
}

/**
* @return the number of results per page
*/
public Integer getNumResultsPerPage() {
return numResultsPerPage;
}

/**
* @param numResultsPerPage the number of results per page to set
*/
public void setNumResultsPerPage(Integer numResultsPerPage) {
this.numResultsPerPage = numResultsPerPage;
}

/**
* @return the offset
*/
public Integer getOffset() {
return offset;
}

/**
* @param offset the offset to set
*/
public void setOffset(Integer offset) {
this.offset = offset;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package io.constructor.client;

import io.constructor.client.models.FacetConfigurationV2;
import java.util.List;

/**
* Constructor.io FacetConfigurations V2 Request.
*
* <p>This request class is used for bulk v2 facet configuration operations (PATCH /v2/facets and
* PUT /v2/facets).
*/
public class FacetConfigurationsV2Request {
private List<FacetConfigurationV2> facetConfigurations;
private String section;

/**
* Creates a facet configurations v2 request for bulk update
*
* @param facetConfigurations the list of facet configurations to be updated
* @param section the section to which the facets belong
*/
public FacetConfigurationsV2Request(
List<FacetConfigurationV2> facetConfigurations, String section) {
if (facetConfigurations == null || facetConfigurations.isEmpty()) {
throw new IllegalArgumentException("facetConfigurations is required");
}
if (section == null) {
throw new IllegalArgumentException("section is required");
}

this.facetConfigurations = facetConfigurations;
this.section = section;
}

/**
* Creates a facet configurations v2 request with default section "Products"
*
* @param facetConfigurations the list of facet configurations to be updated
*/
public FacetConfigurationsV2Request(List<FacetConfigurationV2> facetConfigurations) {
this(facetConfigurations, ConstructorIO.DEFAULT_SECTION);
}

/**
* @return the list of facet configurations
*/
public List<FacetConfigurationV2> getFacetConfigurations() {
return facetConfigurations;
}

/**
* @param facetConfigurations the facet configurations to set
*/
public void setFacetConfigurations(List<FacetConfigurationV2> facetConfigurations) {
this.facetConfigurations = facetConfigurations;
}

/**
* @return the section
*/
public String getSection() {
return section;
}

/**
* @param section the section to set
*/
public void setSection(String section) {
this.section = section;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package io.constructor.client;

import java.util.List;

/**
* Constructor.io Searchabilities V2 DELETE Request.
*
* <p>This request class is used for bulk deletion of v2 searchability configurations (DELETE
* /v2/searchabilities).
*/
public class SearchabilitiesV2DeleteRequest {
private List<String> searchabilityNames;
private String section;
private Boolean skipRebuild;

/**
* Creates a searchabilities v2 DELETE request
*
* @param searchabilityNames the list of searchability names to delete
* @param section the section to which the searchabilities belong
*/
public SearchabilitiesV2DeleteRequest(List<String> searchabilityNames, String section) {
if (searchabilityNames == null || searchabilityNames.isEmpty()) {
throw new IllegalArgumentException("searchabilityNames is required");
}
if (section == null) {
throw new IllegalArgumentException("section is required");
}

this.searchabilityNames = searchabilityNames;
this.section = section;
}

/**
* Creates a searchabilities v2 DELETE request with default section "Products"
*
* @param searchabilityNames the list of searchability names to delete
*/
public SearchabilitiesV2DeleteRequest(List<String> searchabilityNames) {
this(searchabilityNames, ConstructorIO.DEFAULT_SECTION);
}

/**
* @return the list of searchability names to delete
*/
public List<String> getSearchabilityNames() {
return searchabilityNames;
}

/**
* @param searchabilityNames the searchability names to set
*/
public void setSearchabilityNames(List<String> searchabilityNames) {
this.searchabilityNames = searchabilityNames;
}

/**
* @return the section
*/
public String getSection() {
return section;
}

/**
* @param section the section to set
*/
public void setSection(String section) {
this.section = section;
}

/**
* @return whether to skip index rebuild
*/
public Boolean getSkipRebuild() {
return skipRebuild;
}

/**
* @param skipRebuild whether to skip index rebuild
*/
public void setSkipRebuild(Boolean skipRebuild) {
this.skipRebuild = skipRebuild;
}
}
Loading
Loading