// This file is generated by rust-protobuf 2.24.1. Do not edit
// @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_imports)]
#![allow(unused_results)]
//! Generated file from `opentelemetry/proto/trace/v1/trace_config.proto`

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

#[derive(PartialEq,Clone,Default)]
#[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
pub struct TraceConfig {
    // message fields
    pub max_number_of_attributes: i64,
    pub max_number_of_timed_events: i64,
    pub max_number_of_attributes_per_timed_event: i64,
    pub max_number_of_links: i64,
    pub max_number_of_attributes_per_link: i64,
    // message oneof groups
    pub sampler: ::std::option::Option<TraceConfig_oneof_sampler>,
    // special fields
    #[cfg_attr(feature = "with-serde", serde(skip))]
    pub unknown_fields: ::protobuf::UnknownFields,
    #[cfg_attr(feature = "with-serde", serde(skip))]
    pub cached_size: ::protobuf::CachedSize,
}

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

#[derive(Clone,PartialEq,Debug)]
#[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
pub enum TraceConfig_oneof_sampler {
    constant_sampler(ConstantSampler),
    trace_id_ratio_based(TraceIdRatioBased),
    rate_limiting_sampler(RateLimitingSampler),
}

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

    // .opentelemetry.proto.trace.v1.ConstantSampler constant_sampler = 1;


    pub fn get_constant_sampler(&self) -> &ConstantSampler {
        match self.sampler {
            ::std::option::Option::Some(TraceConfig_oneof_sampler::constant_sampler(ref v)) => v,
            _ => <ConstantSampler as ::protobuf::Message>::default_instance(),
        }
    }
    pub fn clear_constant_sampler(&mut self) {
        self.sampler = ::std::option::Option::None;
    }

    pub fn has_constant_sampler(&self) -> bool {
        match self.sampler {
            ::std::option::Option::Some(TraceConfig_oneof_sampler::constant_sampler(..)) => true,
            _ => false,
        }
    }

    // Param is passed by value, moved
    pub fn set_constant_sampler(&mut self, v: ConstantSampler) {
        self.sampler = ::std::option::Option::Some(TraceConfig_oneof_sampler::constant_sampler(v))
    }

    // Mutable pointer to the field.
    pub fn mut_constant_sampler(&mut self) -> &mut ConstantSampler {
        if let ::std::option::Option::Some(TraceConfig_oneof_sampler::constant_sampler(_)) = self.sampler {
        } else {
            self.sampler = ::std::option::Option::Some(TraceConfig_oneof_sampler::constant_sampler(ConstantSampler::new()));
        }
        match self.sampler {
            ::std::option::Option::Some(TraceConfig_oneof_sampler::constant_sampler(ref mut v)) => v,
            _ => panic!(),
        }
    }

    // Take field
    pub fn take_constant_sampler(&mut self) -> ConstantSampler {
        if self.has_constant_sampler() {
            match self.sampler.take() {
                ::std::option::Option::Some(TraceConfig_oneof_sampler::constant_sampler(v)) => v,
                _ => panic!(),
            }
        } else {
            ConstantSampler::new()
        }
    }

    // .opentelemetry.proto.trace.v1.TraceIdRatioBased trace_id_ratio_based = 2;


    pub fn get_trace_id_ratio_based(&self) -> &TraceIdRatioBased {
        match self.sampler {
            ::std::option::Option::Some(TraceConfig_oneof_sampler::trace_id_ratio_based(ref v)) => v,
            _ => <TraceIdRatioBased as ::protobuf::Message>::default_instance(),
        }
    }
    pub fn clear_trace_id_ratio_based(&mut self) {
        self.sampler = ::std::option::Option::None;
    }

    pub fn has_trace_id_ratio_based(&self) -> bool {
        match self.sampler {
            ::std::option::Option::Some(TraceConfig_oneof_sampler::trace_id_ratio_based(..)) => true,
            _ => false,
        }
    }

    // Param is passed by value, moved
    pub fn set_trace_id_ratio_based(&mut self, v: TraceIdRatioBased) {
        self.sampler = ::std::option::Option::Some(TraceConfig_oneof_sampler::trace_id_ratio_based(v))
    }

    // Mutable pointer to the field.
    pub fn mut_trace_id_ratio_based(&mut self) -> &mut TraceIdRatioBased {
        if let ::std::option::Option::Some(TraceConfig_oneof_sampler::trace_id_ratio_based(_)) = self.sampler {
        } else {
            self.sampler = ::std::option::Option::Some(TraceConfig_oneof_sampler::trace_id_ratio_based(TraceIdRatioBased::new()));
        }
        match self.sampler {
            ::std::option::Option::Some(TraceConfig_oneof_sampler::trace_id_ratio_based(ref mut v)) => v,
            _ => panic!(),
        }
    }

    // Take field
    pub fn take_trace_id_ratio_based(&mut self) -> TraceIdRatioBased {
        if self.has_trace_id_ratio_based() {
            match self.sampler.take() {
                ::std::option::Option::Some(TraceConfig_oneof_sampler::trace_id_ratio_based(v)) => v,
                _ => panic!(),
            }
        } else {
            TraceIdRatioBased::new()
        }
    }

    // .opentelemetry.proto.trace.v1.RateLimitingSampler rate_limiting_sampler = 3;


    pub fn get_rate_limiting_sampler(&self) -> &RateLimitingSampler {
        match self.sampler {
            ::std::option::Option::Some(TraceConfig_oneof_sampler::rate_limiting_sampler(ref v)) => v,
            _ => <RateLimitingSampler as ::protobuf::Message>::default_instance(),
        }
    }
    pub fn clear_rate_limiting_sampler(&mut self) {
        self.sampler = ::std::option::Option::None;
    }

    pub fn has_rate_limiting_sampler(&self) -> bool {
        match self.sampler {
            ::std::option::Option::Some(TraceConfig_oneof_sampler::rate_limiting_sampler(..)) => true,
            _ => false,
        }
    }

    // Param is passed by value, moved
    pub fn set_rate_limiting_sampler(&mut self, v: RateLimitingSampler) {
        self.sampler = ::std::option::Option::Some(TraceConfig_oneof_sampler::rate_limiting_sampler(v))
    }

    // Mutable pointer to the field.
    pub fn mut_rate_limiting_sampler(&mut self) -> &mut RateLimitingSampler {
        if let ::std::option::Option::Some(TraceConfig_oneof_sampler::rate_limiting_sampler(_)) = self.sampler {
        } else {
            self.sampler = ::std::option::Option::Some(TraceConfig_oneof_sampler::rate_limiting_sampler(RateLimitingSampler::new()));
        }
        match self.sampler {
            ::std::option::Option::Some(TraceConfig_oneof_sampler::rate_limiting_sampler(ref mut v)) => v,
            _ => panic!(),
        }
    }

    // Take field
    pub fn take_rate_limiting_sampler(&mut self) -> RateLimitingSampler {
        if self.has_rate_limiting_sampler() {
            match self.sampler.take() {
                ::std::option::Option::Some(TraceConfig_oneof_sampler::rate_limiting_sampler(v)) => v,
                _ => panic!(),
            }
        } else {
            RateLimitingSampler::new()
        }
    }

    // int64 max_number_of_attributes = 4;


    pub fn get_max_number_of_attributes(&self) -> i64 {
        self.max_number_of_attributes
    }
    pub fn clear_max_number_of_attributes(&mut self) {
        self.max_number_of_attributes = 0;
    }

    // Param is passed by value, moved
    pub fn set_max_number_of_attributes(&mut self, v: i64) {
        self.max_number_of_attributes = v;
    }

    // int64 max_number_of_timed_events = 5;


    pub fn get_max_number_of_timed_events(&self) -> i64 {
        self.max_number_of_timed_events
    }
    pub fn clear_max_number_of_timed_events(&mut self) {
        self.max_number_of_timed_events = 0;
    }

    // Param is passed by value, moved
    pub fn set_max_number_of_timed_events(&mut self, v: i64) {
        self.max_number_of_timed_events = v;
    }

    // int64 max_number_of_attributes_per_timed_event = 6;


    pub fn get_max_number_of_attributes_per_timed_event(&self) -> i64 {
        self.max_number_of_attributes_per_timed_event
    }
    pub fn clear_max_number_of_attributes_per_timed_event(&mut self) {
        self.max_number_of_attributes_per_timed_event = 0;
    }

    // Param is passed by value, moved
    pub fn set_max_number_of_attributes_per_timed_event(&mut self, v: i64) {
        self.max_number_of_attributes_per_timed_event = v;
    }

    // int64 max_number_of_links = 7;


    pub fn get_max_number_of_links(&self) -> i64 {
        self.max_number_of_links
    }
    pub fn clear_max_number_of_links(&mut self) {
        self.max_number_of_links = 0;
    }

    // Param is passed by value, moved
    pub fn set_max_number_of_links(&mut self, v: i64) {
        self.max_number_of_links = v;
    }

    // int64 max_number_of_attributes_per_link = 8;


    pub fn get_max_number_of_attributes_per_link(&self) -> i64 {
        self.max_number_of_attributes_per_link
    }
    pub fn clear_max_number_of_attributes_per_link(&mut self) {
        self.max_number_of_attributes_per_link = 0;
    }

    // Param is passed by value, moved
    pub fn set_max_number_of_attributes_per_link(&mut self, v: i64) {
        self.max_number_of_attributes_per_link = v;
    }
}

impl ::protobuf::Message for TraceConfig {
    fn is_initialized(&self) -> bool {
        if let Some(TraceConfig_oneof_sampler::constant_sampler(ref v)) = self.sampler {
            if !v.is_initialized() {
                return false;
            }
        }
        if let Some(TraceConfig_oneof_sampler::trace_id_ratio_based(ref v)) = self.sampler {
            if !v.is_initialized() {
                return false;
            }
        }
        if let Some(TraceConfig_oneof_sampler::rate_limiting_sampler(ref v)) = self.sampler {
            if !v.is_initialized() {
                return false;
            }
        }
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        while !is.eof()? {
            let (field_number, wire_type) = is.read_tag_unpack()?;
            match field_number {
                1 => {
                    if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                    }
                    self.sampler = ::std::option::Option::Some(TraceConfig_oneof_sampler::constant_sampler(is.read_message()?));
                },
                2 => {
                    if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                    }
                    self.sampler = ::std::option::Option::Some(TraceConfig_oneof_sampler::trace_id_ratio_based(is.read_message()?));
                },
                3 => {
                    if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                    }
                    self.sampler = ::std::option::Option::Some(TraceConfig_oneof_sampler::rate_limiting_sampler(is.read_message()?));
                },
                4 => {
                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                    }
                    let tmp = is.read_int64()?;
                    self.max_number_of_attributes = tmp;
                },
                5 => {
                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                    }
                    let tmp = is.read_int64()?;
                    self.max_number_of_timed_events = tmp;
                },
                6 => {
                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                    }
                    let tmp = is.read_int64()?;
                    self.max_number_of_attributes_per_timed_event = tmp;
                },
                7 => {
                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                    }
                    let tmp = is.read_int64()?;
                    self.max_number_of_links = tmp;
                },
                8 => {
                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                    }
                    let tmp = is.read_int64()?;
                    self.max_number_of_attributes_per_link = tmp;
                },
                _ => {
                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u32 {
        let mut my_size = 0;
        if self.max_number_of_attributes != 0 {
            my_size += ::protobuf::rt::value_size(4, self.max_number_of_attributes, ::protobuf::wire_format::WireTypeVarint);
        }
        if self.max_number_of_timed_events != 0 {
            my_size += ::protobuf::rt::value_size(5, self.max_number_of_timed_events, ::protobuf::wire_format::WireTypeVarint);
        }
        if self.max_number_of_attributes_per_timed_event != 0 {
            my_size += ::protobuf::rt::value_size(6, self.max_number_of_attributes_per_timed_event, ::protobuf::wire_format::WireTypeVarint);
        }
        if self.max_number_of_links != 0 {
            my_size += ::protobuf::rt::value_size(7, self.max_number_of_links, ::protobuf::wire_format::WireTypeVarint);
        }
        if self.max_number_of_attributes_per_link != 0 {
            my_size += ::protobuf::rt::value_size(8, self.max_number_of_attributes_per_link, ::protobuf::wire_format::WireTypeVarint);
        }
        if let ::std::option::Option::Some(ref v) = self.sampler {
            match v {
                &TraceConfig_oneof_sampler::constant_sampler(ref v) => {
                    let len = v.compute_size();
                    my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
                },
                &TraceConfig_oneof_sampler::trace_id_ratio_based(ref v) => {
                    let len = v.compute_size();
                    my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
                },
                &TraceConfig_oneof_sampler::rate_limiting_sampler(ref v) => {
                    let len = v.compute_size();
                    my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
                },
            };
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
        self.cached_size.set(my_size);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        if self.max_number_of_attributes != 0 {
            os.write_int64(4, self.max_number_of_attributes)?;
        }
        if self.max_number_of_timed_events != 0 {
            os.write_int64(5, self.max_number_of_timed_events)?;
        }
        if self.max_number_of_attributes_per_timed_event != 0 {
            os.write_int64(6, self.max_number_of_attributes_per_timed_event)?;
        }
        if self.max_number_of_links != 0 {
            os.write_int64(7, self.max_number_of_links)?;
        }
        if self.max_number_of_attributes_per_link != 0 {
            os.write_int64(8, self.max_number_of_attributes_per_link)?;
        }
        if let ::std::option::Option::Some(ref v) = self.sampler {
            match v {
                &TraceConfig_oneof_sampler::constant_sampler(ref v) => {
                    os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
                    os.write_raw_varint32(v.get_cached_size())?;
                    v.write_to_with_cached_sizes(os)?;
                },
                &TraceConfig_oneof_sampler::trace_id_ratio_based(ref v) => {
                    os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
                    os.write_raw_varint32(v.get_cached_size())?;
                    v.write_to_with_cached_sizes(os)?;
                },
                &TraceConfig_oneof_sampler::rate_limiting_sampler(ref v) => {
                    os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?;
                    os.write_raw_varint32(v.get_cached_size())?;
                    v.write_to_with_cached_sizes(os)?;
                },
            };
        }
        os.write_unknown_fields(self.get_unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn get_cached_size(&self) -> u32 {
        self.cached_size.get()
    }

    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
        &self.unknown_fields
    }

    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
        &mut self.unknown_fields
    }

    fn as_any(&self) -> &dyn (::std::any::Any) {
        self as &dyn (::std::any::Any)
    }
    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
        self as &mut dyn (::std::any::Any)
    }
    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
        self
    }

    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
        Self::descriptor_static()
    }

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

    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
        descriptor.get(|| {
            let mut fields = ::std::vec::Vec::new();
            fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, ConstantSampler>(
                "constant_sampler",
                TraceConfig::has_constant_sampler,
                TraceConfig::get_constant_sampler,
            ));
            fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, TraceIdRatioBased>(
                "trace_id_ratio_based",
                TraceConfig::has_trace_id_ratio_based,
                TraceConfig::get_trace_id_ratio_based,
            ));
            fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, RateLimitingSampler>(
                "rate_limiting_sampler",
                TraceConfig::has_rate_limiting_sampler,
                TraceConfig::get_rate_limiting_sampler,
            ));
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
                "max_number_of_attributes",
                |m: &TraceConfig| { &m.max_number_of_attributes },
                |m: &mut TraceConfig| { &mut m.max_number_of_attributes },
            ));
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
                "max_number_of_timed_events",
                |m: &TraceConfig| { &m.max_number_of_timed_events },
                |m: &mut TraceConfig| { &mut m.max_number_of_timed_events },
            ));
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
                "max_number_of_attributes_per_timed_event",
                |m: &TraceConfig| { &m.max_number_of_attributes_per_timed_event },
                |m: &mut TraceConfig| { &mut m.max_number_of_attributes_per_timed_event },
            ));
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
                "max_number_of_links",
                |m: &TraceConfig| { &m.max_number_of_links },
                |m: &mut TraceConfig| { &mut m.max_number_of_links },
            ));
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
                "max_number_of_attributes_per_link",
                |m: &TraceConfig| { &m.max_number_of_attributes_per_link },
                |m: &mut TraceConfig| { &mut m.max_number_of_attributes_per_link },
            ));
            ::protobuf::reflect::MessageDescriptor::new_pb_name::<TraceConfig>(
                "TraceConfig",
                fields,
                file_descriptor_proto()
            )
        })
    }

    fn default_instance() -> &'static TraceConfig {
        static instance: ::protobuf::rt::LazyV2<TraceConfig> = ::protobuf::rt::LazyV2::INIT;
        instance.get(TraceConfig::new)
    }
}

impl ::protobuf::Clear for TraceConfig {
    fn clear(&mut self) {
        self.sampler = ::std::option::Option::None;
        self.sampler = ::std::option::Option::None;
        self.sampler = ::std::option::Option::None;
        self.max_number_of_attributes = 0;
        self.max_number_of_timed_events = 0;
        self.max_number_of_attributes_per_timed_event = 0;
        self.max_number_of_links = 0;
        self.max_number_of_attributes_per_link = 0;
        self.unknown_fields.clear();
    }
}

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

impl ::protobuf::reflect::ProtobufValue for TraceConfig {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Message(self)
    }
}

#[derive(PartialEq,Clone,Default)]
#[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
pub struct ConstantSampler {
    // message fields
    pub decision: ConstantSampler_ConstantDecision,
    // special fields
    #[cfg_attr(feature = "with-serde", serde(skip))]
    pub unknown_fields: ::protobuf::UnknownFields,
    #[cfg_attr(feature = "with-serde", serde(skip))]
    pub cached_size: ::protobuf::CachedSize,
}

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

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

    // .opentelemetry.proto.trace.v1.ConstantSampler.ConstantDecision decision = 1;


    pub fn get_decision(&self) -> ConstantSampler_ConstantDecision {
        self.decision
    }
    pub fn clear_decision(&mut self) {
        self.decision = ConstantSampler_ConstantDecision::ALWAYS_OFF;
    }

    // Param is passed by value, moved
    pub fn set_decision(&mut self, v: ConstantSampler_ConstantDecision) {
        self.decision = v;
    }
}

impl ::protobuf::Message for ConstantSampler {
    fn is_initialized(&self) -> bool {
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        while !is.eof()? {
            let (field_number, wire_type) = is.read_tag_unpack()?;
            match field_number {
                1 => {
                    ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.decision, 1, &mut self.unknown_fields)?
                },
                _ => {
                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u32 {
        let mut my_size = 0;
        if self.decision != ConstantSampler_ConstantDecision::ALWAYS_OFF {
            my_size += ::protobuf::rt::enum_size(1, self.decision);
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
        self.cached_size.set(my_size);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        if self.decision != ConstantSampler_ConstantDecision::ALWAYS_OFF {
            os.write_enum(1, ::protobuf::ProtobufEnum::value(&self.decision))?;
        }
        os.write_unknown_fields(self.get_unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn get_cached_size(&self) -> u32 {
        self.cached_size.get()
    }

    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
        &self.unknown_fields
    }

    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
        &mut self.unknown_fields
    }

    fn as_any(&self) -> &dyn (::std::any::Any) {
        self as &dyn (::std::any::Any)
    }
    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
        self as &mut dyn (::std::any::Any)
    }
    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
        self
    }

    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
        Self::descriptor_static()
    }

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

    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
        descriptor.get(|| {
            let mut fields = ::std::vec::Vec::new();
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<ConstantSampler_ConstantDecision>>(
                "decision",
                |m: &ConstantSampler| { &m.decision },
                |m: &mut ConstantSampler| { &mut m.decision },
            ));
            ::protobuf::reflect::MessageDescriptor::new_pb_name::<ConstantSampler>(
                "ConstantSampler",
                fields,
                file_descriptor_proto()
            )
        })
    }

    fn default_instance() -> &'static ConstantSampler {
        static instance: ::protobuf::rt::LazyV2<ConstantSampler> = ::protobuf::rt::LazyV2::INIT;
        instance.get(ConstantSampler::new)
    }
}

impl ::protobuf::Clear for ConstantSampler {
    fn clear(&mut self) {
        self.decision = ConstantSampler_ConstantDecision::ALWAYS_OFF;
        self.unknown_fields.clear();
    }
}

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

impl ::protobuf::reflect::ProtobufValue for ConstantSampler {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Message(self)
    }
}

#[derive(Clone,PartialEq,Eq,Debug,Hash)]
#[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
pub enum ConstantSampler_ConstantDecision {
    ALWAYS_OFF = 0,
    ALWAYS_ON = 1,
    ALWAYS_PARENT = 2,
}

impl ::protobuf::ProtobufEnum for ConstantSampler_ConstantDecision {
    fn value(&self) -> i32 {
        *self as i32
    }

    fn from_i32(value: i32) -> ::std::option::Option<ConstantSampler_ConstantDecision> {
        match value {
            0 => ::std::option::Option::Some(ConstantSampler_ConstantDecision::ALWAYS_OFF),
            1 => ::std::option::Option::Some(ConstantSampler_ConstantDecision::ALWAYS_ON),
            2 => ::std::option::Option::Some(ConstantSampler_ConstantDecision::ALWAYS_PARENT),
            _ => ::std::option::Option::None
        }
    }

    fn values() -> &'static [Self] {
        static values: &'static [ConstantSampler_ConstantDecision] = &[
            ConstantSampler_ConstantDecision::ALWAYS_OFF,
            ConstantSampler_ConstantDecision::ALWAYS_ON,
            ConstantSampler_ConstantDecision::ALWAYS_PARENT,
        ];
        values
    }

    fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT;
        descriptor.get(|| {
            ::protobuf::reflect::EnumDescriptor::new_pb_name::<ConstantSampler_ConstantDecision>("ConstantSampler.ConstantDecision", file_descriptor_proto())
        })
    }
}

impl ::std::marker::Copy for ConstantSampler_ConstantDecision {
}

impl ::std::default::Default for ConstantSampler_ConstantDecision {
    fn default() -> Self {
        ConstantSampler_ConstantDecision::ALWAYS_OFF
    }
}

impl ::protobuf::reflect::ProtobufValue for ConstantSampler_ConstantDecision {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
    }
}

#[derive(PartialEq,Clone,Default)]
#[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
pub struct TraceIdRatioBased {
    // message fields
    pub samplingRatio: f64,
    // special fields
    #[cfg_attr(feature = "with-serde", serde(skip))]
    pub unknown_fields: ::protobuf::UnknownFields,
    #[cfg_attr(feature = "with-serde", serde(skip))]
    pub cached_size: ::protobuf::CachedSize,
}

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

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

    // double samplingRatio = 1;


    pub fn get_samplingRatio(&self) -> f64 {
        self.samplingRatio
    }
    pub fn clear_samplingRatio(&mut self) {
        self.samplingRatio = 0.;
    }

    // Param is passed by value, moved
    pub fn set_samplingRatio(&mut self, v: f64) {
        self.samplingRatio = v;
    }
}

impl ::protobuf::Message for TraceIdRatioBased {
    fn is_initialized(&self) -> bool {
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        while !is.eof()? {
            let (field_number, wire_type) = is.read_tag_unpack()?;
            match field_number {
                1 => {
                    if wire_type != ::protobuf::wire_format::WireTypeFixed64 {
                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                    }
                    let tmp = is.read_double()?;
                    self.samplingRatio = tmp;
                },
                _ => {
                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u32 {
        let mut my_size = 0;
        if self.samplingRatio != 0. {
            my_size += 9;
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
        self.cached_size.set(my_size);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        if self.samplingRatio != 0. {
            os.write_double(1, self.samplingRatio)?;
        }
        os.write_unknown_fields(self.get_unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn get_cached_size(&self) -> u32 {
        self.cached_size.get()
    }

    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
        &self.unknown_fields
    }

    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
        &mut self.unknown_fields
    }

    fn as_any(&self) -> &dyn (::std::any::Any) {
        self as &dyn (::std::any::Any)
    }
    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
        self as &mut dyn (::std::any::Any)
    }
    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
        self
    }

    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
        Self::descriptor_static()
    }

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

    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
        descriptor.get(|| {
            let mut fields = ::std::vec::Vec::new();
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeDouble>(
                "samplingRatio",
                |m: &TraceIdRatioBased| { &m.samplingRatio },
                |m: &mut TraceIdRatioBased| { &mut m.samplingRatio },
            ));
            ::protobuf::reflect::MessageDescriptor::new_pb_name::<TraceIdRatioBased>(
                "TraceIdRatioBased",
                fields,
                file_descriptor_proto()
            )
        })
    }

    fn default_instance() -> &'static TraceIdRatioBased {
        static instance: ::protobuf::rt::LazyV2<TraceIdRatioBased> = ::protobuf::rt::LazyV2::INIT;
        instance.get(TraceIdRatioBased::new)
    }
}

impl ::protobuf::Clear for TraceIdRatioBased {
    fn clear(&mut self) {
        self.samplingRatio = 0.;
        self.unknown_fields.clear();
    }
}

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

impl ::protobuf::reflect::ProtobufValue for TraceIdRatioBased {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Message(self)
    }
}

#[derive(PartialEq,Clone,Default)]
#[cfg_attr(feature = "with-serde", derive(::serde::Serialize, ::serde::Deserialize))]
pub struct RateLimitingSampler {
    // message fields
    pub qps: i64,
    // special fields
    #[cfg_attr(feature = "with-serde", serde(skip))]
    pub unknown_fields: ::protobuf::UnknownFields,
    #[cfg_attr(feature = "with-serde", serde(skip))]
    pub cached_size: ::protobuf::CachedSize,
}

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

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

    // int64 qps = 1;


    pub fn get_qps(&self) -> i64 {
        self.qps
    }
    pub fn clear_qps(&mut self) {
        self.qps = 0;
    }

    // Param is passed by value, moved
    pub fn set_qps(&mut self, v: i64) {
        self.qps = v;
    }
}

impl ::protobuf::Message for RateLimitingSampler {
    fn is_initialized(&self) -> bool {
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        while !is.eof()? {
            let (field_number, wire_type) = is.read_tag_unpack()?;
            match field_number {
                1 => {
                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                    }
                    let tmp = is.read_int64()?;
                    self.qps = tmp;
                },
                _ => {
                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u32 {
        let mut my_size = 0;
        if self.qps != 0 {
            my_size += ::protobuf::rt::value_size(1, self.qps, ::protobuf::wire_format::WireTypeVarint);
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
        self.cached_size.set(my_size);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        if self.qps != 0 {
            os.write_int64(1, self.qps)?;
        }
        os.write_unknown_fields(self.get_unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn get_cached_size(&self) -> u32 {
        self.cached_size.get()
    }

    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
        &self.unknown_fields
    }

    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
        &mut self.unknown_fields
    }

    fn as_any(&self) -> &dyn (::std::any::Any) {
        self as &dyn (::std::any::Any)
    }
    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
        self as &mut dyn (::std::any::Any)
    }
    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
        self
    }

    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
        Self::descriptor_static()
    }

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

    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
        descriptor.get(|| {
            let mut fields = ::std::vec::Vec::new();
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
                "qps",
                |m: &RateLimitingSampler| { &m.qps },
                |m: &mut RateLimitingSampler| { &mut m.qps },
            ));
            ::protobuf::reflect::MessageDescriptor::new_pb_name::<RateLimitingSampler>(
                "RateLimitingSampler",
                fields,
                file_descriptor_proto()
            )
        })
    }

    fn default_instance() -> &'static RateLimitingSampler {
        static instance: ::protobuf::rt::LazyV2<RateLimitingSampler> = ::protobuf::rt::LazyV2::INIT;
        instance.get(RateLimitingSampler::new)
    }
}

impl ::protobuf::Clear for RateLimitingSampler {
    fn clear(&mut self) {
        self.qps = 0;
        self.unknown_fields.clear();
    }
}

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

impl ::protobuf::reflect::ProtobufValue for RateLimitingSampler {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Message(self)
    }
}

static file_descriptor_proto_data: &'static [u8] = b"\
    \n/opentelemetry/proto/trace/v1/trace_config.proto\x12\x1copentelemetry.\
    proto.trace.v1\"\x84\x05\n\x0bTraceConfig\x12Z\n\x10constant_sampler\x18\
    \x01\x20\x01(\x0b2-.opentelemetry.proto.trace.v1.ConstantSamplerH\0R\x0f\
    constantSampler\x12b\n\x14trace_id_ratio_based\x18\x02\x20\x01(\x0b2/.op\
    entelemetry.proto.trace.v1.TraceIdRatioBasedH\0R\x11traceIdRatioBased\
    \x12g\n\x15rate_limiting_sampler\x18\x03\x20\x01(\x0b21.opentelemetry.pr\
    oto.trace.v1.RateLimitingSamplerH\0R\x13rateLimitingSampler\x127\n\x18ma\
    x_number_of_attributes\x18\x04\x20\x01(\x03R\x15maxNumberOfAttributes\
    \x12:\n\x1amax_number_of_timed_events\x18\x05\x20\x01(\x03R\x16maxNumber\
    OfTimedEvents\x12T\n(max_number_of_attributes_per_timed_event\x18\x06\
    \x20\x01(\x03R\"maxNumberOfAttributesPerTimedEvent\x12-\n\x13max_number_\
    of_links\x18\x07\x20\x01(\x03R\x10maxNumberOfLinks\x12G\n!max_number_of_\
    attributes_per_link\x18\x08\x20\x01(\x03R\x1cmaxNumberOfAttributesPerLin\
    kB\t\n\x07sampler\"\xb3\x01\n\x0fConstantSampler\x12Z\n\x08decision\x18\
    \x01\x20\x01(\x0e2>.opentelemetry.proto.trace.v1.ConstantSampler.Constan\
    tDecisionR\x08decision\"D\n\x10ConstantDecision\x12\x0e\n\nALWAYS_OFF\
    \x10\0\x12\r\n\tALWAYS_ON\x10\x01\x12\x11\n\rALWAYS_PARENT\x10\x02\"9\n\
    \x11TraceIdRatioBased\x12$\n\rsamplingRatio\x18\x01\x20\x01(\x01R\rsampl\
    ingRatio\"'\n\x13RateLimitingSampler\x12\x10\n\x03qps\x18\x01\x20\x01(\
    \x03R\x03qpsB~\n\x1fio.opentelemetry.proto.trace.v1B\x10TraceConfigProto\
    P\x01ZGgithub.com/open-telemetry/opentelemetry-proto/gen/go/collector/tr\
    ace/v1b\x06proto3\
";

static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
    ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
}

pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
    file_descriptor_proto_lazy.get(|| {
        parse_descriptor_proto()
    })
}
