// 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 `playback.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.Playback)
#[derive(PartialEq,Clone,Default,Debug)]
pub struct Playback {
    // message fields
    // @@protoc_insertion_point(field:spotify.player.proto.transfer.Playback.timestamp)
    pub timestamp: ::std::option::Option<i64>,
    // @@protoc_insertion_point(field:spotify.player.proto.transfer.Playback.position_as_of_timestamp)
    pub position_as_of_timestamp: ::std::option::Option<i32>,
    // @@protoc_insertion_point(field:spotify.player.proto.transfer.Playback.playback_speed)
    pub playback_speed: ::std::option::Option<f64>,
    // @@protoc_insertion_point(field:spotify.player.proto.transfer.Playback.is_paused)
    pub is_paused: ::std::option::Option<bool>,
    // @@protoc_insertion_point(field:spotify.player.proto.transfer.Playback.current_track)
    pub current_track: ::protobuf::MessageField<super::context_track::ContextTrack>,
    // @@protoc_insertion_point(field:spotify.player.proto.transfer.Playback.associated_current_track)
    pub associated_current_track: ::protobuf::MessageField<super::context_track::ContextTrack>,
    // @@protoc_insertion_point(field:spotify.player.proto.transfer.Playback.associated_position_as_of_timestamp)
    pub associated_position_as_of_timestamp: ::std::option::Option<i32>,
    // special fields
    // @@protoc_insertion_point(special_field:spotify.player.proto.transfer.Playback.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

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

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

    // optional int64 timestamp = 1;

    pub fn timestamp(&self) -> i64 {
        self.timestamp.unwrap_or(0)
    }

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

    pub fn has_timestamp(&self) -> bool {
        self.timestamp.is_some()
    }

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

    // optional int32 position_as_of_timestamp = 2;

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

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

    pub fn has_position_as_of_timestamp(&self) -> bool {
        self.position_as_of_timestamp.is_some()
    }

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

    // optional double playback_speed = 3;

    pub fn playback_speed(&self) -> f64 {
        self.playback_speed.unwrap_or(0.)
    }

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

    pub fn has_playback_speed(&self) -> bool {
        self.playback_speed.is_some()
    }

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

    // optional bool is_paused = 4;

    pub fn is_paused(&self) -> bool {
        self.is_paused.unwrap_or(false)
    }

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

    pub fn has_is_paused(&self) -> bool {
        self.is_paused.is_some()
    }

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

    // optional int32 associated_position_as_of_timestamp = 7;

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

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

    pub fn has_associated_position_as_of_timestamp(&self) -> bool {
        self.associated_position_as_of_timestamp.is_some()
    }

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

    fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
        let mut fields = ::std::vec::Vec::with_capacity(7);
        let mut oneofs = ::std::vec::Vec::with_capacity(0);
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "timestamp",
            |m: &Playback| { &m.timestamp },
            |m: &mut Playback| { &mut m.timestamp },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "position_as_of_timestamp",
            |m: &Playback| { &m.position_as_of_timestamp },
            |m: &mut Playback| { &mut m.position_as_of_timestamp },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "playback_speed",
            |m: &Playback| { &m.playback_speed },
            |m: &mut Playback| { &mut m.playback_speed },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "is_paused",
            |m: &Playback| { &m.is_paused },
            |m: &mut Playback| { &mut m.is_paused },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::context_track::ContextTrack>(
            "current_track",
            |m: &Playback| { &m.current_track },
            |m: &mut Playback| { &mut m.current_track },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, super::context_track::ContextTrack>(
            "associated_current_track",
            |m: &Playback| { &m.associated_current_track },
            |m: &mut Playback| { &mut m.associated_current_track },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "associated_position_as_of_timestamp",
            |m: &Playback| { &m.associated_position_as_of_timestamp },
            |m: &mut Playback| { &mut m.associated_position_as_of_timestamp },
        ));
        ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<Playback>(
            "Playback",
            fields,
            oneofs,
        )
    }
}

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

    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.timestamp = ::std::option::Option::Some(is.read_int64()?);
                },
                16 => {
                    self.position_as_of_timestamp = ::std::option::Option::Some(is.read_int32()?);
                },
                25 => {
                    self.playback_speed = ::std::option::Option::Some(is.read_double()?);
                },
                32 => {
                    self.is_paused = ::std::option::Option::Some(is.read_bool()?);
                },
                42 => {
                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.current_track)?;
                },
                50 => {
                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.associated_current_track)?;
                },
                56 => {
                    self.associated_position_as_of_timestamp = ::std::option::Option::Some(is.read_int32()?);
                },
                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.timestamp {
            my_size += ::protobuf::rt::int64_size(1, v);
        }
        if let Some(v) = self.position_as_of_timestamp {
            my_size += ::protobuf::rt::int32_size(2, v);
        }
        if let Some(v) = self.playback_speed {
            my_size += 1 + 8;
        }
        if let Some(v) = self.is_paused {
            my_size += 1 + 1;
        }
        if let Some(v) = self.current_track.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
        }
        if let Some(v) = self.associated_current_track.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
        }
        if let Some(v) = self.associated_position_as_of_timestamp {
            my_size += ::protobuf::rt::int32_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.timestamp {
            os.write_int64(1, v)?;
        }
        if let Some(v) = self.position_as_of_timestamp {
            os.write_int32(2, v)?;
        }
        if let Some(v) = self.playback_speed {
            os.write_double(3, v)?;
        }
        if let Some(v) = self.is_paused {
            os.write_bool(4, v)?;
        }
        if let Some(v) = self.current_track.as_ref() {
            ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?;
        }
        if let Some(v) = self.associated_current_track.as_ref() {
            ::protobuf::rt::write_message_field_with_cached_size(6, v, os)?;
        }
        if let Some(v) = self.associated_position_as_of_timestamp {
            os.write_int32(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() -> Playback {
        Playback::new()
    }

    fn clear(&mut self) {
        self.timestamp = ::std::option::Option::None;
        self.position_as_of_timestamp = ::std::option::Option::None;
        self.playback_speed = ::std::option::Option::None;
        self.is_paused = ::std::option::Option::None;
        self.current_track.clear();
        self.associated_current_track.clear();
        self.associated_position_as_of_timestamp = ::std::option::Option::None;
        self.special_fields.clear();
    }

    fn default_instance() -> &'static Playback {
        static instance: Playback = Playback {
            timestamp: ::std::option::Option::None,
            position_as_of_timestamp: ::std::option::Option::None,
            playback_speed: ::std::option::Option::None,
            is_paused: ::std::option::Option::None,
            current_track: ::protobuf::MessageField::none(),
            associated_current_track: ::protobuf::MessageField::none(),
            associated_position_as_of_timestamp: ::std::option::Option::None,
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

impl ::protobuf::MessageFull for Playback {
    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("Playback").unwrap()).clone()
    }
}

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

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

static file_descriptor_proto_data: &'static [u8] = b"\
    \n\x0eplayback.proto\x12\x1dspotify.player.proto.transfer\x1a\x13context\
    _track.proto\"\x9a\x03\n\x08Playback\x12\x1c\n\ttimestamp\x18\x01\x20\
    \x01(\x03R\ttimestamp\x127\n\x18position_as_of_timestamp\x18\x02\x20\x01\
    (\x05R\x15positionAsOfTimestamp\x12%\n\x0eplayback_speed\x18\x03\x20\x01\
    (\x01R\rplaybackSpeed\x12\x1b\n\tis_paused\x18\x04\x20\x01(\x08R\x08isPa\
    used\x12G\n\rcurrent_track\x18\x05\x20\x01(\x0b2\".spotify.player.proto.\
    ContextTrackR\x0ccurrentTrack\x12\\\n\x18associated_current_track\x18\
    \x06\x20\x01(\x0b2\".spotify.player.proto.ContextTrackR\x16associatedCur\
    rentTrack\x12L\n#associated_position_as_of_timestamp\x18\x07\x20\x01(\
    \x05R\x1fassociatedPositionAsOfTimestampB\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(1);
            deps.push(super::context_track::file_descriptor().clone());
            let mut messages = ::std::vec::Vec::with_capacity(1);
            messages.push(Playback::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)
    })
}
