001 002package com.commercetools.importapi.models.common; 003 004import java.util.Arrays; 005import java.util.Optional; 006 007import com.fasterxml.jackson.annotation.JsonCreator; 008import com.fasterxml.jackson.annotation.JsonValue; 009 010import io.vrap.rmf.base.client.JsonEnum; 011import io.vrap.rmf.base.client.utils.Generated; 012 013/** 014 * <p>The resource types that can be imported.</p> 015 */ 016@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 017public interface ImportResourceType extends JsonEnum { 018 019 /** 020 <p>The <a href="ctp:import:type:CategoryImport">Category import</a> resource type.</p> 021 022 */ 023 ImportResourceType CATEGORY = ImportResourceTypeEnum.CATEGORY; 024 /** 025 <p>The <a href="ctp:import:type:OrderImport">Order import</a> resource type.</p> 026 027 */ 028 ImportResourceType ORDER = ImportResourceTypeEnum.ORDER; 029 /** 030 <p>The <a href="ctp:import:type:OrderPatchImport">Order patch import</a> resource type.</p> 031 032 */ 033 ImportResourceType ORDER_PATCH = ImportResourceTypeEnum.ORDER_PATCH; 034 /** 035 <p>The <a href="ctp:import:type:PriceImport">Embedded Price import</a> resource type.</p> 036 037 */ 038 ImportResourceType PRICE = ImportResourceTypeEnum.PRICE; 039 /** 040 <p>The <a href="ctp:import:type:ProductImport">Product import</a> resource type.</p> 041 042 */ 043 ImportResourceType PRODUCT = ImportResourceTypeEnum.PRODUCT; 044 /** 045 <p>The <a href="ctp:import:type:ProductDraftImport">Product draft import</a> resource type.</p> 046 047 */ 048 ImportResourceType PRODUCT_DRAFT = ImportResourceTypeEnum.PRODUCT_DRAFT; 049 /** 050 <p>The <a href="ctp:import:type:ProductTypeImport">Product Type import</a> resource type.</p> 051 052 */ 053 ImportResourceType PRODUCT_TYPE = ImportResourceTypeEnum.PRODUCT_TYPE; 054 /** 055 <p>The <a href="ctp:import:type:ProductVariantImport">Product Variant import</a> resource type.</p> 056 057 */ 058 ImportResourceType PRODUCT_VARIANT = ImportResourceTypeEnum.PRODUCT_VARIANT; 059 /** 060 <p>The <a href="ctp:import:type:ProductVariantPatch">Product Variant patch</a> resource type.</p> 061 062 */ 063 ImportResourceType PRODUCT_VARIANT_PATCH = ImportResourceTypeEnum.PRODUCT_VARIANT_PATCH; 064 /** 065 <p>The <a href="ctp:import:type:CustomerImport">Customer import</a> resource type.</p> 066 067 */ 068 ImportResourceType CUSTOMER = ImportResourceTypeEnum.CUSTOMER; 069 /** 070 <p>The <a href="ctp:import:type:InventoryImport">Inventory import</a> resource type.</p> 071 072 */ 073 ImportResourceType INVENTORY = ImportResourceTypeEnum.INVENTORY; 074 /** 075 <p>The <a href="ctp:import:type:StandalonePriceImport">Standalone Price import</a> resource type.</p> 076 077 */ 078 ImportResourceType STANDALONE_PRICE = ImportResourceTypeEnum.STANDALONE_PRICE; 079 080 ImportResourceType TYPE = ImportResourceTypeEnum.TYPE; 081 082 /** 083 * possible values of ImportResourceType 084 */ 085 enum ImportResourceTypeEnum implements ImportResourceType { 086 /** 087 * category 088 */ 089 CATEGORY("category"), 090 091 /** 092 * order 093 */ 094 ORDER("order"), 095 096 /** 097 * order-patch 098 */ 099 ORDER_PATCH("order-patch"), 100 101 /** 102 * price 103 */ 104 PRICE("price"), 105 106 /** 107 * product 108 */ 109 PRODUCT("product"), 110 111 /** 112 * product-draft 113 */ 114 PRODUCT_DRAFT("product-draft"), 115 116 /** 117 * product-type 118 */ 119 PRODUCT_TYPE("product-type"), 120 121 /** 122 * product-variant 123 */ 124 PRODUCT_VARIANT("product-variant"), 125 126 /** 127 * product-variant-patch 128 */ 129 PRODUCT_VARIANT_PATCH("product-variant-patch"), 130 131 /** 132 * customer 133 */ 134 CUSTOMER("customer"), 135 136 /** 137 * inventory 138 */ 139 INVENTORY("inventory"), 140 141 /** 142 * standalone-price 143 */ 144 STANDALONE_PRICE("standalone-price"), 145 146 /** 147 * type 148 */ 149 TYPE("type"); 150 private final String jsonName; 151 152 private ImportResourceTypeEnum(final String jsonName) { 153 this.jsonName = jsonName; 154 } 155 156 public String getJsonName() { 157 return jsonName; 158 } 159 160 public String toString() { 161 return jsonName; 162 } 163 } 164 165 /** 166 * the JSON value 167 * @return json value 168 */ 169 @JsonValue 170 String getJsonName(); 171 172 /** 173 * the enum value 174 * @return name 175 */ 176 String name(); 177 178 /** 179 * convert value to string 180 * @return string representation 181 */ 182 String toString(); 183 184 /** 185 * factory method for a enum value of ImportResourceType 186 * if no enum has been found an anonymous instance will be created 187 * @param value the enum value to be wrapped 188 * @return enum instance 189 */ 190 @JsonCreator 191 public static ImportResourceType findEnum(String value) { 192 return findEnumViaJsonName(value).orElse(new ImportResourceType() { 193 @Override 194 public String getJsonName() { 195 return value; 196 } 197 198 @Override 199 public String name() { 200 return value.toUpperCase(); 201 } 202 203 public String toString() { 204 return value; 205 } 206 }); 207 } 208 209 /** 210 * method to find enum using the JSON value 211 * @param jsonName the json value to be wrapped 212 * @return optional of enum instance 213 */ 214 public static Optional<ImportResourceType> findEnumViaJsonName(String jsonName) { 215 return Arrays.stream(values()).filter(t -> t.getJsonName().equals(jsonName)).findFirst(); 216 } 217 218 /** 219 * possible enum values 220 * @return array of possible enum values 221 */ 222 public static ImportResourceType[] values() { 223 return ImportResourceTypeEnum.values(); 224 } 225 226}