// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.securityinsights.models;

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

/** The connector Availability Status. */
public enum AvailabilityStatus {
    /** Enum value 1. */
    ONE(1);

    /** The actual serialized value for a AvailabilityStatus instance. */
    private final int value;

    AvailabilityStatus(int value) {
        this.value = value;
    }

    /**
     * Parses a serialized value to a AvailabilityStatus instance.
     *
     * @param value the serialized value to parse.
     * @return the parsed AvailabilityStatus object, or null if unable to parse.
     */
    @JsonCreator
    public static AvailabilityStatus fromInt(int value) {
        AvailabilityStatus[] items = AvailabilityStatus.values();
        for (AvailabilityStatus item : items) {
            if (item.toInt() == value) {
                return item;
            }
        }
        return null;
    }

    /**
     * De-serializes the instance to int value.
     *
     * @return the int value.
     */
    @JsonValue
    public int toInt() {
        return this.value;
    }
}
