// This file is generated by rust-protobuf 2.27.1. Do not edit
// @generated

// https://github.com/rust-lang/rust-clippy/issues/702
#![allow(unknown_lints)]
#![allow(clippy::all)]

#![allow(unused_attributes)]
#![cfg_attr(rustfmt, rustfmt::skip)]

#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(trivial_casts)]
#![allow(unused_imports)]
#![allow(unused_results)]
//! Generated file from `cast_channel.proto`

/// Generated files are compatible only with the same version
/// of protobuf runtime.
// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_27_1;

#[derive(PartialEq,Clone,Default,Debug)]
pub struct CastMessage {
    // message fields
    protocol_version: ::std::option::Option<CastMessage_ProtocolVersion>,
    source_id: ::protobuf::SingularField<::std::string::String>,
    destination_id: ::protobuf::SingularField<::std::string::String>,
    namespace: ::protobuf::SingularField<::std::string::String>,
    payload_type: ::std::option::Option<CastMessage_PayloadType>,
    payload_utf8: ::protobuf::SingularField<::std::string::String>,
    payload_binary: ::protobuf::SingularField<::std::vec::Vec<u8>>,
    continued: ::std::option::Option<bool>,
    remaining_length: ::std::option::Option<u32>,
    // special fields
    pub unknown_fields: ::protobuf::UnknownFields,
    pub cached_size: ::protobuf::CachedSize,
}

impl<'a> ::std::default::Default for &'a CastMessage {
    fn default() -> &'a CastMessage {
        <CastMessage as ::protobuf::Message>::default_instance()
    }
}

impl CastMessage {
    pub fn new() -> CastMessage {
        ::std::default::Default::default()
    }

    // required .cast.channel.CastMessage.ProtocolVersion protocol_version = 1;


    pub fn get_protocol_version(&self) -> CastMessage_ProtocolVersion {
        self.protocol_version.unwrap_or(CastMessage_ProtocolVersion::CASTV2_1_0)
    }
    pub fn clear_protocol_version(&mut self) {
        self.protocol_version = ::std::option::Option::None;
    }

    pub fn has_protocol_version(&self) -> bool {
        self.protocol_version.is_some()
    }

    // Param is passed by value, moved
    pub fn set_protocol_version(&mut self, v: CastMessage_ProtocolVersion) {
        self.protocol_version = ::std::option::Option::Some(v);
    }

    // required string source_id = 2;


    pub fn get_source_id(&self) -> &str {
        match self.source_id.as_ref() {
            Some(v) => &v,
            None => "",
        }
    }
    pub fn clear_source_id(&mut self) {
        self.source_id.clear();
    }

    pub fn has_source_id(&self) -> bool {
        self.source_id.is_some()
    }

    // Param is passed by value, moved
    pub fn set_source_id(&mut self, v: ::std::string::String) {
        self.source_id = ::protobuf::SingularField::some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_source_id(&mut self) -> &mut ::std::string::String {
        if self.source_id.is_none() {
            self.source_id.set_default();
        }
        self.source_id.as_mut().unwrap()
    }

    // Take field
    pub fn take_source_id(&mut self) -> ::std::string::String {
        self.source_id.take().unwrap_or_else(|| ::std::string::String::new())
    }

    // required string destination_id = 3;


    pub fn get_destination_id(&self) -> &str {
        match self.destination_id.as_ref() {
            Some(v) => &v,
            None => "",
        }
    }
    pub fn clear_destination_id(&mut self) {
        self.destination_id.clear();
    }

    pub fn has_destination_id(&self) -> bool {
        self.destination_id.is_some()
    }

    // Param is passed by value, moved
    pub fn set_destination_id(&mut self, v: ::std::string::String) {
        self.destination_id = ::protobuf::SingularField::some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_destination_id(&mut self) -> &mut ::std::string::String {
        if self.destination_id.is_none() {
            self.destination_id.set_default();
        }
        self.destination_id.as_mut().unwrap()
    }

    // Take field
    pub fn take_destination_id(&mut self) -> ::std::string::String {
        self.destination_id.take().unwrap_or_else(|| ::std::string::String::new())
    }

    // required string namespace = 4;


    pub fn get_namespace(&self) -> &str {
        match self.namespace.as_ref() {
            Some(v) => &v,
            None => "",
        }
    }
    pub fn clear_namespace(&mut self) {
        self.namespace.clear();
    }

    pub fn has_namespace(&self) -> bool {
        self.namespace.is_some()
    }

    // Param is passed by value, moved
    pub fn set_namespace(&mut self, v: ::std::string::String) {
        self.namespace = ::protobuf::SingularField::some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_namespace(&mut self) -> &mut ::std::string::String {
        if self.namespace.is_none() {
            self.namespace.set_default();
        }
        self.namespace.as_mut().unwrap()
    }

    // Take field
    pub fn take_namespace(&mut self) -> ::std::string::String {
        self.namespace.take().unwrap_or_else(|| ::std::string::String::new())
    }

    // required .cast.channel.CastMessage.PayloadType payload_type = 5;


    pub fn get_payload_type(&self) -> CastMessage_PayloadType {
        self.payload_type.unwrap_or(CastMessage_PayloadType::STRING)
    }
    pub fn clear_payload_type(&mut self) {
        self.payload_type = ::std::option::Option::None;
    }

    pub fn has_payload_type(&self) -> bool {
        self.payload_type.is_some()
    }

    // Param is passed by value, moved
    pub fn set_payload_type(&mut self, v: CastMessage_PayloadType) {
        self.payload_type = ::std::option::Option::Some(v);
    }

    // optional string payload_utf8 = 6;


    pub fn get_payload_utf8(&self) -> &str {
        match self.payload_utf8.as_ref() {
            Some(v) => &v,
            None => "",
        }
    }
    pub fn clear_payload_utf8(&mut self) {
        self.payload_utf8.clear();
    }

    pub fn has_payload_utf8(&self) -> bool {
        self.payload_utf8.is_some()
    }

    // Param is passed by value, moved
    pub fn set_payload_utf8(&mut self, v: ::std::string::String) {
        self.payload_utf8 = ::protobuf::SingularField::some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_payload_utf8(&mut self) -> &mut ::std::string::String {
        if self.payload_utf8.is_none() {
            self.payload_utf8.set_default();
        }
        self.payload_utf8.as_mut().unwrap()
    }

    // Take field
    pub fn take_payload_utf8(&mut self) -> ::std::string::String {
        self.payload_utf8.take().unwrap_or_else(|| ::std::string::String::new())
    }

    // optional bytes payload_binary = 7;


    pub fn get_payload_binary(&self) -> &[u8] {
        match self.payload_binary.as_ref() {
            Some(v) => &v,
            None => &[],
        }
    }
    pub fn clear_payload_binary(&mut self) {
        self.payload_binary.clear();
    }

    pub fn has_payload_binary(&self) -> bool {
        self.payload_binary.is_some()
    }

    // Param is passed by value, moved
    pub fn set_payload_binary(&mut self, v: ::std::vec::Vec<u8>) {
        self.payload_binary = ::protobuf::SingularField::some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_payload_binary(&mut self) -> &mut ::std::vec::Vec<u8> {
        if self.payload_binary.is_none() {
            self.payload_binary.set_default();
        }
        self.payload_binary.as_mut().unwrap()
    }

    // Take field
    pub fn take_payload_binary(&mut self) -> ::std::vec::Vec<u8> {
        self.payload_binary.take().unwrap_or_else(|| ::std::vec::Vec::new())
    }

    // optional bool continued = 8;


    pub fn get_continued(&self) -> bool {
        self.continued.unwrap_or(false)
    }
    pub fn clear_continued(&mut self) {
        self.continued = ::std::option::Option::None;
    }

    pub fn has_continued(&self) -> bool {
        self.continued.is_some()
    }

    // Param is passed by value, moved
    pub fn set_continued(&mut self, v: bool) {
        self.continued = ::std::option::Option::Some(v);
    }

    // optional uint32 remaining_length = 9;


    pub fn get_remaining_length(&self) -> u32 {
        self.remaining_length.unwrap_or(0)
    }
    pub fn clear_remaining_length(&mut self) {
        self.remaining_length = ::std::option::Option::None;
    }

    pub fn has_remaining_length(&self) -> bool {
        self.remaining_length.is_some()
    }

    // Param is passed by value, moved
    pub fn set_remaining_length(&mut self, v: u32) {
        self.remaining_length = ::std::option::Option::Some(v);
    }
}

impl ::protobuf::Message for CastMessage {
    fn is_initialized(&self) -> bool {
        if self.protocol_version.is_none() {
            return false;
        }
        if self.source_id.is_none() {
            return false;
        }
        if self.destination_id.is_none() {
            return false;
        }
        if self.namespace.is_none() {
            return false;
        }
        if self.payload_type.is_none() {
            return false;
        }
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        while !is.eof()? {
            let (field_number, wire_type) = is.read_tag_unpack()?;
            match field_number {
                1 => {
                    ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.protocol_version, 1, &mut self.unknown_fields)?
                },
                2 => {
                    ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.source_id)?;
                },
                3 => {
                    ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.destination_id)?;
                },
                4 => {
                    ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.namespace)?;
                },
                5 => {
                    ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.payload_type, 5, &mut self.unknown_fields)?
                },
                6 => {
                    ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.payload_utf8)?;
                },
                7 => {
                    ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.payload_binary)?;
                },
                8 => {
                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                    }
                    let tmp = is.read_bool()?;
                    self.continued = ::std::option::Option::Some(tmp);
                },
                9 => {
                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                    }
                    let tmp = is.read_uint32()?;
                    self.remaining_length = ::std::option::Option::Some(tmp);
                },
                _ => {
                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u32 {
        let mut my_size = 0;
        if let Some(v) = self.protocol_version {
            my_size += ::protobuf::rt::enum_size(1, v);
        }
        if let Some(ref v) = self.source_id.as_ref() {
            my_size += ::protobuf::rt::string_size(2, &v);
        }
        if let Some(ref v) = self.destination_id.as_ref() {
            my_size += ::protobuf::rt::string_size(3, &v);
        }
        if let Some(ref v) = self.namespace.as_ref() {
            my_size += ::protobuf::rt::string_size(4, &v);
        }
        if let Some(v) = self.payload_type {
            my_size += ::protobuf::rt::enum_size(5, v);
        }
        if let Some(ref v) = self.payload_utf8.as_ref() {
            my_size += ::protobuf::rt::string_size(6, &v);
        }
        if let Some(ref v) = self.payload_binary.as_ref() {
            my_size += ::protobuf::rt::bytes_size(7, &v);
        }
        if let Some(v) = self.continued {
            my_size += 2;
        }
        if let Some(v) = self.remaining_length {
            my_size += ::protobuf::rt::value_size(9, v, ::protobuf::wire_format::WireTypeVarint);
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
        self.cached_size.set(my_size);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        if let Some(v) = self.protocol_version {
            os.write_enum(1, ::protobuf::ProtobufEnum::value(&v))?;
        }
        if let Some(ref v) = self.source_id.as_ref() {
            os.write_string(2, &v)?;
        }
        if let Some(ref v) = self.destination_id.as_ref() {
            os.write_string(3, &v)?;
        }
        if let Some(ref v) = self.namespace.as_ref() {
            os.write_string(4, &v)?;
        }
        if let Some(v) = self.payload_type {
            os.write_enum(5, ::protobuf::ProtobufEnum::value(&v))?;
        }
        if let Some(ref v) = self.payload_utf8.as_ref() {
            os.write_string(6, &v)?;
        }
        if let Some(ref v) = self.payload_binary.as_ref() {
            os.write_bytes(7, &v)?;
        }
        if let Some(v) = self.continued {
            os.write_bool(8, v)?;
        }
        if let Some(v) = self.remaining_length {
            os.write_uint32(9, v)?;
        }
        os.write_unknown_fields(self.get_unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn get_cached_size(&self) -> u32 {
        self.cached_size.get()
    }

    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
        &self.unknown_fields
    }

    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
        &mut self.unknown_fields
    }

    fn as_any(&self) -> &dyn (::std::any::Any) {
        self as &dyn (::std::any::Any)
    }
    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
        self as &mut dyn (::std::any::Any)
    }
    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
        self
    }

    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
        Self::descriptor_static()
    }

    fn new() -> CastMessage {
        CastMessage::new()
    }

    fn default_instance() -> &'static CastMessage {
        static instance: ::protobuf::rt::LazyV2<CastMessage> = ::protobuf::rt::LazyV2::INIT;
        instance.get(CastMessage::new)
    }
}

impl ::protobuf::Clear for CastMessage {
    fn clear(&mut self) {
        self.protocol_version = ::std::option::Option::None;
        self.source_id.clear();
        self.destination_id.clear();
        self.namespace.clear();
        self.payload_type = ::std::option::Option::None;
        self.payload_utf8.clear();
        self.payload_binary.clear();
        self.continued = ::std::option::Option::None;
        self.remaining_length = ::std::option::Option::None;
        self.unknown_fields.clear();
    }
}

impl ::protobuf::reflect::ProtobufValue for CastMessage {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Message(self)
    }
}

#[derive(Clone,PartialEq,Eq,Debug,Hash)]
pub enum CastMessage_ProtocolVersion {
    CASTV2_1_0 = 0,
    CASTV2_1_1 = 1,
    CASTV2_1_2 = 2,
    CASTV2_1_3 = 3,
}

impl ::protobuf::ProtobufEnum for CastMessage_ProtocolVersion {
    fn value(&self) -> i32 {
        *self as i32
    }

    fn from_i32(value: i32) -> ::std::option::Option<CastMessage_ProtocolVersion> {
        match value {
            0 => ::std::option::Option::Some(CastMessage_ProtocolVersion::CASTV2_1_0),
            1 => ::std::option::Option::Some(CastMessage_ProtocolVersion::CASTV2_1_1),
            2 => ::std::option::Option::Some(CastMessage_ProtocolVersion::CASTV2_1_2),
            3 => ::std::option::Option::Some(CastMessage_ProtocolVersion::CASTV2_1_3),
            _ => ::std::option::Option::None
        }
    }

    fn values() -> &'static [Self] {
        static values: &'static [CastMessage_ProtocolVersion] = &[
            CastMessage_ProtocolVersion::CASTV2_1_0,
            CastMessage_ProtocolVersion::CASTV2_1_1,
            CastMessage_ProtocolVersion::CASTV2_1_2,
            CastMessage_ProtocolVersion::CASTV2_1_3,
        ];
        values
    }
}

impl ::std::marker::Copy for CastMessage_ProtocolVersion {
}

impl ::std::default::Default for CastMessage_ProtocolVersion {
    fn default() -> Self {
        CastMessage_ProtocolVersion::CASTV2_1_0
    }
}

impl ::protobuf::reflect::ProtobufValue for CastMessage_ProtocolVersion {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
    }
}

#[derive(Clone,PartialEq,Eq,Debug,Hash)]
pub enum CastMessage_PayloadType {
    STRING = 0,
    BINARY = 1,
}

impl ::protobuf::ProtobufEnum for CastMessage_PayloadType {
    fn value(&self) -> i32 {
        *self as i32
    }

    fn from_i32(value: i32) -> ::std::option::Option<CastMessage_PayloadType> {
        match value {
            0 => ::std::option::Option::Some(CastMessage_PayloadType::STRING),
            1 => ::std::option::Option::Some(CastMessage_PayloadType::BINARY),
            _ => ::std::option::Option::None
        }
    }

    fn values() -> &'static [Self] {
        static values: &'static [CastMessage_PayloadType] = &[
            CastMessage_PayloadType::STRING,
            CastMessage_PayloadType::BINARY,
        ];
        values
    }
}

impl ::std::marker::Copy for CastMessage_PayloadType {
}

impl ::std::default::Default for CastMessage_PayloadType {
    fn default() -> Self {
        CastMessage_PayloadType::STRING
    }
}

impl ::protobuf::reflect::ProtobufValue for CastMessage_PayloadType {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
    }
}

#[derive(PartialEq,Clone,Default,Debug)]
pub struct AuthChallenge {
    // message fields
    signature_algorithm: ::std::option::Option<SignatureAlgorithm>,
    sender_nonce: ::protobuf::SingularField<::std::vec::Vec<u8>>,
    hash_algorithm: ::std::option::Option<HashAlgorithm>,
    // special fields
    pub unknown_fields: ::protobuf::UnknownFields,
    pub cached_size: ::protobuf::CachedSize,
}

impl<'a> ::std::default::Default for &'a AuthChallenge {
    fn default() -> &'a AuthChallenge {
        <AuthChallenge as ::protobuf::Message>::default_instance()
    }
}

impl AuthChallenge {
    pub fn new() -> AuthChallenge {
        ::std::default::Default::default()
    }

    // optional .cast.channel.SignatureAlgorithm signature_algorithm = 1;


    pub fn get_signature_algorithm(&self) -> SignatureAlgorithm {
        self.signature_algorithm.unwrap_or(SignatureAlgorithm::RSASSA_PKCS1v15)
    }
    pub fn clear_signature_algorithm(&mut self) {
        self.signature_algorithm = ::std::option::Option::None;
    }

    pub fn has_signature_algorithm(&self) -> bool {
        self.signature_algorithm.is_some()
    }

    // Param is passed by value, moved
    pub fn set_signature_algorithm(&mut self, v: SignatureAlgorithm) {
        self.signature_algorithm = ::std::option::Option::Some(v);
    }

    // optional bytes sender_nonce = 2;


    pub fn get_sender_nonce(&self) -> &[u8] {
        match self.sender_nonce.as_ref() {
            Some(v) => &v,
            None => &[],
        }
    }
    pub fn clear_sender_nonce(&mut self) {
        self.sender_nonce.clear();
    }

    pub fn has_sender_nonce(&self) -> bool {
        self.sender_nonce.is_some()
    }

    // Param is passed by value, moved
    pub fn set_sender_nonce(&mut self, v: ::std::vec::Vec<u8>) {
        self.sender_nonce = ::protobuf::SingularField::some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_sender_nonce(&mut self) -> &mut ::std::vec::Vec<u8> {
        if self.sender_nonce.is_none() {
            self.sender_nonce.set_default();
        }
        self.sender_nonce.as_mut().unwrap()
    }

    // Take field
    pub fn take_sender_nonce(&mut self) -> ::std::vec::Vec<u8> {
        self.sender_nonce.take().unwrap_or_else(|| ::std::vec::Vec::new())
    }

    // optional .cast.channel.HashAlgorithm hash_algorithm = 3;


    pub fn get_hash_algorithm(&self) -> HashAlgorithm {
        self.hash_algorithm.unwrap_or(HashAlgorithm::SHA1)
    }
    pub fn clear_hash_algorithm(&mut self) {
        self.hash_algorithm = ::std::option::Option::None;
    }

    pub fn has_hash_algorithm(&self) -> bool {
        self.hash_algorithm.is_some()
    }

    // Param is passed by value, moved
    pub fn set_hash_algorithm(&mut self, v: HashAlgorithm) {
        self.hash_algorithm = ::std::option::Option::Some(v);
    }
}

impl ::protobuf::Message for AuthChallenge {
    fn is_initialized(&self) -> bool {
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        while !is.eof()? {
            let (field_number, wire_type) = is.read_tag_unpack()?;
            match field_number {
                1 => {
                    ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.signature_algorithm, 1, &mut self.unknown_fields)?
                },
                2 => {
                    ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.sender_nonce)?;
                },
                3 => {
                    ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.hash_algorithm, 3, &mut self.unknown_fields)?
                },
                _ => {
                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u32 {
        let mut my_size = 0;
        if let Some(v) = self.signature_algorithm {
            my_size += ::protobuf::rt::enum_size(1, v);
        }
        if let Some(ref v) = self.sender_nonce.as_ref() {
            my_size += ::protobuf::rt::bytes_size(2, &v);
        }
        if let Some(v) = self.hash_algorithm {
            my_size += ::protobuf::rt::enum_size(3, v);
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
        self.cached_size.set(my_size);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        if let Some(v) = self.signature_algorithm {
            os.write_enum(1, ::protobuf::ProtobufEnum::value(&v))?;
        }
        if let Some(ref v) = self.sender_nonce.as_ref() {
            os.write_bytes(2, &v)?;
        }
        if let Some(v) = self.hash_algorithm {
            os.write_enum(3, ::protobuf::ProtobufEnum::value(&v))?;
        }
        os.write_unknown_fields(self.get_unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn get_cached_size(&self) -> u32 {
        self.cached_size.get()
    }

    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
        &self.unknown_fields
    }

    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
        &mut self.unknown_fields
    }

    fn as_any(&self) -> &dyn (::std::any::Any) {
        self as &dyn (::std::any::Any)
    }
    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
        self as &mut dyn (::std::any::Any)
    }
    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
        self
    }

    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
        Self::descriptor_static()
    }

    fn new() -> AuthChallenge {
        AuthChallenge::new()
    }

    fn default_instance() -> &'static AuthChallenge {
        static instance: ::protobuf::rt::LazyV2<AuthChallenge> = ::protobuf::rt::LazyV2::INIT;
        instance.get(AuthChallenge::new)
    }
}

impl ::protobuf::Clear for AuthChallenge {
    fn clear(&mut self) {
        self.signature_algorithm = ::std::option::Option::None;
        self.sender_nonce.clear();
        self.hash_algorithm = ::std::option::Option::None;
        self.unknown_fields.clear();
    }
}

impl ::protobuf::reflect::ProtobufValue for AuthChallenge {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Message(self)
    }
}

#[derive(PartialEq,Clone,Default,Debug)]
pub struct AuthResponse {
    // message fields
    signature: ::protobuf::SingularField<::std::vec::Vec<u8>>,
    client_auth_certificate: ::protobuf::SingularField<::std::vec::Vec<u8>>,
    pub intermediate_certificate: ::protobuf::RepeatedField<::std::vec::Vec<u8>>,
    signature_algorithm: ::std::option::Option<SignatureAlgorithm>,
    sender_nonce: ::protobuf::SingularField<::std::vec::Vec<u8>>,
    hash_algorithm: ::std::option::Option<HashAlgorithm>,
    crl: ::protobuf::SingularField<::std::vec::Vec<u8>>,
    // special fields
    pub unknown_fields: ::protobuf::UnknownFields,
    pub cached_size: ::protobuf::CachedSize,
}

impl<'a> ::std::default::Default for &'a AuthResponse {
    fn default() -> &'a AuthResponse {
        <AuthResponse as ::protobuf::Message>::default_instance()
    }
}

impl AuthResponse {
    pub fn new() -> AuthResponse {
        ::std::default::Default::default()
    }

    // required bytes signature = 1;


    pub fn get_signature(&self) -> &[u8] {
        match self.signature.as_ref() {
            Some(v) => &v,
            None => &[],
        }
    }
    pub fn clear_signature(&mut self) {
        self.signature.clear();
    }

    pub fn has_signature(&self) -> bool {
        self.signature.is_some()
    }

    // Param is passed by value, moved
    pub fn set_signature(&mut self, v: ::std::vec::Vec<u8>) {
        self.signature = ::protobuf::SingularField::some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_signature(&mut self) -> &mut ::std::vec::Vec<u8> {
        if self.signature.is_none() {
            self.signature.set_default();
        }
        self.signature.as_mut().unwrap()
    }

    // Take field
    pub fn take_signature(&mut self) -> ::std::vec::Vec<u8> {
        self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new())
    }

    // required bytes client_auth_certificate = 2;


    pub fn get_client_auth_certificate(&self) -> &[u8] {
        match self.client_auth_certificate.as_ref() {
            Some(v) => &v,
            None => &[],
        }
    }
    pub fn clear_client_auth_certificate(&mut self) {
        self.client_auth_certificate.clear();
    }

    pub fn has_client_auth_certificate(&self) -> bool {
        self.client_auth_certificate.is_some()
    }

    // Param is passed by value, moved
    pub fn set_client_auth_certificate(&mut self, v: ::std::vec::Vec<u8>) {
        self.client_auth_certificate = ::protobuf::SingularField::some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_client_auth_certificate(&mut self) -> &mut ::std::vec::Vec<u8> {
        if self.client_auth_certificate.is_none() {
            self.client_auth_certificate.set_default();
        }
        self.client_auth_certificate.as_mut().unwrap()
    }

    // Take field
    pub fn take_client_auth_certificate(&mut self) -> ::std::vec::Vec<u8> {
        self.client_auth_certificate.take().unwrap_or_else(|| ::std::vec::Vec::new())
    }

    // repeated bytes intermediate_certificate = 3;


    pub fn get_intermediate_certificate(&self) -> &[::std::vec::Vec<u8>] {
        &self.intermediate_certificate
    }
    pub fn clear_intermediate_certificate(&mut self) {
        self.intermediate_certificate.clear();
    }

    // Param is passed by value, moved
    pub fn set_intermediate_certificate(&mut self, v: ::protobuf::RepeatedField<::std::vec::Vec<u8>>) {
        self.intermediate_certificate = v;
    }

    // Mutable pointer to the field.
    pub fn mut_intermediate_certificate(&mut self) -> &mut ::protobuf::RepeatedField<::std::vec::Vec<u8>> {
        &mut self.intermediate_certificate
    }

    // Take field
    pub fn take_intermediate_certificate(&mut self) -> ::protobuf::RepeatedField<::std::vec::Vec<u8>> {
        ::std::mem::replace(&mut self.intermediate_certificate, ::protobuf::RepeatedField::new())
    }

    // optional .cast.channel.SignatureAlgorithm signature_algorithm = 4;


    pub fn get_signature_algorithm(&self) -> SignatureAlgorithm {
        self.signature_algorithm.unwrap_or(SignatureAlgorithm::RSASSA_PKCS1v15)
    }
    pub fn clear_signature_algorithm(&mut self) {
        self.signature_algorithm = ::std::option::Option::None;
    }

    pub fn has_signature_algorithm(&self) -> bool {
        self.signature_algorithm.is_some()
    }

    // Param is passed by value, moved
    pub fn set_signature_algorithm(&mut self, v: SignatureAlgorithm) {
        self.signature_algorithm = ::std::option::Option::Some(v);
    }

    // optional bytes sender_nonce = 5;


    pub fn get_sender_nonce(&self) -> &[u8] {
        match self.sender_nonce.as_ref() {
            Some(v) => &v,
            None => &[],
        }
    }
    pub fn clear_sender_nonce(&mut self) {
        self.sender_nonce.clear();
    }

    pub fn has_sender_nonce(&self) -> bool {
        self.sender_nonce.is_some()
    }

    // Param is passed by value, moved
    pub fn set_sender_nonce(&mut self, v: ::std::vec::Vec<u8>) {
        self.sender_nonce = ::protobuf::SingularField::some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_sender_nonce(&mut self) -> &mut ::std::vec::Vec<u8> {
        if self.sender_nonce.is_none() {
            self.sender_nonce.set_default();
        }
        self.sender_nonce.as_mut().unwrap()
    }

    // Take field
    pub fn take_sender_nonce(&mut self) -> ::std::vec::Vec<u8> {
        self.sender_nonce.take().unwrap_or_else(|| ::std::vec::Vec::new())
    }

    // optional .cast.channel.HashAlgorithm hash_algorithm = 6;


    pub fn get_hash_algorithm(&self) -> HashAlgorithm {
        self.hash_algorithm.unwrap_or(HashAlgorithm::SHA1)
    }
    pub fn clear_hash_algorithm(&mut self) {
        self.hash_algorithm = ::std::option::Option::None;
    }

    pub fn has_hash_algorithm(&self) -> bool {
        self.hash_algorithm.is_some()
    }

    // Param is passed by value, moved
    pub fn set_hash_algorithm(&mut self, v: HashAlgorithm) {
        self.hash_algorithm = ::std::option::Option::Some(v);
    }

    // optional bytes crl = 7;


    pub fn get_crl(&self) -> &[u8] {
        match self.crl.as_ref() {
            Some(v) => &v,
            None => &[],
        }
    }
    pub fn clear_crl(&mut self) {
        self.crl.clear();
    }

    pub fn has_crl(&self) -> bool {
        self.crl.is_some()
    }

    // Param is passed by value, moved
    pub fn set_crl(&mut self, v: ::std::vec::Vec<u8>) {
        self.crl = ::protobuf::SingularField::some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_crl(&mut self) -> &mut ::std::vec::Vec<u8> {
        if self.crl.is_none() {
            self.crl.set_default();
        }
        self.crl.as_mut().unwrap()
    }

    // Take field
    pub fn take_crl(&mut self) -> ::std::vec::Vec<u8> {
        self.crl.take().unwrap_or_else(|| ::std::vec::Vec::new())
    }
}

impl ::protobuf::Message for AuthResponse {
    fn is_initialized(&self) -> bool {
        if self.signature.is_none() {
            return false;
        }
        if self.client_auth_certificate.is_none() {
            return false;
        }
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        while !is.eof()? {
            let (field_number, wire_type) = is.read_tag_unpack()?;
            match field_number {
                1 => {
                    ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.signature)?;
                },
                2 => {
                    ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.client_auth_certificate)?;
                },
                3 => {
                    ::protobuf::rt::read_repeated_bytes_into(wire_type, is, &mut self.intermediate_certificate)?;
                },
                4 => {
                    ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.signature_algorithm, 4, &mut self.unknown_fields)?
                },
                5 => {
                    ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.sender_nonce)?;
                },
                6 => {
                    ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.hash_algorithm, 6, &mut self.unknown_fields)?
                },
                7 => {
                    ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.crl)?;
                },
                _ => {
                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u32 {
        let mut my_size = 0;
        if let Some(ref v) = self.signature.as_ref() {
            my_size += ::protobuf::rt::bytes_size(1, &v);
        }
        if let Some(ref v) = self.client_auth_certificate.as_ref() {
            my_size += ::protobuf::rt::bytes_size(2, &v);
        }
        for value in &self.intermediate_certificate {
            my_size += ::protobuf::rt::bytes_size(3, &value);
        };
        if let Some(v) = self.signature_algorithm {
            my_size += ::protobuf::rt::enum_size(4, v);
        }
        if let Some(ref v) = self.sender_nonce.as_ref() {
            my_size += ::protobuf::rt::bytes_size(5, &v);
        }
        if let Some(v) = self.hash_algorithm {
            my_size += ::protobuf::rt::enum_size(6, v);
        }
        if let Some(ref v) = self.crl.as_ref() {
            my_size += ::protobuf::rt::bytes_size(7, &v);
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
        self.cached_size.set(my_size);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        if let Some(ref v) = self.signature.as_ref() {
            os.write_bytes(1, &v)?;
        }
        if let Some(ref v) = self.client_auth_certificate.as_ref() {
            os.write_bytes(2, &v)?;
        }
        for v in &self.intermediate_certificate {
            os.write_bytes(3, &v)?;
        };
        if let Some(v) = self.signature_algorithm {
            os.write_enum(4, ::protobuf::ProtobufEnum::value(&v))?;
        }
        if let Some(ref v) = self.sender_nonce.as_ref() {
            os.write_bytes(5, &v)?;
        }
        if let Some(v) = self.hash_algorithm {
            os.write_enum(6, ::protobuf::ProtobufEnum::value(&v))?;
        }
        if let Some(ref v) = self.crl.as_ref() {
            os.write_bytes(7, &v)?;
        }
        os.write_unknown_fields(self.get_unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn get_cached_size(&self) -> u32 {
        self.cached_size.get()
    }

    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
        &self.unknown_fields
    }

    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
        &mut self.unknown_fields
    }

    fn as_any(&self) -> &dyn (::std::any::Any) {
        self as &dyn (::std::any::Any)
    }
    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
        self as &mut dyn (::std::any::Any)
    }
    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
        self
    }

    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
        Self::descriptor_static()
    }

    fn new() -> AuthResponse {
        AuthResponse::new()
    }

    fn default_instance() -> &'static AuthResponse {
        static instance: ::protobuf::rt::LazyV2<AuthResponse> = ::protobuf::rt::LazyV2::INIT;
        instance.get(AuthResponse::new)
    }
}

impl ::protobuf::Clear for AuthResponse {
    fn clear(&mut self) {
        self.signature.clear();
        self.client_auth_certificate.clear();
        self.intermediate_certificate.clear();
        self.signature_algorithm = ::std::option::Option::None;
        self.sender_nonce.clear();
        self.hash_algorithm = ::std::option::Option::None;
        self.crl.clear();
        self.unknown_fields.clear();
    }
}

impl ::protobuf::reflect::ProtobufValue for AuthResponse {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Message(self)
    }
}

#[derive(PartialEq,Clone,Default,Debug)]
pub struct AuthError {
    // message fields
    error_type: ::std::option::Option<AuthError_ErrorType>,
    // special fields
    pub unknown_fields: ::protobuf::UnknownFields,
    pub cached_size: ::protobuf::CachedSize,
}

impl<'a> ::std::default::Default for &'a AuthError {
    fn default() -> &'a AuthError {
        <AuthError as ::protobuf::Message>::default_instance()
    }
}

impl AuthError {
    pub fn new() -> AuthError {
        ::std::default::Default::default()
    }

    // required .cast.channel.AuthError.ErrorType error_type = 1;


    pub fn get_error_type(&self) -> AuthError_ErrorType {
        self.error_type.unwrap_or(AuthError_ErrorType::INTERNAL_ERROR)
    }
    pub fn clear_error_type(&mut self) {
        self.error_type = ::std::option::Option::None;
    }

    pub fn has_error_type(&self) -> bool {
        self.error_type.is_some()
    }

    // Param is passed by value, moved
    pub fn set_error_type(&mut self, v: AuthError_ErrorType) {
        self.error_type = ::std::option::Option::Some(v);
    }
}

impl ::protobuf::Message for AuthError {
    fn is_initialized(&self) -> bool {
        if self.error_type.is_none() {
            return false;
        }
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        while !is.eof()? {
            let (field_number, wire_type) = is.read_tag_unpack()?;
            match field_number {
                1 => {
                    ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.error_type, 1, &mut self.unknown_fields)?
                },
                _ => {
                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u32 {
        let mut my_size = 0;
        if let Some(v) = self.error_type {
            my_size += ::protobuf::rt::enum_size(1, v);
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
        self.cached_size.set(my_size);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        if let Some(v) = self.error_type {
            os.write_enum(1, ::protobuf::ProtobufEnum::value(&v))?;
        }
        os.write_unknown_fields(self.get_unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn get_cached_size(&self) -> u32 {
        self.cached_size.get()
    }

    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
        &self.unknown_fields
    }

    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
        &mut self.unknown_fields
    }

    fn as_any(&self) -> &dyn (::std::any::Any) {
        self as &dyn (::std::any::Any)
    }
    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
        self as &mut dyn (::std::any::Any)
    }
    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
        self
    }

    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
        Self::descriptor_static()
    }

    fn new() -> AuthError {
        AuthError::new()
    }

    fn default_instance() -> &'static AuthError {
        static instance: ::protobuf::rt::LazyV2<AuthError> = ::protobuf::rt::LazyV2::INIT;
        instance.get(AuthError::new)
    }
}

impl ::protobuf::Clear for AuthError {
    fn clear(&mut self) {
        self.error_type = ::std::option::Option::None;
        self.unknown_fields.clear();
    }
}

impl ::protobuf::reflect::ProtobufValue for AuthError {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Message(self)
    }
}

#[derive(Clone,PartialEq,Eq,Debug,Hash)]
pub enum AuthError_ErrorType {
    INTERNAL_ERROR = 0,
    NO_TLS = 1,
    SIGNATURE_ALGORITHM_UNAVAILABLE = 2,
}

impl ::protobuf::ProtobufEnum for AuthError_ErrorType {
    fn value(&self) -> i32 {
        *self as i32
    }

    fn from_i32(value: i32) -> ::std::option::Option<AuthError_ErrorType> {
        match value {
            0 => ::std::option::Option::Some(AuthError_ErrorType::INTERNAL_ERROR),
            1 => ::std::option::Option::Some(AuthError_ErrorType::NO_TLS),
            2 => ::std::option::Option::Some(AuthError_ErrorType::SIGNATURE_ALGORITHM_UNAVAILABLE),
            _ => ::std::option::Option::None
        }
    }

    fn values() -> &'static [Self] {
        static values: &'static [AuthError_ErrorType] = &[
            AuthError_ErrorType::INTERNAL_ERROR,
            AuthError_ErrorType::NO_TLS,
            AuthError_ErrorType::SIGNATURE_ALGORITHM_UNAVAILABLE,
        ];
        values
    }
}

impl ::std::marker::Copy for AuthError_ErrorType {
}

impl ::std::default::Default for AuthError_ErrorType {
    fn default() -> Self {
        AuthError_ErrorType::INTERNAL_ERROR
    }
}

impl ::protobuf::reflect::ProtobufValue for AuthError_ErrorType {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
    }
}

#[derive(PartialEq,Clone,Default,Debug)]
pub struct DeviceAuthMessage {
    // message fields
    pub challenge: ::protobuf::SingularPtrField<AuthChallenge>,
    pub response: ::protobuf::SingularPtrField<AuthResponse>,
    pub error: ::protobuf::SingularPtrField<AuthError>,
    // special fields
    pub unknown_fields: ::protobuf::UnknownFields,
    pub cached_size: ::protobuf::CachedSize,
}

impl<'a> ::std::default::Default for &'a DeviceAuthMessage {
    fn default() -> &'a DeviceAuthMessage {
        <DeviceAuthMessage as ::protobuf::Message>::default_instance()
    }
}

impl DeviceAuthMessage {
    pub fn new() -> DeviceAuthMessage {
        ::std::default::Default::default()
    }

    // optional .cast.channel.AuthChallenge challenge = 1;


    pub fn get_challenge(&self) -> &AuthChallenge {
        self.challenge.as_ref().unwrap_or_else(|| <AuthChallenge as ::protobuf::Message>::default_instance())
    }
    pub fn clear_challenge(&mut self) {
        self.challenge.clear();
    }

    pub fn has_challenge(&self) -> bool {
        self.challenge.is_some()
    }

    // Param is passed by value, moved
    pub fn set_challenge(&mut self, v: AuthChallenge) {
        self.challenge = ::protobuf::SingularPtrField::some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_challenge(&mut self) -> &mut AuthChallenge {
        if self.challenge.is_none() {
            self.challenge.set_default();
        }
        self.challenge.as_mut().unwrap()
    }

    // Take field
    pub fn take_challenge(&mut self) -> AuthChallenge {
        self.challenge.take().unwrap_or_else(|| AuthChallenge::new())
    }

    // optional .cast.channel.AuthResponse response = 2;


    pub fn get_response(&self) -> &AuthResponse {
        self.response.as_ref().unwrap_or_else(|| <AuthResponse as ::protobuf::Message>::default_instance())
    }
    pub fn clear_response(&mut self) {
        self.response.clear();
    }

    pub fn has_response(&self) -> bool {
        self.response.is_some()
    }

    // Param is passed by value, moved
    pub fn set_response(&mut self, v: AuthResponse) {
        self.response = ::protobuf::SingularPtrField::some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_response(&mut self) -> &mut AuthResponse {
        if self.response.is_none() {
            self.response.set_default();
        }
        self.response.as_mut().unwrap()
    }

    // Take field
    pub fn take_response(&mut self) -> AuthResponse {
        self.response.take().unwrap_or_else(|| AuthResponse::new())
    }

    // optional .cast.channel.AuthError error = 3;


    pub fn get_error(&self) -> &AuthError {
        self.error.as_ref().unwrap_or_else(|| <AuthError as ::protobuf::Message>::default_instance())
    }
    pub fn clear_error(&mut self) {
        self.error.clear();
    }

    pub fn has_error(&self) -> bool {
        self.error.is_some()
    }

    // Param is passed by value, moved
    pub fn set_error(&mut self, v: AuthError) {
        self.error = ::protobuf::SingularPtrField::some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_error(&mut self) -> &mut AuthError {
        if self.error.is_none() {
            self.error.set_default();
        }
        self.error.as_mut().unwrap()
    }

    // Take field
    pub fn take_error(&mut self) -> AuthError {
        self.error.take().unwrap_or_else(|| AuthError::new())
    }
}

impl ::protobuf::Message for DeviceAuthMessage {
    fn is_initialized(&self) -> bool {
        for v in &self.challenge {
            if !v.is_initialized() {
                return false;
            }
        };
        for v in &self.response {
            if !v.is_initialized() {
                return false;
            }
        };
        for v in &self.error {
            if !v.is_initialized() {
                return false;
            }
        };
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        while !is.eof()? {
            let (field_number, wire_type) = is.read_tag_unpack()?;
            match field_number {
                1 => {
                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.challenge)?;
                },
                2 => {
                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.response)?;
                },
                3 => {
                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.error)?;
                },
                _ => {
                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u32 {
        let mut my_size = 0;
        if let Some(ref v) = self.challenge.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
        }
        if let Some(ref v) = self.response.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
        }
        if let Some(ref v) = self.error.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
        self.cached_size.set(my_size);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        if let Some(ref v) = self.challenge.as_ref() {
            os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
            os.write_raw_varint32(v.get_cached_size())?;
            v.write_to_with_cached_sizes(os)?;
        }
        if let Some(ref v) = self.response.as_ref() {
            os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
            os.write_raw_varint32(v.get_cached_size())?;
            v.write_to_with_cached_sizes(os)?;
        }
        if let Some(ref v) = self.error.as_ref() {
            os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?;
            os.write_raw_varint32(v.get_cached_size())?;
            v.write_to_with_cached_sizes(os)?;
        }
        os.write_unknown_fields(self.get_unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn get_cached_size(&self) -> u32 {
        self.cached_size.get()
    }

    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
        &self.unknown_fields
    }

    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
        &mut self.unknown_fields
    }

    fn as_any(&self) -> &dyn (::std::any::Any) {
        self as &dyn (::std::any::Any)
    }
    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
        self as &mut dyn (::std::any::Any)
    }
    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
        self
    }

    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
        Self::descriptor_static()
    }

    fn new() -> DeviceAuthMessage {
        DeviceAuthMessage::new()
    }

    fn default_instance() -> &'static DeviceAuthMessage {
        static instance: ::protobuf::rt::LazyV2<DeviceAuthMessage> = ::protobuf::rt::LazyV2::INIT;
        instance.get(DeviceAuthMessage::new)
    }
}

impl ::protobuf::Clear for DeviceAuthMessage {
    fn clear(&mut self) {
        self.challenge.clear();
        self.response.clear();
        self.error.clear();
        self.unknown_fields.clear();
    }
}

impl ::protobuf::reflect::ProtobufValue for DeviceAuthMessage {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Message(self)
    }
}

#[derive(Clone,PartialEq,Eq,Debug,Hash)]
pub enum SignatureAlgorithm {
    UNSPECIFIED = 0,
    RSASSA_PKCS1v15 = 1,
    RSASSA_PSS = 2,
}

impl ::protobuf::ProtobufEnum for SignatureAlgorithm {
    fn value(&self) -> i32 {
        *self as i32
    }

    fn from_i32(value: i32) -> ::std::option::Option<SignatureAlgorithm> {
        match value {
            0 => ::std::option::Option::Some(SignatureAlgorithm::UNSPECIFIED),
            1 => ::std::option::Option::Some(SignatureAlgorithm::RSASSA_PKCS1v15),
            2 => ::std::option::Option::Some(SignatureAlgorithm::RSASSA_PSS),
            _ => ::std::option::Option::None
        }
    }

    fn values() -> &'static [Self] {
        static values: &'static [SignatureAlgorithm] = &[
            SignatureAlgorithm::UNSPECIFIED,
            SignatureAlgorithm::RSASSA_PKCS1v15,
            SignatureAlgorithm::RSASSA_PSS,
        ];
        values
    }
}

impl ::std::marker::Copy for SignatureAlgorithm {
}

impl ::std::default::Default for SignatureAlgorithm {
    fn default() -> Self {
        SignatureAlgorithm::UNSPECIFIED
    }
}

impl ::protobuf::reflect::ProtobufValue for SignatureAlgorithm {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
    }
}

#[derive(Clone,PartialEq,Eq,Debug,Hash)]
pub enum HashAlgorithm {
    SHA1 = 0,
    SHA256 = 1,
}

impl ::protobuf::ProtobufEnum for HashAlgorithm {
    fn value(&self) -> i32 {
        *self as i32
    }

    fn from_i32(value: i32) -> ::std::option::Option<HashAlgorithm> {
        match value {
            0 => ::std::option::Option::Some(HashAlgorithm::SHA1),
            1 => ::std::option::Option::Some(HashAlgorithm::SHA256),
            _ => ::std::option::Option::None
        }
    }

    fn values() -> &'static [Self] {
        static values: &'static [HashAlgorithm] = &[
            HashAlgorithm::SHA1,
            HashAlgorithm::SHA256,
        ];
        values
    }
}

impl ::std::marker::Copy for HashAlgorithm {
}

impl ::std::default::Default for HashAlgorithm {
    fn default() -> Self {
        HashAlgorithm::SHA1
    }
}

impl ::protobuf::reflect::ProtobufValue for HashAlgorithm {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
    }
}
