package com.messagebird.objects.conversations;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * Status for a Conversation channel. Only ACTIVE channels can be used for
 * messaging.
 */
public enum ConversationChannelStatus {

    ACTIVE("active"),
    DELETED("deleted"),
    INACTIVE("inactive"),
    PENDING("pending"),
    ACTIVATION_REQUIRED("activation_required"),
    ACTIVATION_CODE_REQUIRED("activation_code_required"),
    ACTIVATING("activating");

    private final String status;

    ConversationChannelStatus(final String status) {
        this.status = status;
    }

    public String getStatus() {
        return status;
    }

    @JsonCreator
    public static ConversationChannelStatus forValue(final String value) {
        for (ConversationChannelStatus status : ConversationChannelStatus.values()) {
            if (status.getStatus().equals(value)) {
                return status;
            }
        }

        return null;
    }

    @JsonValue
    public String toJson() {
        return getStatus();
    }

    @Override
    public String toString() {
        return getStatus();
    }
}

@@ -297,88 +297,22 @@
 CTIV
-E(%22active%22),%0A    DELETED(%22deleted%22),%0A    INACTIVE(%22inactive%22),%0A    PENDING(%22pend
+ATING(%22activat
 ing%22
@@ -329,16 +329,21 @@
 IVATION_
+CODE_
 REQUIRED
@@ -355,16 +355,21 @@
 ivation_
+code_
 required
@@ -379,37 +379,32 @@
 %0A    ACTIVATION_
-CODE_
 REQUIRED(%22activa
@@ -400,37 +400,32 @@
 RED(%22activation_
-code_
 required%22),%0A    
@@ -425,38 +425,104 @@
 ),%0A    ACTIV
-ATING(%22activat
+E(%22active%22),%0A    DELETED(%22deleted%22),%0A    INACTIVE(%22inactive%22),%0A    PENDING(%22pend
 ing%22);%0A%0A    

Reorder enum members