001
002package com.commercetools.api.models.project;
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>Status of resource indexing.</p>
015 */
016@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
017public interface SearchIndexingConfigurationStatus extends JsonEnum {
018
019    /**
020        <p>Indicates that search and suggest endpoints for the specified resource type are active.</p>
021
022    */
023    SearchIndexingConfigurationStatus ACTIVATED = SearchIndexingConfigurationStatusEnum.ACTIVATED;
024    /**
025        <p>Indicates that search and suggest endpoints for the specified resource type cannot be used.</p>
026
027    */
028    SearchIndexingConfigurationStatus DEACTIVATED = SearchIndexingConfigurationStatusEnum.DEACTIVATED;
029    /**
030        <p>Indicates that search and suggest endpoints can <em>temporarily</em> not be used because the search index is being re-built.</p>
031
032    */
033    SearchIndexingConfigurationStatus INDEXING = SearchIndexingConfigurationStatusEnum.INDEXING;
034
035    /**
036     * possible values of SearchIndexingConfigurationStatus
037     */
038    enum SearchIndexingConfigurationStatusEnum implements SearchIndexingConfigurationStatus {
039        /**
040         * Activated
041         */
042        ACTIVATED("Activated"),
043
044        /**
045         * Deactivated
046         */
047        DEACTIVATED("Deactivated"),
048
049        /**
050         * Indexing
051         */
052        INDEXING("Indexing");
053        private final String jsonName;
054
055        private SearchIndexingConfigurationStatusEnum(final String jsonName) {
056            this.jsonName = jsonName;
057        }
058
059        public String getJsonName() {
060            return jsonName;
061        }
062
063        public String toString() {
064            return jsonName;
065        }
066    }
067
068    /**
069     * the JSON value
070     * @return json value
071     */
072    @JsonValue
073    String getJsonName();
074
075    /**
076     * the enum value
077     * @return name
078     */
079    String name();
080
081    /**
082     * convert value to string
083     * @return string representation
084     */
085    String toString();
086
087    /**
088     * factory method for a enum value of SearchIndexingConfigurationStatus
089     * if no enum has been found an anonymous instance will be created
090     * @param value the enum value to be wrapped
091     * @return enum instance
092     */
093    @JsonCreator
094    public static SearchIndexingConfigurationStatus findEnum(String value) {
095        return findEnumViaJsonName(value).orElse(new SearchIndexingConfigurationStatus() {
096            @Override
097            public String getJsonName() {
098                return value;
099            }
100
101            @Override
102            public String name() {
103                return value.toUpperCase();
104            }
105
106            public String toString() {
107                return value;
108            }
109        });
110    }
111
112    /**
113     * method to find enum using the JSON value
114     * @param jsonName the json value to be wrapped
115     * @return optional of enum instance
116     */
117    public static Optional<SearchIndexingConfigurationStatus> findEnumViaJsonName(String jsonName) {
118        return Arrays.stream(values()).filter(t -> t.getJsonName().equals(jsonName)).findFirst();
119    }
120
121    /**
122     * possible enum values
123     * @return array of possible enum values
124     */
125    public static SearchIndexingConfigurationStatus[] values() {
126        return SearchIndexingConfigurationStatusEnum.values();
127    }
128
129}