// 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 `play_origin.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.PlayOrigin)
#[derive(PartialEq,Clone,Default,Debug)]
pub struct PlayOrigin {
    // message fields
    // @@protoc_insertion_point(field:spotify.player.proto.PlayOrigin.feature_identifier)
    pub feature_identifier: ::std::option::Option<::std::string::String>,
    // @@protoc_insertion_point(field:spotify.player.proto.PlayOrigin.feature_version)
    pub feature_version: ::std::option::Option<::std::string::String>,
    // @@protoc_insertion_point(field:spotify.player.proto.PlayOrigin.view_uri)
    pub view_uri: ::std::option::Option<::std::string::String>,
    // @@protoc_insertion_point(field:spotify.player.proto.PlayOrigin.external_referrer)
    pub external_referrer: ::std::option::Option<::std::string::String>,
    // @@protoc_insertion_point(field:spotify.player.proto.PlayOrigin.referrer_identifier)
    pub referrer_identifier: ::std::option::Option<::std::string::String>,
    // @@protoc_insertion_point(field:spotify.player.proto.PlayOrigin.device_identifier)
    pub device_identifier: ::std::option::Option<::std::string::String>,
    // @@protoc_insertion_point(field:spotify.player.proto.PlayOrigin.feature_classes)
    pub feature_classes: ::std::vec::Vec<::std::string::String>,
    // @@protoc_insertion_point(field:spotify.player.proto.PlayOrigin.restriction_identifier)
    pub restriction_identifier: ::std::option::Option<::std::string::String>,
    // special fields
    // @@protoc_insertion_point(special_field:spotify.player.proto.PlayOrigin.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

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

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

    // optional string feature_identifier = 1;

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

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

    pub fn has_feature_identifier(&self) -> bool {
        self.feature_identifier.is_some()
    }

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

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

    // optional string feature_version = 2;

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

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

    pub fn has_feature_version(&self) -> bool {
        self.feature_version.is_some()
    }

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

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

    // optional string view_uri = 3;

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

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

    pub fn has_view_uri(&self) -> bool {
        self.view_uri.is_some()
    }

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

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

    // optional string external_referrer = 4;

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

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

    pub fn has_external_referrer(&self) -> bool {
        self.external_referrer.is_some()
    }

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

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

    // optional string referrer_identifier = 5;

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

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

    pub fn has_referrer_identifier(&self) -> bool {
        self.referrer_identifier.is_some()
    }

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

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

    // optional string device_identifier = 6;

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

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

    pub fn has_device_identifier(&self) -> bool {
        self.device_identifier.is_some()
    }

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

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

    // optional string restriction_identifier = 8;

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

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

    pub fn has_restriction_identifier(&self) -> bool {
        self.restriction_identifier.is_some()
    }

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

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

    fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
        let mut fields = ::std::vec::Vec::with_capacity(8);
        let mut oneofs = ::std::vec::Vec::with_capacity(0);
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "feature_identifier",
            |m: &PlayOrigin| { &m.feature_identifier },
            |m: &mut PlayOrigin| { &mut m.feature_identifier },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "feature_version",
            |m: &PlayOrigin| { &m.feature_version },
            |m: &mut PlayOrigin| { &mut m.feature_version },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "view_uri",
            |m: &PlayOrigin| { &m.view_uri },
            |m: &mut PlayOrigin| { &mut m.view_uri },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "external_referrer",
            |m: &PlayOrigin| { &m.external_referrer },
            |m: &mut PlayOrigin| { &mut m.external_referrer },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "referrer_identifier",
            |m: &PlayOrigin| { &m.referrer_identifier },
            |m: &mut PlayOrigin| { &mut m.referrer_identifier },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "device_identifier",
            |m: &PlayOrigin| { &m.device_identifier },
            |m: &mut PlayOrigin| { &mut m.device_identifier },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
            "feature_classes",
            |m: &PlayOrigin| { &m.feature_classes },
            |m: &mut PlayOrigin| { &mut m.feature_classes },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
            "restriction_identifier",
            |m: &PlayOrigin| { &m.restriction_identifier },
            |m: &mut PlayOrigin| { &mut m.restriction_identifier },
        ));
        ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<PlayOrigin>(
            "PlayOrigin",
            fields,
            oneofs,
        )
    }
}

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

    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 => {
                    self.feature_identifier = ::std::option::Option::Some(is.read_string()?);
                },
                18 => {
                    self.feature_version = ::std::option::Option::Some(is.read_string()?);
                },
                26 => {
                    self.view_uri = ::std::option::Option::Some(is.read_string()?);
                },
                34 => {
                    self.external_referrer = ::std::option::Option::Some(is.read_string()?);
                },
                42 => {
                    self.referrer_identifier = ::std::option::Option::Some(is.read_string()?);
                },
                50 => {
                    self.device_identifier = ::std::option::Option::Some(is.read_string()?);
                },
                58 => {
                    self.feature_classes.push(is.read_string()?);
                },
                66 => {
                    self.restriction_identifier = ::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.feature_identifier.as_ref() {
            my_size += ::protobuf::rt::string_size(1, &v);
        }
        if let Some(v) = self.feature_version.as_ref() {
            my_size += ::protobuf::rt::string_size(2, &v);
        }
        if let Some(v) = self.view_uri.as_ref() {
            my_size += ::protobuf::rt::string_size(3, &v);
        }
        if let Some(v) = self.external_referrer.as_ref() {
            my_size += ::protobuf::rt::string_size(4, &v);
        }
        if let Some(v) = self.referrer_identifier.as_ref() {
            my_size += ::protobuf::rt::string_size(5, &v);
        }
        if let Some(v) = self.device_identifier.as_ref() {
            my_size += ::protobuf::rt::string_size(6, &v);
        }
        for value in &self.feature_classes {
            my_size += ::protobuf::rt::string_size(7, &value);
        };
        if let Some(v) = self.restriction_identifier.as_ref() {
            my_size += ::protobuf::rt::string_size(8, &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.feature_identifier.as_ref() {
            os.write_string(1, v)?;
        }
        if let Some(v) = self.feature_version.as_ref() {
            os.write_string(2, v)?;
        }
        if let Some(v) = self.view_uri.as_ref() {
            os.write_string(3, v)?;
        }
        if let Some(v) = self.external_referrer.as_ref() {
            os.write_string(4, v)?;
        }
        if let Some(v) = self.referrer_identifier.as_ref() {
            os.write_string(5, v)?;
        }
        if let Some(v) = self.device_identifier.as_ref() {
            os.write_string(6, v)?;
        }
        for v in &self.feature_classes {
            os.write_string(7, &v)?;
        };
        if let Some(v) = self.restriction_identifier.as_ref() {
            os.write_string(8, 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() -> PlayOrigin {
        PlayOrigin::new()
    }

    fn clear(&mut self) {
        self.feature_identifier = ::std::option::Option::None;
        self.feature_version = ::std::option::Option::None;
        self.view_uri = ::std::option::Option::None;
        self.external_referrer = ::std::option::Option::None;
        self.referrer_identifier = ::std::option::Option::None;
        self.device_identifier = ::std::option::Option::None;
        self.feature_classes.clear();
        self.restriction_identifier = ::std::option::Option::None;
        self.special_fields.clear();
    }

    fn default_instance() -> &'static PlayOrigin {
        static instance: PlayOrigin = PlayOrigin {
            feature_identifier: ::std::option::Option::None,
            feature_version: ::std::option::Option::None,
            view_uri: ::std::option::Option::None,
            external_referrer: ::std::option::Option::None,
            referrer_identifier: ::std::option::Option::None,
            device_identifier: ::std::option::Option::None,
            feature_classes: ::std::vec::Vec::new(),
            restriction_identifier: ::std::option::Option::None,
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

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

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

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

static file_descriptor_proto_data: &'static [u8] = b"\
    \n\x11play_origin.proto\x12\x14spotify.player.proto\"\xea\x02\n\nPlayOri\
    gin\x12-\n\x12feature_identifier\x18\x01\x20\x01(\tR\x11featureIdentifie\
    r\x12'\n\x0ffeature_version\x18\x02\x20\x01(\tR\x0efeatureVersion\x12\
    \x19\n\x08view_uri\x18\x03\x20\x01(\tR\x07viewUri\x12+\n\x11external_ref\
    errer\x18\x04\x20\x01(\tR\x10externalReferrer\x12/\n\x13referrer_identif\
    ier\x18\x05\x20\x01(\tR\x12referrerIdentifier\x12+\n\x11device_identifie\
    r\x18\x06\x20\x01(\tR\x10deviceIdentifier\x12'\n\x0ffeature_classes\x18\
    \x07\x20\x03(\tR\x0efeatureClasses\x125\n\x16restriction_identifier\x18\
    \x08\x20\x01(\tR\x15restrictionIdentifierB\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(0);
            let mut messages = ::std::vec::Vec::with_capacity(1);
            messages.push(PlayOrigin::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)
    })
}
