// This file is generated by rust-protobuf 3.7.2. 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 `session.proto`

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

// @@protoc_insertion_point(message:spotify.player.proto.transfer.Session)
#[derive(PartialEq,Clone,Default,Debug)]
pub struct Session {
    // message fields
    // @@protoc_insertion_point(field:spotify.player.proto.transfer.Session.play_origin)
    pub play_origin: ::protobuf::MessageField<super::play_origin::PlayOrigin>,
    // @@protoc_insertion_point(field:spotify.player.proto.transfer.Session.context)
    pub context: ::protobuf::MessageField<super::context::Context>,
    // @@protoc_insertion_point(field:spotify.player.proto.transfer.Session.current_uid)
    pub current_uid: ::std::option::Option<::std::string::String>,
    // @@protoc_insertion_point(field:spotify.player.proto.transfer.Session.option_overrides)
    pub option_overrides: ::protobuf::MessageField<super::context_player_options::ContextPlayerOptionOverrides>,
    // @@protoc_insertion_point(field:spotify.player.proto.transfer.Session.suppressions)
    pub suppressions: ::protobuf::MessageField<super::suppressions::Suppressions>,
    // @@protoc_insertion_point(field:spotify.player.proto.transfer.Session.instrumentation_params)
    pub instrumentation_params: ::protobuf::MessageField<super::instrumentation_params::InstrumentationParams>,
    // @@protoc_insertion_point(field:spotify.player.proto.transfer.Session.shuffle_seed)
    pub shuffle_seed: ::std::option::Option<::std::string::String>,
    // @@protoc_insertion_point(field:spotify.player.proto.transfer.Session.main_context)
    pub main_context: ::protobuf::MessageField<super::context::Context>,
    // @@protoc_insertion_point(field:spotify.player.proto.transfer.Session.original_session_id)
    pub original_session_id: ::std::option::Option<::std::string::String>,
    // special fields
    // @@protoc_insertion_point(special_field:spotify.player.proto.transfer.Session.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

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

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

    // optional string current_uid = 3;

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

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

    pub fn has_current_uid(&self) -> bool {
        self.current_uid.is_some()
    }

    // Param is passed by value, moved
    pub fn set_current_uid(&mut self, v: ::std::string::String) {
        self.current_uid = ::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_current_uid(&mut self) -> &mut ::std::string::String {
        if self.current_uid.is_none() {
            self.current_uid = ::std::option::Option::Some(::std::string::String::new());
        }
        self.current_uid.as_mut().unwrap()
    }

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

    // optional string shuffle_seed = 7;

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

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

    pub fn has_shuffle_seed(&self) -> bool {
        self.shuffle_seed.is_some()
    }

    // Param is passed by value, moved
    pub fn set_shuffle_seed(&mut self, v: ::std::string::String) {
        self.shuffle_seed = ::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_shuffle_seed(&mut self) -> &mut ::std::string::String {
        if self.shuffle_seed.is_none() {
            self.shuffle_seed = ::std::option::Option::Some(::std::string::String::new());
        }
        self.shuffle_seed.as_mut().unwrap()
    }

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

    // optional string original_session_id = 9;

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

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

    pub fn has_original_session_id(&self) -> bool {
        self.original_session_id.is_some()
    }

    // Param is passed by value, moved
    pub fn set_original_session_id(&mut self, v: ::std::string::String) {
        self.original_session_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_original_session_id(&mut self) -> &mut ::std::string::String {
        if self.original_session_id.is_none() {
            self.original_session_id = ::std::option::Option::Some(::std::string::String::new());
        }
        self.original_session_id.as_mut().unwrap()
    }

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

    fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
        let mut fields = ::std::vec::Vec::with_capacity(9);
        let mut oneofs = ::std::vec::Vec::with_capacity(0);
        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::play_origin::PlayOrigin>(
            "play_origin",
            |m: &Session| { &m.play_origin },
            |m: &mut Session| { &mut m.play_origin },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::context::Context>(
            "context",
            |m: &Session| { &m.context },
            |m: &mut Session| { &mut m.context },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "current_uid",
            |m: &Session| { &m.current_uid },
            |m: &mut Session| { &mut m.current_uid },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::context_player_options::ContextPlayerOptionOverrides>(
            "option_overrides",
            |m: &Session| { &m.option_overrides },
            |m: &mut Session| { &mut m.option_overrides },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::suppressions::Suppressions>(
            "suppressions",
            |m: &Session| { &m.suppressions },
            |m: &mut Session| { &mut m.suppressions },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::instrumentation_params::InstrumentationParams>(
            "instrumentation_params",
            |m: &Session| { &m.instrumentation_params },
            |m: &mut Session| { &mut m.instrumentation_params },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "shuffle_seed",
            |m: &Session| { &m.shuffle_seed },
            |m: &mut Session| { &mut m.shuffle_seed },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::context::Context>(
            "main_context",
            |m: &Session| { &m.main_context },
            |m: &mut Session| { &mut m.main_context },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "original_session_id",
            |m: &Session| { &m.original_session_id },
            |m: &mut Session| { &mut m.original_session_id },
        ));
        ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<Session>(
            "Session",
            fields,
            oneofs,
        )
    }
}

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

    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 {
                10 => {
                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.play_origin)?;
                },
                18 => {
                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.context)?;
                },
                26 => {
                    self.current_uid = ::std::option::Option::Some(is.read_string()?);
                },
                34 => {
                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.option_overrides)?;
                },
                42 => {
                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.suppressions)?;
                },
                50 => {
                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.instrumentation_params)?;
                },
                58 => {
                    self.shuffle_seed = ::std::option::Option::Some(is.read_string()?);
                },
                66 => {
                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.main_context)?;
                },
                74 => {
                    self.original_session_id = ::std::option::Option::Some(is.read_string()?);
                },
                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.play_origin.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
        }
        if let Some(v) = self.context.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
        }
        if let Some(v) = self.current_uid.as_ref() {
            my_size += ::protobuf::rt::string_size(3, &v);
        }
        if let Some(v) = self.option_overrides.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
        }
        if let Some(v) = self.suppressions.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
        }
        if let Some(v) = self.instrumentation_params.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
        }
        if let Some(v) = self.shuffle_seed.as_ref() {
            my_size += ::protobuf::rt::string_size(7, &v);
        }
        if let Some(v) = self.main_context.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
        }
        if let Some(v) = self.original_session_id.as_ref() {
            my_size += ::protobuf::rt::string_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.play_origin.as_ref() {
            ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
        }
        if let Some(v) = self.context.as_ref() {
            ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
        }
        if let Some(v) = self.current_uid.as_ref() {
            os.write_string(3, v)?;
        }
        if let Some(v) = self.option_overrides.as_ref() {
            ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?;
        }
        if let Some(v) = self.suppressions.as_ref() {
            ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?;
        }
        if let Some(v) = self.instrumentation_params.as_ref() {
            ::protobuf::rt::write_message_field_with_cached_size(6, v, os)?;
        }
        if let Some(v) = self.shuffle_seed.as_ref() {
            os.write_string(7, v)?;
        }
        if let Some(v) = self.main_context.as_ref() {
            ::protobuf::rt::write_message_field_with_cached_size(8, v, os)?;
        }
        if let Some(v) = self.original_session_id.as_ref() {
            os.write_string(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() -> Session {
        Session::new()
    }

    fn clear(&mut self) {
        self.play_origin.clear();
        self.context.clear();
        self.current_uid = ::std::option::Option::None;
        self.option_overrides.clear();
        self.suppressions.clear();
        self.instrumentation_params.clear();
        self.shuffle_seed = ::std::option::Option::None;
        self.main_context.clear();
        self.original_session_id = ::std::option::Option::None;
        self.special_fields.clear();
    }

    fn default_instance() -> &'static Session {
        static instance: Session = Session {
            play_origin: ::protobuf::MessageField::none(),
            context: ::protobuf::MessageField::none(),
            current_uid: ::std::option::Option::None,
            option_overrides: ::protobuf::MessageField::none(),
            suppressions: ::protobuf::MessageField::none(),
            instrumentation_params: ::protobuf::MessageField::none(),
            shuffle_seed: ::std::option::Option::None,
            main_context: ::protobuf::MessageField::none(),
            original_session_id: ::std::option::Option::None,
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

impl ::protobuf::MessageFull for Session {
    fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
        static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
        descriptor.get(|| file_descriptor().message_by_package_relative_name("Session").unwrap()).clone()
    }
}

impl ::std::fmt::Display for Session {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        ::protobuf::text_format::fmt(self, f)
    }
}

impl ::protobuf::reflect::ProtobufValue for Session {
    type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}

static file_descriptor_proto_data: &'static [u8] = b"\
    \n\rsession.proto\x12\x1dspotify.player.proto.transfer\x1a\rcontext.prot\
    o\x1a\x1ccontext_player_options.proto\x1a\x11play_origin.proto\x1a\x12su\
    ppressions.proto\x1a\x1cinstrumentation_params.proto\"\xcf\x04\n\x07Sess\
    ion\x12A\n\x0bplay_origin\x18\x01\x20\x01(\x0b2\x20.spotify.player.proto\
    .PlayOriginR\nplayOrigin\x127\n\x07context\x18\x02\x20\x01(\x0b2\x1d.spo\
    tify.player.proto.ContextR\x07context\x12\x1f\n\x0bcurrent_uid\x18\x03\
    \x20\x01(\tR\ncurrentUid\x12]\n\x10option_overrides\x18\x04\x20\x01(\x0b\
    22.spotify.player.proto.ContextPlayerOptionOverridesR\x0foptionOverrides\
    \x12F\n\x0csuppressions\x18\x05\x20\x01(\x0b2\".spotify.player.proto.Sup\
    pressionsR\x0csuppressions\x12k\n\x16instrumentation_params\x18\x06\x20\
    \x01(\x0b24.spotify.player.proto.transfer.InstrumentationParamsR\x15inst\
    rumentationParams\x12!\n\x0cshuffle_seed\x18\x07\x20\x01(\tR\x0bshuffleS\
    eed\x12@\n\x0cmain_context\x18\x08\x20\x01(\x0b2\x1d.spotify.player.prot\
    o.ContextR\x0bmainContext\x12.\n\x13original_session_id\x18\t\x20\x01(\t\
    R\x11originalSessionIdB\x02H\x02b\x06proto2\
";

/// `FileDescriptorProto` object which was a source for this generated file
fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
    static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new();
    file_descriptor_proto_lazy.get(|| {
        ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
    })
}

/// `FileDescriptor` object which allows dynamic access to files
pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
    static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new();
    static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new();
    file_descriptor.get(|| {
        let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
            let mut deps = ::std::vec::Vec::with_capacity(5);
            deps.push(super::context::file_descriptor().clone());
            deps.push(super::context_player_options::file_descriptor().clone());
            deps.push(super::play_origin::file_descriptor().clone());
            deps.push(super::suppressions::file_descriptor().clone());
            deps.push(super::instrumentation_params::file_descriptor().clone());
            let mut messages = ::std::vec::Vec::with_capacity(1);
            messages.push(Session::generated_message_descriptor_data());
            let mut enums = ::std::vec::Vec::with_capacity(0);
            ::protobuf::reflect::GeneratedFileDescriptor::new_generated(
                file_descriptor_proto(),
                deps,
                messages,
                enums,
            )
        });
        ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
    })
}
