// Automatically generated rust module for 'switchboard_account_types.proto' file

#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(unused_imports)]
#![allow(unknown_lints)]
#![allow(clippy::all)]
#![cfg_attr(rustfmt, rustfmt_skip)]


use quick_protobuf::{BytesReader, Result, MessageRead, MessageWrite};
use super::*;

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum SwitchboardAccountType {
    TYPE_UNINITIALIZED = 0,
    TYPE_AGGREGATOR = 1,
    TYPE_FULFILLMENT_MANAGER = 2,
    TYPE_JOB_DEFINITION = 3,
    TYPE_FULFILLMENT_MANAGER_AUTH = 4,
}

impl Default for SwitchboardAccountType {
    fn default() -> Self {
        SwitchboardAccountType::TYPE_UNINITIALIZED
    }
}

impl From<i32> for SwitchboardAccountType {
    fn from(i: i32) -> Self {
        match i {
            0 => SwitchboardAccountType::TYPE_UNINITIALIZED,
            1 => SwitchboardAccountType::TYPE_AGGREGATOR,
            2 => SwitchboardAccountType::TYPE_FULFILLMENT_MANAGER,
            3 => SwitchboardAccountType::TYPE_JOB_DEFINITION,
            4 => SwitchboardAccountType::TYPE_FULFILLMENT_MANAGER_AUTH,
            _ => Self::default(),
        }
    }
}

impl<'a> From<&'a str> for SwitchboardAccountType {
    fn from(s: &'a str) -> Self {
        match s {
            "TYPE_UNINITIALIZED" => SwitchboardAccountType::TYPE_UNINITIALIZED,
            "TYPE_AGGREGATOR" => SwitchboardAccountType::TYPE_AGGREGATOR,
            "TYPE_FULFILLMENT_MANAGER" => SwitchboardAccountType::TYPE_FULFILLMENT_MANAGER,
            "TYPE_JOB_DEFINITION" => SwitchboardAccountType::TYPE_JOB_DEFINITION,
            "TYPE_FULFILLMENT_MANAGER_AUTH" => SwitchboardAccountType::TYPE_FULFILLMENT_MANAGER_AUTH,
            _ => Self::default(),
        }
    }
}

