001 002package com.commercetools.ml.models.similar_products; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.validation.constraints.NotNull; 009 010import com.fasterxml.jackson.annotation.*; 011import com.fasterxml.jackson.databind.annotation.*; 012 013import io.vrap.rmf.base.client.utils.Generated; 014 015/** 016 * <p>A set of ProductData for comparison. If no optional attributes are specified, all <code>current</code> ProductData are selected for comparison.</p> 017 * 018 * <hr> 019 * Example to create an instance using the builder pattern 020 * <div class=code-example> 021 * <pre><code class='java'> 022 * ProductSetSelector productSetSelector = ProductSetSelector.builder() 023 * .projectKey("{projectKey}") 024 * .build() 025 * </code></pre> 026 * </div> 027 */ 028@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 029@JsonDeserialize(as = ProductSetSelectorImpl.class) 030public interface ProductSetSelector { 031 032 /** 033 * <p>The project containing the project set.</p> 034 */ 035 @NotNull 036 @JsonProperty("projectKey") 037 public String getProjectKey(); 038 039 /** 040 * <p>An array of Product IDs to compare. If unspecified, no Product ID filter is applied.</p> 041 */ 042 043 @JsonProperty("productIds") 044 public List<String> getProductIds(); 045 046 /** 047 * <p>An array of product type IDs. Only products with product types in this array are compared. If unspecified, no product type filter is applied.</p> 048 */ 049 050 @JsonProperty("productTypeIds") 051 public List<String> getProductTypeIds(); 052 053 /** 054 * <p>Specifies use of staged or current product data.</p> 055 */ 056 057 @JsonProperty("staged") 058 public Boolean getStaged(); 059 060 /** 061 * <p>Specifies use of product variants. If set to <code>true</code>, all product variants are compared, not just the master variant.</p> 062 */ 063 064 @JsonProperty("includeVariants") 065 public Boolean getIncludeVariants(); 066 067 /** 068 * <p>Maximum number of products to check (if unspecified, all products are considered). Note that the maximum number of product comparisons between two productSets is 20,000,000. This limit cannot be exceeded. If you need a higher limit, contact https://support.commercetools.com</p> 069 */ 070 071 @JsonProperty("productSetLimit") 072 public Long getProductSetLimit(); 073 074 public void setProjectKey(final String projectKey); 075 076 @JsonIgnore 077 public void setProductIds(final String... productIds); 078 079 public void setProductIds(final List<String> productIds); 080 081 @JsonIgnore 082 public void setProductTypeIds(final String... productTypeIds); 083 084 public void setProductTypeIds(final List<String> productTypeIds); 085 086 public void setStaged(final Boolean staged); 087 088 public void setIncludeVariants(final Boolean includeVariants); 089 090 public void setProductSetLimit(final Long productSetLimit); 091 092 public static ProductSetSelector of() { 093 return new ProductSetSelectorImpl(); 094 } 095 096 public static ProductSetSelector of(final ProductSetSelector template) { 097 ProductSetSelectorImpl instance = new ProductSetSelectorImpl(); 098 instance.setProjectKey(template.getProjectKey()); 099 instance.setProductIds(template.getProductIds()); 100 instance.setProductTypeIds(template.getProductTypeIds()); 101 instance.setStaged(template.getStaged()); 102 instance.setIncludeVariants(template.getIncludeVariants()); 103 instance.setProductSetLimit(template.getProductSetLimit()); 104 return instance; 105 } 106 107 public static ProductSetSelectorBuilder builder() { 108 return ProductSetSelectorBuilder.of(); 109 } 110 111 public static ProductSetSelectorBuilder builder(final ProductSetSelector template) { 112 return ProductSetSelectorBuilder.of(template); 113 } 114 115 default <T> T withProductSetSelector(Function<ProductSetSelector, T> helper) { 116 return helper.apply(this); 117 } 118 119 public static com.fasterxml.jackson.core.type.TypeReference<ProductSetSelector> typeReference() { 120 return new com.fasterxml.jackson.core.type.TypeReference<ProductSetSelector>() { 121 @Override 122 public String toString() { 123 return "TypeReference<ProductSetSelector>"; 124 } 125 }; 126 } 127}