google-cloud-rust-raw 0.16.1

A set of client libraries to interact with various Google Cloud Platform services
Documentation
// This file is generated by rust-protobuf 2.28.0. 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 `google/cloud/osconfig/v1alpha/osconfig_common.proto`

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

#[derive(PartialEq,Clone,Default)]
pub struct FixedOrPercent {
    // message oneof groups
    pub mode: ::std::option::Option<FixedOrPercent_oneof_mode>,
    // special fields
    pub unknown_fields: ::protobuf::UnknownFields,
    pub cached_size: ::protobuf::CachedSize,
}

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

#[derive(Clone,PartialEq,Debug)]
pub enum FixedOrPercent_oneof_mode {
    fixed(i32),
    percent(i32),
}

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

    // int32 fixed = 1;


    pub fn get_fixed(&self) -> i32 {
        match self.mode {
            ::std::option::Option::Some(FixedOrPercent_oneof_mode::fixed(v)) => v,
            _ => 0,
        }
    }
    pub fn clear_fixed(&mut self) {
        self.mode = ::std::option::Option::None;
    }

    pub fn has_fixed(&self) -> bool {
        match self.mode {
            ::std::option::Option::Some(FixedOrPercent_oneof_mode::fixed(..)) => true,
            _ => false,
        }
    }

    // Param is passed by value, moved
    pub fn set_fixed(&mut self, v: i32) {
        self.mode = ::std::option::Option::Some(FixedOrPercent_oneof_mode::fixed(v))
    }

    // int32 percent = 2;


    pub fn get_percent(&self) -> i32 {
        match self.mode {
            ::std::option::Option::Some(FixedOrPercent_oneof_mode::percent(v)) => v,
            _ => 0,
        }
    }
    pub fn clear_percent(&mut self) {
        self.mode = ::std::option::Option::None;
    }

    pub fn has_percent(&self) -> bool {
        match self.mode {
            ::std::option::Option::Some(FixedOrPercent_oneof_mode::percent(..)) => true,
            _ => false,
        }
    }

    // Param is passed by value, moved
    pub fn set_percent(&mut self, v: i32) {
        self.mode = ::std::option::Option::Some(FixedOrPercent_oneof_mode::percent(v))
    }
}

impl ::protobuf::Message for FixedOrPercent {
    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));
                    }
                    self.mode = ::std::option::Option::Some(FixedOrPercent_oneof_mode::fixed(is.read_int32()?));
                },
                2 => {
                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                    }
                    self.mode = ::std::option::Option::Some(FixedOrPercent_oneof_mode::percent(is.read_int32()?));
                },
                _ => {
                    ::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 let ::std::option::Option::Some(ref v) = self.mode {
            match v {
                &FixedOrPercent_oneof_mode::fixed(v) => {
                    my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint);
                },
                &FixedOrPercent_oneof_mode::percent(v) => {
                    my_size += ::protobuf::rt::value_size(2, v, ::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 let ::std::option::Option::Some(ref v) = self.mode {
            match v {
                &FixedOrPercent_oneof_mode::fixed(v) => {
                    os.write_int32(1, v)?;
                },
                &FixedOrPercent_oneof_mode::percent(v) => {
                    os.write_int32(2, v)?;
                },
            };
        }
        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() -> FixedOrPercent {
        FixedOrPercent::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_i32_accessor::<_>(
                "fixed",
                FixedOrPercent::has_fixed,
                FixedOrPercent::get_fixed,
            ));
            fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor::<_>(
                "percent",
                FixedOrPercent::has_percent,
                FixedOrPercent::get_percent,
            ));
            ::protobuf::reflect::MessageDescriptor::new_pb_name::<FixedOrPercent>(
                "FixedOrPercent",
                fields,
                file_descriptor_proto()
            )
        })
    }

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

impl ::protobuf::Clear for FixedOrPercent {
    fn clear(&mut self) {
        self.mode = ::std::option::Option::None;
        self.mode = ::std::option::Option::None;
        self.unknown_fields.clear();
    }
}

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

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

static file_descriptor_proto_data: &'static [u8] = b"\
    \n3google/cloud/osconfig/v1alpha/osconfig_common.proto\x12\x1dgoogle.clo\
    ud.osconfig.v1alpha\"L\n\x0eFixedOrPercent\x12\x16\n\x05fixed\x18\x01\
    \x20\x01(\x05H\0R\x05fixed\x12\x1a\n\x07percent\x18\x02\x20\x01(\x05H\0R\
    \x07percentB\x06\n\x04modeB\xcf\x01\n!com.google.cloud.osconfig.v1alphaB\
    \x06CommonP\x01Z=cloud.google.com/go/osconfig/apiv1alpha/osconfigpb;osco\
    nfigpb\xaa\x02\x1dGoogle.Cloud.OsConfig.V1Alpha\xca\x02\x1dGoogle\\Cloud\
    \\OsConfig\\V1alpha\xea\x02\x20Google::Cloud::OsConfig::V1alphaJ\x8d\t\n\
    \x06\x12\x04\x0e\0'\x01\n\xbc\x04\n\x01\x0c\x12\x03\x0e\0\x122\xb1\x04\
    \x20Copyright\x202021\x20Google\x20LLC\n\n\x20Licensed\x20under\x20the\
    \x20Apache\x20License,\x20Version\x202.0\x20(the\x20\"License\");\n\x20y\
    ou\x20may\x20not\x20use\x20this\x20file\x20except\x20in\x20compliance\
    \x20with\x20the\x20License.\n\x20You\x20may\x20obtain\x20a\x20copy\x20of\
    \x20the\x20License\x20at\n\n\x20\x20\x20\x20\x20http://www.apache.org/li\
    censes/LICENSE-2.0\n\n\x20Unless\x20required\x20by\x20applicable\x20law\
    \x20or\x20agreed\x20to\x20in\x20writing,\x20software\n\x20distributed\
    \x20under\x20the\x20License\x20is\x20distributed\x20on\x20an\x20\"AS\x20\
    IS\"\x20BASIS,\n\x20WITHOUT\x20WARRANTIES\x20OR\x20CONDITIONS\x20OF\x20A\
    NY\x20KIND,\x20either\x20express\x20or\x20implied.\n\x20See\x20the\x20Li\
    cense\x20for\x20the\x20specific\x20language\x20governing\x20permissions\
    \x20and\n\x20limitations\x20under\x20the\x20License.\n\n\x08\n\x01\x02\
    \x12\x03\x10\0&\n\x08\n\x01\x08\x12\x03\x13\0:\n\t\n\x02\x08%\x12\x03\
    \x13\0:\n\x08\n\x01\x08\x12\x03\x14\0T\n\t\n\x02\x08\x0b\x12\x03\x14\0T\
    \n\x08\n\x01\x08\x12\x03\x15\0\"\n\t\n\x02\x08\n\x12\x03\x15\0\"\n\x08\n\
    \x01\x08\x12\x03\x16\0'\n\t\n\x02\x08\x08\x12\x03\x16\0'\n\x08\n\x01\x08\
    \x12\x03\x17\0:\n\t\n\x02\x08\x01\x12\x03\x17\0:\n\x08\n\x01\x08\x12\x03\
    \x18\0:\n\t\n\x02\x08)\x12\x03\x18\0:\n\x08\n\x01\x08\x12\x03\x19\09\n\t\
    \n\x02\x08-\x12\x03\x19\09\nv\n\x02\x04\0\x12\x04\x1d\0'\x01\x1aj\x20Mes\
    sage\x20encapsulating\x20a\x20value\x20that\x20can\x20be\x20either\x20ab\
    solute\x20(\"fixed\")\x20or\n\x20relative\x20(\"percent\")\x20to\x20a\
    \x20value.\n\n\n\n\x03\x04\0\x01\x12\x03\x1d\x08\x16\n\"\n\x04\x04\0\x08\
    \0\x12\x04\x1f\x02&\x03\x1a\x14\x20Type\x20of\x20the\x20value.\n\n\x0c\n\
    \x05\x04\0\x08\0\x01\x12\x03\x1f\x08\x0c\n'\n\x04\x04\0\x02\0\x12\x03!\
    \x04\x14\x1a\x1a\x20Specifies\x20a\x20fixed\x20value.\n\n\x0c\n\x05\x04\
    \0\x02\0\x05\x12\x03!\x04\t\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03!\n\x0f\n\
    \x0c\n\x05\x04\0\x02\0\x03\x12\x03!\x12\x13\nt\n\x04\x04\0\x02\x01\x12\
    \x03%\x04\x16\x1ag\x20Specifies\x20the\x20relative\x20value\x20defined\
    \x20as\x20a\x20percentage,\x20which\x20will\x20be\n\x20multiplied\x20by\
    \x20a\x20reference\x20value.\n\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03%\
    \x04\t\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03%\n\x11\n\x0c\n\x05\x04\0\
    \x02\x01\x03\x12\x03%\x14\x15b\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()
    })
}