001
002package com.commercetools.api.models.quote_request;
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>Predefined states tracking the status of the Quote Request in the negotiation process.</p>
015 */
016@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
017public interface QuoteRequestState extends JsonEnum {
018
019    /**
020        <p>Initial state of the negotiation process. Indicates that the Quote Request has been submitted by the Buyer, but the Seller has not yet decided whether to accept or to reject the request.</p>
021
022    */
023    QuoteRequestState SUBMITTED = QuoteRequestStateEnum.SUBMITTED;
024    /**
025        <p>Indicates that the Quote Request has been accepted by the Seller and the negotiation process continues with preparing a Staged Quote for the Buyer.</p>
026
027    */
028    QuoteRequestState ACCEPTED = QuoteRequestStateEnum.ACCEPTED;
029    /**
030        <p>Final state of the negotiation process. Indicates that the Quote Request had been accepted by the Seller and there is no further action that can be performed by any party.</p>
031
032    */
033    QuoteRequestState CLOSED = QuoteRequestStateEnum.CLOSED;
034    /**
035        <p>Indicates that the Quote Request has been rejected by the Seller and the negotiation process terminated.</p>
036
037    */
038    QuoteRequestState REJECTED = QuoteRequestStateEnum.REJECTED;
039    /**
040        <p>Indicates that the Buyer has withdrawn the Quote Request.</p>
041
042    */
043    QuoteRequestState CANCELLED = QuoteRequestStateEnum.CANCELLED;
044
045    /**
046     * possible values of QuoteRequestState
047     */
048    enum QuoteRequestStateEnum implements QuoteRequestState {
049        /**
050         * Submitted
051         */
052        SUBMITTED("Submitted"),
053
054        /**
055         * Accepted
056         */
057        ACCEPTED("Accepted"),
058
059        /**
060         * Closed
061         */
062        CLOSED("Closed"),
063
064        /**
065         * Rejected
066         */
067        REJECTED("Rejected"),
068
069        /**
070         * Cancelled
071         */
072        CANCELLED("Cancelled");
073        private final String jsonName;
074
075        private QuoteRequestStateEnum(final String jsonName) {
076            this.jsonName = jsonName;
077        }
078
079        public String getJsonName() {
080            return jsonName;
081        }
082
083        public String toString() {
084            return jsonName;
085        }
086    }
087
088    /**
089     * the JSON value
090     * @return json value
091     */
092    @JsonValue
093    String getJsonName();
094
095    /**
096     * the enum value
097     * @return name
098     */
099    String name();
100
101    /**
102     * convert value to string
103     * @return string representation
104     */
105    String toString();
106
107    /**
108     * factory method for a enum value of QuoteRequestState
109     * if no enum has been found an anonymous instance will be created
110     * @param value the enum value to be wrapped
111     * @return enum instance
112     */
113    @JsonCreator
114    public static QuoteRequestState findEnum(String value) {
115        return findEnumViaJsonName(value).orElse(new QuoteRequestState() {
116            @Override
117            public String getJsonName() {
118                return value;
119            }
120
121            @Override
122            public String name() {
123                return value.toUpperCase();
124            }
125
126            public String toString() {
127                return value;
128            }
129        });
130    }
131
132    /**
133     * method to find enum using the JSON value
134     * @param jsonName the json value to be wrapped
135     * @return optional of enum instance
136     */
137    public static Optional<QuoteRequestState> findEnumViaJsonName(String jsonName) {
138        return Arrays.stream(values()).filter(t -> t.getJsonName().equals(jsonName)).findFirst();
139    }
140
141    /**
142     * possible enum values
143     * @return array of possible enum values
144     */
145    public static QuoteRequestState[] values() {
146        return QuoteRequestStateEnum.values();
147    }
148
149}