// This file is generated by rust-protobuf 3.5.1. Do not edit
// .proto file is parsed by pure
// @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(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 `offline_ticket.proto`
// Generated for lite runtime

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

// @@protoc_insertion_point(message:Offline_Ticket)
#[derive(PartialEq,Clone,Default,Debug)]
pub struct Offline_Ticket {
    // message fields
    // @@protoc_insertion_point(field:Offline_Ticket.encrypted_ticket)
    pub encrypted_ticket: ::std::option::Option<::std::vec::Vec<u8>>,
    // @@protoc_insertion_point(field:Offline_Ticket.signature)
    pub signature: ::std::option::Option<::std::vec::Vec<u8>>,
    // @@protoc_insertion_point(field:Offline_Ticket.kdf1)
    pub kdf1: ::std::option::Option<i32>,
    // @@protoc_insertion_point(field:Offline_Ticket.salt1)
    pub salt1: ::std::option::Option<::std::vec::Vec<u8>>,
    // @@protoc_insertion_point(field:Offline_Ticket.kdf2)
    pub kdf2: ::std::option::Option<i32>,
    // @@protoc_insertion_point(field:Offline_Ticket.salt2)
    pub salt2: ::std::option::Option<::std::vec::Vec<u8>>,
    // special fields
    // @@protoc_insertion_point(special_field:Offline_Ticket.special_fields)
    pub special_fields: ::steam_vent_proto_common::protobuf::SpecialFields,
}

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

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

    // optional bytes encrypted_ticket = 1;

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

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

    pub fn has_encrypted_ticket(&self) -> bool {
        self.encrypted_ticket.is_some()
    }

    // Param is passed by value, moved
    pub fn set_encrypted_ticket(&mut self, v: ::std::vec::Vec<u8>) {
        self.encrypted_ticket = ::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_encrypted_ticket(&mut self) -> &mut ::std::vec::Vec<u8> {
        if self.encrypted_ticket.is_none() {
            self.encrypted_ticket = ::std::option::Option::Some(::std::vec::Vec::new());
        }
        self.encrypted_ticket.as_mut().unwrap()
    }

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

    // optional bytes signature = 2;

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

    // optional int32 kdf1 = 3;

    pub fn kdf1(&self) -> i32 {
        self.kdf1.unwrap_or(0)
    }

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

    pub fn has_kdf1(&self) -> bool {
        self.kdf1.is_some()
    }

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

    // optional bytes salt1 = 4;

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

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

    pub fn has_salt1(&self) -> bool {
        self.salt1.is_some()
    }

    // Param is passed by value, moved
    pub fn set_salt1(&mut self, v: ::std::vec::Vec<u8>) {
        self.salt1 = ::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_salt1(&mut self) -> &mut ::std::vec::Vec<u8> {
        if self.salt1.is_none() {
            self.salt1 = ::std::option::Option::Some(::std::vec::Vec::new());
        }
        self.salt1.as_mut().unwrap()
    }

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

    // optional int32 kdf2 = 5;

    pub fn kdf2(&self) -> i32 {
        self.kdf2.unwrap_or(0)
    }

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

    pub fn has_kdf2(&self) -> bool {
        self.kdf2.is_some()
    }

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

    // optional bytes salt2 = 6;

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

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

    pub fn has_salt2(&self) -> bool {
        self.salt2.is_some()
    }

    // Param is passed by value, moved
    pub fn set_salt2(&mut self, v: ::std::vec::Vec<u8>) {
        self.salt2 = ::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_salt2(&mut self) -> &mut ::std::vec::Vec<u8> {
        if self.salt2.is_none() {
            self.salt2 = ::std::option::Option::Some(::std::vec::Vec::new());
        }
        self.salt2.as_mut().unwrap()
    }

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

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

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

    fn merge_from(&mut self, is: &mut ::steam_vent_proto_common::protobuf::CodedInputStream<'_>) -> ::steam_vent_proto_common::protobuf::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                10 => {
                    self.encrypted_ticket = ::std::option::Option::Some(is.read_bytes()?);
                },
                18 => {
                    self.signature = ::std::option::Option::Some(is.read_bytes()?);
                },
                24 => {
                    self.kdf1 = ::std::option::Option::Some(is.read_int32()?);
                },
                34 => {
                    self.salt1 = ::std::option::Option::Some(is.read_bytes()?);
                },
                40 => {
                    self.kdf2 = ::std::option::Option::Some(is.read_int32()?);
                },
                50 => {
                    self.salt2 = ::std::option::Option::Some(is.read_bytes()?);
                },
                tag => {
                    ::steam_vent_proto_common::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.encrypted_ticket.as_ref() {
            my_size += ::steam_vent_proto_common::protobuf::rt::bytes_size(1, &v);
        }
        if let Some(v) = self.signature.as_ref() {
            my_size += ::steam_vent_proto_common::protobuf::rt::bytes_size(2, &v);
        }
        if let Some(v) = self.kdf1 {
            my_size += ::steam_vent_proto_common::protobuf::rt::int32_size(3, v);
        }
        if let Some(v) = self.salt1.as_ref() {
            my_size += ::steam_vent_proto_common::protobuf::rt::bytes_size(4, &v);
        }
        if let Some(v) = self.kdf2 {
            my_size += ::steam_vent_proto_common::protobuf::rt::int32_size(5, v);
        }
        if let Some(v) = self.salt2.as_ref() {
            my_size += ::steam_vent_proto_common::protobuf::rt::bytes_size(6, &v);
        }
        my_size += ::steam_vent_proto_common::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 ::steam_vent_proto_common::protobuf::CodedOutputStream<'_>) -> ::steam_vent_proto_common::protobuf::Result<()> {
        if let Some(v) = self.encrypted_ticket.as_ref() {
            os.write_bytes(1, v)?;
        }
        if let Some(v) = self.signature.as_ref() {
            os.write_bytes(2, v)?;
        }
        if let Some(v) = self.kdf1 {
            os.write_int32(3, v)?;
        }
        if let Some(v) = self.salt1.as_ref() {
            os.write_bytes(4, v)?;
        }
        if let Some(v) = self.kdf2 {
            os.write_int32(5, v)?;
        }
        if let Some(v) = self.salt2.as_ref() {
            os.write_bytes(6, v)?;
        }
        os.write_unknown_fields(self.special_fields.unknown_fields())?;
        ::std::result::Result::Ok(())
    }

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

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

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

    fn clear(&mut self) {
        self.encrypted_ticket = ::std::option::Option::None;
        self.signature = ::std::option::Option::None;
        self.kdf1 = ::std::option::Option::None;
        self.salt1 = ::std::option::Option::None;
        self.kdf2 = ::std::option::Option::None;
        self.salt2 = ::std::option::Option::None;
        self.special_fields.clear();
    }

    fn default_instance() -> &'static Offline_Ticket {
        static instance: Offline_Ticket = Offline_Ticket {
            encrypted_ticket: ::std::option::Option::None,
            signature: ::std::option::Option::None,
            kdf1: ::std::option::Option::None,
            salt1: ::std::option::Option::None,
            kdf2: ::std::option::Option::None,
            salt2: ::std::option::Option::None,
            special_fields: ::steam_vent_proto_common::protobuf::SpecialFields::new(),
        };
        &instance
    }
}


const _VENT_PROTO_VERSION_CHECK: () = ::steam_vent_proto_common::VERSION_0_5_0;

impl ::steam_vent_proto_common::RpcMessage for Offline_Ticket {
    fn parse(reader: &mut dyn std::io::Read) -> ::steam_vent_proto_common::protobuf::Result<Self> {
        <Self as ::steam_vent_proto_common::protobuf::Message>::parse_from_reader(reader)
    }
    fn write(&self, writer: &mut dyn std::io::Write) -> ::steam_vent_proto_common::protobuf::Result<()> {
        use ::steam_vent_proto_common::protobuf::Message;
        self.write_to_writer(writer)
    }
    fn encode_size(&self) -> usize {
        use ::steam_vent_proto_common::protobuf::Message;
        self.compute_size() as usize
    }
}
