rust_cast 0.18.1

Library that allows you to communicate with Google Cast enabled devices (e.g. Chromecast).
Documentation
// This file is generated by rust-protobuf 3.2.0. Do not edit
// .proto file is parsed by protoc 3.21.12
// @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_results)]
#![allow(unused_mut)]

//! Generated file from `cast_channel.proto`
// Generated for lite runtime

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

#[derive(PartialEq,Clone,Default,Debug)]
// @@protoc_insertion_point(message:cast.channel.CastMessage)
pub struct CastMessage {
    // message fields
    // @@protoc_insertion_point(field:cast.channel.CastMessage.protocol_version)
    pub protocol_version: ::std::option::Option<::protobuf::EnumOrUnknown<cast_message::ProtocolVersion>>,
    // @@protoc_insertion_point(field:cast.channel.CastMessage.source_id)
    pub source_id: ::std::option::Option<::std::string::String>,
    // @@protoc_insertion_point(field:cast.channel.CastMessage.destination_id)
    pub destination_id: ::std::option::Option<::std::string::String>,
    // @@protoc_insertion_point(field:cast.channel.CastMessage.namespace)
    pub namespace: ::std::option::Option<::std::string::String>,
    // @@protoc_insertion_point(field:cast.channel.CastMessage.payload_type)
    pub payload_type: ::std::option::Option<::protobuf::EnumOrUnknown<cast_message::PayloadType>>,
    // @@protoc_insertion_point(field:cast.channel.CastMessage.payload_utf8)
    pub payload_utf8: ::std::option::Option<::std::string::String>,
    // @@protoc_insertion_point(field:cast.channel.CastMessage.payload_binary)
    pub payload_binary: ::std::option::Option<::std::vec::Vec<u8>>,
    // @@protoc_insertion_point(field:cast.channel.CastMessage.continued)
    pub continued: ::std::option::Option<bool>,
    // @@protoc_insertion_point(field:cast.channel.CastMessage.remaining_length)
    pub remaining_length: ::std::option::Option<u32>,
    // special fields
    // @@protoc_insertion_point(special_field:cast.channel.CastMessage.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

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 protocol_version(&self) -> cast_message::ProtocolVersion {
        match self.protocol_version {
            Some(e) => e.enum_value_or(cast_message::ProtocolVersion::CASTV2_1_0),
            None => cast_message::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: cast_message::ProtocolVersion) {
        self.protocol_version = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v));
    }

    // required string source_id = 2;

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

    pub fn clear_source_id(&mut self) {
        self.source_id = ::std::option::Option::None;
    }

    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 = ::std::option::Option::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 = ::std::option::Option::Some(::std::string::String::new());
        }
        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 destination_id(&self) -> &str {
        match self.destination_id.as_ref() {
            Some(v) => v,
            None => "",
        }
    }

    pub fn clear_destination_id(&mut self) {
        self.destination_id = ::std::option::Option::None;
    }

    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 = ::std::option::Option::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 = ::std::option::Option::Some(::std::string::String::new());
        }
        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 namespace(&self) -> &str {
        match self.namespace.as_ref() {
            Some(v) => v,
            None => "",
        }
    }

    pub fn clear_namespace(&mut self) {
        self.namespace = ::std::option::Option::None;
    }

    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 = ::std::option::Option::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 = ::std::option::Option::Some(::std::string::String::new());
        }
        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 payload_type(&self) -> cast_message::PayloadType {
        match self.payload_type {
            Some(e) => e.enum_value_or(cast_message::PayloadType::STRING),
            None => cast_message::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: cast_message::PayloadType) {
        self.payload_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v));
    }

    // optional string payload_utf8 = 6;

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

    pub fn clear_payload_utf8(&mut self) {
        self.payload_utf8 = ::std::option::Option::None;
    }

    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 = ::std::option::Option::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 = ::std::option::Option::Some(::std::string::String::new());
        }
        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 payload_binary(&self) -> &[u8] {
        match self.payload_binary.as_ref() {
            Some(v) => v,
            None => &[],
        }
    }

    pub fn clear_payload_binary(&mut self) {
        self.payload_binary = ::std::option::Option::None;
    }

    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 = ::std::option::Option::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 = ::std::option::Option::Some(::std::vec::Vec::new());
        }
        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 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 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 {
    const NAME: &'static str = "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::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                8 => {
                    self.protocol_version = ::std::option::Option::Some(is.read_enum_or_unknown()?);
                },
                18 => {
                    self.source_id = ::std::option::Option::Some(is.read_string()?);
                },
                26 => {
                    self.destination_id = ::std::option::Option::Some(is.read_string()?);
                },
                34 => {
                    self.namespace = ::std::option::Option::Some(is.read_string()?);
                },
                40 => {
                    self.payload_type = ::std::option::Option::Some(is.read_enum_or_unknown()?);
                },
                50 => {
                    self.payload_utf8 = ::std::option::Option::Some(is.read_string()?);
                },
                58 => {
                    self.payload_binary = ::std::option::Option::Some(is.read_bytes()?);
                },
                64 => {
                    self.continued = ::std::option::Option::Some(is.read_bool()?);
                },
                72 => {
                    self.remaining_length = ::std::option::Option::Some(is.read_uint32()?);
                },
                tag => {
                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

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

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
        if let Some(v) = self.protocol_version {
            os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?;
        }
        if let Some(v) = self.source_id.as_ref() {
            os.write_string(2, v)?;
        }
        if let Some(v) = self.destination_id.as_ref() {
            os.write_string(3, v)?;
        }
        if let Some(v) = self.namespace.as_ref() {
            os.write_string(4, v)?;
        }
        if let Some(v) = self.payload_type {
            os.write_enum(5, ::protobuf::EnumOrUnknown::value(&v))?;
        }
        if let Some(v) = self.payload_utf8.as_ref() {
            os.write_string(6, v)?;
        }
        if let Some(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.special_fields.unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn special_fields(&self) -> &::protobuf::SpecialFields {
        &self.special_fields
    }

    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
        &mut self.special_fields
    }

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

    fn clear(&mut self) {
        self.protocol_version = ::std::option::Option::None;
        self.source_id = ::std::option::Option::None;
        self.destination_id = ::std::option::Option::None;
        self.namespace = ::std::option::Option::None;
        self.payload_type = ::std::option::Option::None;
        self.payload_utf8 = ::std::option::Option::None;
        self.payload_binary = ::std::option::Option::None;
        self.continued = ::std::option::Option::None;
        self.remaining_length = ::std::option::Option::None;
        self.special_fields.clear();
    }

    fn default_instance() -> &'static CastMessage {
        static instance: CastMessage = CastMessage {
            protocol_version: ::std::option::Option::None,
            source_id: ::std::option::Option::None,
            destination_id: ::std::option::Option::None,
            namespace: ::std::option::Option::None,
            payload_type: ::std::option::Option::None,
            payload_utf8: ::std::option::Option::None,
            payload_binary: ::std::option::Option::None,
            continued: ::std::option::Option::None,
            remaining_length: ::std::option::Option::None,
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

/// Nested message and enums of message `CastMessage`
pub mod cast_message {
    #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
    // @@protoc_insertion_point(enum:cast.channel.CastMessage.ProtocolVersion)
    pub enum ProtocolVersion {
        // @@protoc_insertion_point(enum_value:cast.channel.CastMessage.ProtocolVersion.CASTV2_1_0)
        CASTV2_1_0 = 0,
        // @@protoc_insertion_point(enum_value:cast.channel.CastMessage.ProtocolVersion.CASTV2_1_1)
        CASTV2_1_1 = 1,
        // @@protoc_insertion_point(enum_value:cast.channel.CastMessage.ProtocolVersion.CASTV2_1_2)
        CASTV2_1_2 = 2,
        // @@protoc_insertion_point(enum_value:cast.channel.CastMessage.ProtocolVersion.CASTV2_1_3)
        CASTV2_1_3 = 3,
    }

    impl ::protobuf::Enum for ProtocolVersion {
        const NAME: &'static str = "ProtocolVersion";

        fn value(&self) -> i32 {
            *self as i32
        }

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

        const VALUES: &'static [ProtocolVersion] = &[
            ProtocolVersion::CASTV2_1_0,
            ProtocolVersion::CASTV2_1_1,
            ProtocolVersion::CASTV2_1_2,
            ProtocolVersion::CASTV2_1_3,
        ];
    }

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


    #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
    // @@protoc_insertion_point(enum:cast.channel.CastMessage.PayloadType)
    pub enum PayloadType {
        // @@protoc_insertion_point(enum_value:cast.channel.CastMessage.PayloadType.STRING)
        STRING = 0,
        // @@protoc_insertion_point(enum_value:cast.channel.CastMessage.PayloadType.BINARY)
        BINARY = 1,
    }

    impl ::protobuf::Enum for PayloadType {
        const NAME: &'static str = "PayloadType";

        fn value(&self) -> i32 {
            *self as i32
        }

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

        const VALUES: &'static [PayloadType] = &[
            PayloadType::STRING,
            PayloadType::BINARY,
        ];
    }

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

}

#[derive(PartialEq,Clone,Default,Debug)]
// @@protoc_insertion_point(message:cast.channel.AuthChallenge)
pub struct AuthChallenge {
    // message fields
    // @@protoc_insertion_point(field:cast.channel.AuthChallenge.signature_algorithm)
    pub signature_algorithm: ::std::option::Option<::protobuf::EnumOrUnknown<SignatureAlgorithm>>,
    // @@protoc_insertion_point(field:cast.channel.AuthChallenge.sender_nonce)
    pub sender_nonce: ::std::option::Option<::std::vec::Vec<u8>>,
    // @@protoc_insertion_point(field:cast.channel.AuthChallenge.hash_algorithm)
    pub hash_algorithm: ::std::option::Option<::protobuf::EnumOrUnknown<HashAlgorithm>>,
    // special fields
    // @@protoc_insertion_point(special_field:cast.channel.AuthChallenge.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

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 signature_algorithm(&self) -> SignatureAlgorithm {
        match self.signature_algorithm {
            Some(e) => e.enum_value_or(SignatureAlgorithm::RSASSA_PKCS1v15),
            None => 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(::protobuf::EnumOrUnknown::new(v));
    }

    // optional bytes sender_nonce = 2;

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

    pub fn clear_sender_nonce(&mut self) {
        self.sender_nonce = ::std::option::Option::None;
    }

    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 = ::std::option::Option::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 = ::std::option::Option::Some(::std::vec::Vec::new());
        }
        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 hash_algorithm(&self) -> HashAlgorithm {
        match self.hash_algorithm {
            Some(e) => e.enum_value_or(HashAlgorithm::SHA1),
            None => 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(::protobuf::EnumOrUnknown::new(v));
    }
}

impl ::protobuf::Message for AuthChallenge {
    const NAME: &'static str = "AuthChallenge";

    fn is_initialized(&self) -> bool {
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                8 => {
                    self.signature_algorithm = ::std::option::Option::Some(is.read_enum_or_unknown()?);
                },
                18 => {
                    self.sender_nonce = ::std::option::Option::Some(is.read_bytes()?);
                },
                24 => {
                    self.hash_algorithm = ::std::option::Option::Some(is.read_enum_or_unknown()?);
                },
                tag => {
                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u64 {
        let mut my_size = 0;
        if let Some(v) = self.signature_algorithm {
            my_size += ::protobuf::rt::int32_size(1, v.value());
        }
        if let Some(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::int32_size(3, v.value());
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
        self.special_fields.cached_size().set(my_size as u32);
        my_size
    }

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

    fn special_fields(&self) -> &::protobuf::SpecialFields {
        &self.special_fields
    }

    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
        &mut self.special_fields
    }

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

    fn clear(&mut self) {
        self.signature_algorithm = ::std::option::Option::None;
        self.sender_nonce = ::std::option::Option::None;
        self.hash_algorithm = ::std::option::Option::None;
        self.special_fields.clear();
    }

    fn default_instance() -> &'static AuthChallenge {
        static instance: AuthChallenge = AuthChallenge {
            signature_algorithm: ::std::option::Option::None,
            sender_nonce: ::std::option::Option::None,
            hash_algorithm: ::std::option::Option::None,
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

#[derive(PartialEq,Clone,Default,Debug)]
// @@protoc_insertion_point(message:cast.channel.AuthResponse)
pub struct AuthResponse {
    // message fields
    // @@protoc_insertion_point(field:cast.channel.AuthResponse.signature)
    pub signature: ::std::option::Option<::std::vec::Vec<u8>>,
    // @@protoc_insertion_point(field:cast.channel.AuthResponse.client_auth_certificate)
    pub client_auth_certificate: ::std::option::Option<::std::vec::Vec<u8>>,
    // @@protoc_insertion_point(field:cast.channel.AuthResponse.intermediate_certificate)
    pub intermediate_certificate: ::std::vec::Vec<::std::vec::Vec<u8>>,
    // @@protoc_insertion_point(field:cast.channel.AuthResponse.signature_algorithm)
    pub signature_algorithm: ::std::option::Option<::protobuf::EnumOrUnknown<SignatureAlgorithm>>,
    // @@protoc_insertion_point(field:cast.channel.AuthResponse.sender_nonce)
    pub sender_nonce: ::std::option::Option<::std::vec::Vec<u8>>,
    // @@protoc_insertion_point(field:cast.channel.AuthResponse.hash_algorithm)
    pub hash_algorithm: ::std::option::Option<::protobuf::EnumOrUnknown<HashAlgorithm>>,
    // @@protoc_insertion_point(field:cast.channel.AuthResponse.crl)
    pub crl: ::std::option::Option<::std::vec::Vec<u8>>,
    // special fields
    // @@protoc_insertion_point(special_field:cast.channel.AuthResponse.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

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 signature(&self) -> &[u8] {
        match self.signature.as_ref() {
            Some(v) => v,
            None => &[],
        }
    }

    pub fn clear_signature(&mut self) {
        self.signature = ::std::option::Option::None;
    }

    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 = ::std::option::Option::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 = ::std::option::Option::Some(::std::vec::Vec::new());
        }
        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 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 = ::std::option::Option::None;
    }

    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 = ::std::option::Option::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 = ::std::option::Option::Some(::std::vec::Vec::new());
        }
        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())
    }

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

    pub fn signature_algorithm(&self) -> SignatureAlgorithm {
        match self.signature_algorithm {
            Some(e) => e.enum_value_or(SignatureAlgorithm::RSASSA_PKCS1v15),
            None => 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(::protobuf::EnumOrUnknown::new(v));
    }

    // optional bytes sender_nonce = 5;

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

    pub fn clear_sender_nonce(&mut self) {
        self.sender_nonce = ::std::option::Option::None;
    }

    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 = ::std::option::Option::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 = ::std::option::Option::Some(::std::vec::Vec::new());
        }
        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 hash_algorithm(&self) -> HashAlgorithm {
        match self.hash_algorithm {
            Some(e) => e.enum_value_or(HashAlgorithm::SHA1),
            None => 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(::protobuf::EnumOrUnknown::new(v));
    }

    // optional bytes crl = 7;

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

    pub fn clear_crl(&mut self) {
        self.crl = ::std::option::Option::None;
    }

    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 = ::std::option::Option::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 = ::std::option::Option::Some(::std::vec::Vec::new());
        }
        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 {
    const NAME: &'static str = "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::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                10 => {
                    self.signature = ::std::option::Option::Some(is.read_bytes()?);
                },
                18 => {
                    self.client_auth_certificate = ::std::option::Option::Some(is.read_bytes()?);
                },
                26 => {
                    self.intermediate_certificate.push(is.read_bytes()?);
                },
                32 => {
                    self.signature_algorithm = ::std::option::Option::Some(is.read_enum_or_unknown()?);
                },
                42 => {
                    self.sender_nonce = ::std::option::Option::Some(is.read_bytes()?);
                },
                48 => {
                    self.hash_algorithm = ::std::option::Option::Some(is.read_enum_or_unknown()?);
                },
                58 => {
                    self.crl = ::std::option::Option::Some(is.read_bytes()?);
                },
                tag => {
                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u64 {
        let mut my_size = 0;
        if let Some(v) = self.signature.as_ref() {
            my_size += ::protobuf::rt::bytes_size(1, &v);
        }
        if let Some(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::int32_size(4, v.value());
        }
        if let Some(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::int32_size(6, v.value());
        }
        if let Some(v) = self.crl.as_ref() {
            my_size += ::protobuf::rt::bytes_size(7, &v);
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
        self.special_fields.cached_size().set(my_size as u32);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
        if let Some(v) = self.signature.as_ref() {
            os.write_bytes(1, v)?;
        }
        if let Some(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::EnumOrUnknown::value(&v))?;
        }
        if let Some(v) = self.sender_nonce.as_ref() {
            os.write_bytes(5, v)?;
        }
        if let Some(v) = self.hash_algorithm {
            os.write_enum(6, ::protobuf::EnumOrUnknown::value(&v))?;
        }
        if let Some(v) = self.crl.as_ref() {
            os.write_bytes(7, v)?;
        }
        os.write_unknown_fields(self.special_fields.unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn special_fields(&self) -> &::protobuf::SpecialFields {
        &self.special_fields
    }

    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
        &mut self.special_fields
    }

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

    fn clear(&mut self) {
        self.signature = ::std::option::Option::None;
        self.client_auth_certificate = ::std::option::Option::None;
        self.intermediate_certificate.clear();
        self.signature_algorithm = ::std::option::Option::None;
        self.sender_nonce = ::std::option::Option::None;
        self.hash_algorithm = ::std::option::Option::None;
        self.crl = ::std::option::Option::None;
        self.special_fields.clear();
    }

    fn default_instance() -> &'static AuthResponse {
        static instance: AuthResponse = AuthResponse {
            signature: ::std::option::Option::None,
            client_auth_certificate: ::std::option::Option::None,
            intermediate_certificate: ::std::vec::Vec::new(),
            signature_algorithm: ::std::option::Option::None,
            sender_nonce: ::std::option::Option::None,
            hash_algorithm: ::std::option::Option::None,
            crl: ::std::option::Option::None,
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

#[derive(PartialEq,Clone,Default,Debug)]
// @@protoc_insertion_point(message:cast.channel.AuthError)
pub struct AuthError {
    // message fields
    // @@protoc_insertion_point(field:cast.channel.AuthError.error_type)
    pub error_type: ::std::option::Option<::protobuf::EnumOrUnknown<auth_error::ErrorType>>,
    // special fields
    // @@protoc_insertion_point(special_field:cast.channel.AuthError.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

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 error_type(&self) -> auth_error::ErrorType {
        match self.error_type {
            Some(e) => e.enum_value_or(auth_error::ErrorType::INTERNAL_ERROR),
            None => auth_error::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: auth_error::ErrorType) {
        self.error_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v));
    }
}

impl ::protobuf::Message for AuthError {
    const NAME: &'static str = "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::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                8 => {
                    self.error_type = ::std::option::Option::Some(is.read_enum_or_unknown()?);
                },
                tag => {
                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

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

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

    fn special_fields(&self) -> &::protobuf::SpecialFields {
        &self.special_fields
    }

    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
        &mut self.special_fields
    }

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

    fn clear(&mut self) {
        self.error_type = ::std::option::Option::None;
        self.special_fields.clear();
    }

    fn default_instance() -> &'static AuthError {
        static instance: AuthError = AuthError {
            error_type: ::std::option::Option::None,
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

/// Nested message and enums of message `AuthError`
pub mod auth_error {
    #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
    // @@protoc_insertion_point(enum:cast.channel.AuthError.ErrorType)
    pub enum ErrorType {
        // @@protoc_insertion_point(enum_value:cast.channel.AuthError.ErrorType.INTERNAL_ERROR)
        INTERNAL_ERROR = 0,
        // @@protoc_insertion_point(enum_value:cast.channel.AuthError.ErrorType.NO_TLS)
        NO_TLS = 1,
        // @@protoc_insertion_point(enum_value:cast.channel.AuthError.ErrorType.SIGNATURE_ALGORITHM_UNAVAILABLE)
        SIGNATURE_ALGORITHM_UNAVAILABLE = 2,
    }

    impl ::protobuf::Enum for ErrorType {
        const NAME: &'static str = "ErrorType";

        fn value(&self) -> i32 {
            *self as i32
        }

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

        const VALUES: &'static [ErrorType] = &[
            ErrorType::INTERNAL_ERROR,
            ErrorType::NO_TLS,
            ErrorType::SIGNATURE_ALGORITHM_UNAVAILABLE,
        ];
    }

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

}

#[derive(PartialEq,Clone,Default,Debug)]
// @@protoc_insertion_point(message:cast.channel.DeviceAuthMessage)
pub struct DeviceAuthMessage {
    // message fields
    // @@protoc_insertion_point(field:cast.channel.DeviceAuthMessage.challenge)
    pub challenge: ::protobuf::MessageField<AuthChallenge>,
    // @@protoc_insertion_point(field:cast.channel.DeviceAuthMessage.response)
    pub response: ::protobuf::MessageField<AuthResponse>,
    // @@protoc_insertion_point(field:cast.channel.DeviceAuthMessage.error)
    pub error: ::protobuf::MessageField<AuthError>,
    // special fields
    // @@protoc_insertion_point(special_field:cast.channel.DeviceAuthMessage.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

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()
    }
}

impl ::protobuf::Message for DeviceAuthMessage {
    const NAME: &'static str = "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::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                10 => {
                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.challenge)?;
                },
                18 => {
                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.response)?;
                },
                26 => {
                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.error)?;
                },
                tag => {
                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

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

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
        if let Some(v) = self.challenge.as_ref() {
            ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
        }
        if let Some(v) = self.response.as_ref() {
            ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
        }
        if let Some(v) = self.error.as_ref() {
            ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?;
        }
        os.write_unknown_fields(self.special_fields.unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn special_fields(&self) -> &::protobuf::SpecialFields {
        &self.special_fields
    }

    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
        &mut self.special_fields
    }

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

    fn clear(&mut self) {
        self.challenge.clear();
        self.response.clear();
        self.error.clear();
        self.special_fields.clear();
    }

    fn default_instance() -> &'static DeviceAuthMessage {
        static instance: DeviceAuthMessage = DeviceAuthMessage {
            challenge: ::protobuf::MessageField::none(),
            response: ::protobuf::MessageField::none(),
            error: ::protobuf::MessageField::none(),
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
// @@protoc_insertion_point(enum:cast.channel.SignatureAlgorithm)
pub enum SignatureAlgorithm {
    // @@protoc_insertion_point(enum_value:cast.channel.SignatureAlgorithm.UNSPECIFIED)
    UNSPECIFIED = 0,
    // @@protoc_insertion_point(enum_value:cast.channel.SignatureAlgorithm.RSASSA_PKCS1v15)
    RSASSA_PKCS1v15 = 1,
    // @@protoc_insertion_point(enum_value:cast.channel.SignatureAlgorithm.RSASSA_PSS)
    RSASSA_PSS = 2,
}

impl ::protobuf::Enum for SignatureAlgorithm {
    const NAME: &'static str = "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
        }
    }

    const VALUES: &'static [SignatureAlgorithm] = &[
        SignatureAlgorithm::UNSPECIFIED,
        SignatureAlgorithm::RSASSA_PKCS1v15,
        SignatureAlgorithm::RSASSA_PSS,
    ];
}

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


#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
// @@protoc_insertion_point(enum:cast.channel.HashAlgorithm)
pub enum HashAlgorithm {
    // @@protoc_insertion_point(enum_value:cast.channel.HashAlgorithm.SHA1)
    SHA1 = 0,
    // @@protoc_insertion_point(enum_value:cast.channel.HashAlgorithm.SHA256)
    SHA256 = 1,
}

impl ::protobuf::Enum for HashAlgorithm {
    const NAME: &'static str = "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
        }
    }

    const VALUES: &'static [HashAlgorithm] = &[
        HashAlgorithm::SHA1,
        HashAlgorithm::SHA256,
    ];
}

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