// This file is generated by rust-protobuf 2.25.2. 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 `cosmos/authz/v1beta1/query.proto`

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

#[derive(PartialEq,Clone,Default)]
pub struct QueryGrantsRequest {
    // message fields
    pub granter: ::std::string::String,
    pub grantee: ::std::string::String,
    pub msg_type_url: ::std::string::String,
    pub pagination: ::protobuf::SingularPtrField<super::pagination::PageRequest>,
    // special fields
    pub unknown_fields: ::protobuf::UnknownFields,
    pub cached_size: ::protobuf::CachedSize,
}

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

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

    // string granter = 1;


    pub fn get_granter(&self) -> &str {
        &self.granter
    }
    pub fn clear_granter(&mut self) {
        self.granter.clear();
    }

    // Param is passed by value, moved
    pub fn set_granter(&mut self, v: ::std::string::String) {
        self.granter = v;
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_granter(&mut self) -> &mut ::std::string::String {
        &mut self.granter
    }

    // Take field
    pub fn take_granter(&mut self) -> ::std::string::String {
        ::std::mem::replace(&mut self.granter, ::std::string::String::new())
    }

    // string grantee = 2;


    pub fn get_grantee(&self) -> &str {
        &self.grantee
    }
    pub fn clear_grantee(&mut self) {
        self.grantee.clear();
    }

    // Param is passed by value, moved
    pub fn set_grantee(&mut self, v: ::std::string::String) {
        self.grantee = v;
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_grantee(&mut self) -> &mut ::std::string::String {
        &mut self.grantee
    }

    // Take field
    pub fn take_grantee(&mut self) -> ::std::string::String {
        ::std::mem::replace(&mut self.grantee, ::std::string::String::new())
    }

    // string msg_type_url = 3;


    pub fn get_msg_type_url(&self) -> &str {
        &self.msg_type_url
    }
    pub fn clear_msg_type_url(&mut self) {
        self.msg_type_url.clear();
    }

    // Param is passed by value, moved
    pub fn set_msg_type_url(&mut self, v: ::std::string::String) {
        self.msg_type_url = v;
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_msg_type_url(&mut self) -> &mut ::std::string::String {
        &mut self.msg_type_url
    }

    // Take field
    pub fn take_msg_type_url(&mut self) -> ::std::string::String {
        ::std::mem::replace(&mut self.msg_type_url, ::std::string::String::new())
    }

    // .cosmos.base.query.v1beta1.PageRequest pagination = 4;


    pub fn get_pagination(&self) -> &super::pagination::PageRequest {
        self.pagination.as_ref().unwrap_or_else(|| <super::pagination::PageRequest as ::protobuf::Message>::default_instance())
    }
    pub fn clear_pagination(&mut self) {
        self.pagination.clear();
    }

    pub fn has_pagination(&self) -> bool {
        self.pagination.is_some()
    }

    // Param is passed by value, moved
    pub fn set_pagination(&mut self, v: super::pagination::PageRequest) {
        self.pagination = ::protobuf::SingularPtrField::some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_pagination(&mut self) -> &mut super::pagination::PageRequest {
        if self.pagination.is_none() {
            self.pagination.set_default();
        }
        self.pagination.as_mut().unwrap()
    }

    // Take field
    pub fn take_pagination(&mut self) -> super::pagination::PageRequest {
        self.pagination.take().unwrap_or_else(|| super::pagination::PageRequest::new())
    }
}

impl ::protobuf::Message for QueryGrantsRequest {
    fn is_initialized(&self) -> bool {
        for v in &self.pagination {
            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 => {
                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.granter)?;
                },
                2 => {
                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.grantee)?;
                },
                3 => {
                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.msg_type_url)?;
                },
                4 => {
                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.pagination)?;
                },
                _ => {
                    ::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.granter.is_empty() {
            my_size += ::protobuf::rt::string_size(1, &self.granter);
        }
        if !self.grantee.is_empty() {
            my_size += ::protobuf::rt::string_size(2, &self.grantee);
        }
        if !self.msg_type_url.is_empty() {
            my_size += ::protobuf::rt::string_size(3, &self.msg_type_url);
        }
        if let Some(ref v) = self.pagination.as_ref() {
            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.granter.is_empty() {
            os.write_string(1, &self.granter)?;
        }
        if !self.grantee.is_empty() {
            os.write_string(2, &self.grantee)?;
        }
        if !self.msg_type_url.is_empty() {
            os.write_string(3, &self.msg_type_url)?;
        }
        if let Some(ref v) = self.pagination.as_ref() {
            os.write_tag(4, ::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() -> QueryGrantsRequest {
        QueryGrantsRequest::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::ProtobufTypeString>(
                "granter",
                |m: &QueryGrantsRequest| { &m.granter },
                |m: &mut QueryGrantsRequest| { &mut m.granter },
            ));
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                "grantee",
                |m: &QueryGrantsRequest| { &m.grantee },
                |m: &mut QueryGrantsRequest| { &mut m.grantee },
            ));
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                "msg_type_url",
                |m: &QueryGrantsRequest| { &m.msg_type_url },
                |m: &mut QueryGrantsRequest| { &mut m.msg_type_url },
            ));
            fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::pagination::PageRequest>>(
                "pagination",
                |m: &QueryGrantsRequest| { &m.pagination },
                |m: &mut QueryGrantsRequest| { &mut m.pagination },
            ));
            ::protobuf::reflect::MessageDescriptor::new_pb_name::<QueryGrantsRequest>(
                "QueryGrantsRequest",
                fields,
                file_descriptor_proto()
            )
        })
    }

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

impl ::protobuf::Clear for QueryGrantsRequest {
    fn clear(&mut self) {
        self.granter.clear();
        self.grantee.clear();
        self.msg_type_url.clear();
        self.pagination.clear();
        self.unknown_fields.clear();
    }
}

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

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

#[derive(PartialEq,Clone,Default)]
pub struct QueryGrantsResponse {
    // message fields
    pub grants: ::protobuf::RepeatedField<super::authz::Grant>,
    pub pagination: ::protobuf::SingularPtrField<super::pagination::PageResponse>,
    // special fields
    pub unknown_fields: ::protobuf::UnknownFields,
    pub cached_size: ::protobuf::CachedSize,
}

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

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

    // repeated .cosmos.authz.v1beta1.Grant grants = 1;


    pub fn get_grants(&self) -> &[super::authz::Grant] {
        &self.grants
    }
    pub fn clear_grants(&mut self) {
        self.grants.clear();
    }

    // Param is passed by value, moved
    pub fn set_grants(&mut self, v: ::protobuf::RepeatedField<super::authz::Grant>) {
        self.grants = v;
    }

    // Mutable pointer to the field.
    pub fn mut_grants(&mut self) -> &mut ::protobuf::RepeatedField<super::authz::Grant> {
        &mut self.grants
    }

    // Take field
    pub fn take_grants(&mut self) -> ::protobuf::RepeatedField<super::authz::Grant> {
        ::std::mem::replace(&mut self.grants, ::protobuf::RepeatedField::new())
    }

    // .cosmos.base.query.v1beta1.PageResponse pagination = 2;


    pub fn get_pagination(&self) -> &super::pagination::PageResponse {
        self.pagination.as_ref().unwrap_or_else(|| <super::pagination::PageResponse as ::protobuf::Message>::default_instance())
    }
    pub fn clear_pagination(&mut self) {
        self.pagination.clear();
    }

    pub fn has_pagination(&self) -> bool {
        self.pagination.is_some()
    }

    // Param is passed by value, moved
    pub fn set_pagination(&mut self, v: super::pagination::PageResponse) {
        self.pagination = ::protobuf::SingularPtrField::some(v);
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_pagination(&mut self) -> &mut super::pagination::PageResponse {
        if self.pagination.is_none() {
            self.pagination.set_default();
        }
        self.pagination.as_mut().unwrap()
    }

    // Take field
    pub fn take_pagination(&mut self) -> super::pagination::PageResponse {
        self.pagination.take().unwrap_or_else(|| super::pagination::PageResponse::new())
    }
}

impl ::protobuf::Message for QueryGrantsResponse {
    fn is_initialized(&self) -> bool {
        for v in &self.grants {
            if !v.is_initialized() {
                return false;
            }
        };
        for v in &self.pagination {
            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 => {
                    ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.grants)?;
                },
                2 => {
                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.pagination)?;
                },
                _ => {
                    ::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;
        for value in &self.grants {
            let len = value.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
        };
        if let Some(ref v) = self.pagination.as_ref() {
            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<()> {
        for v in &self.grants {
            os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
            os.write_raw_varint32(v.get_cached_size())?;
            v.write_to_with_cached_sizes(os)?;
        };
        if let Some(ref v) = self.pagination.as_ref() {
            os.write_tag(2, ::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() -> QueryGrantsResponse {
        QueryGrantsResponse::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_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::authz::Grant>>(
                "grants",
                |m: &QueryGrantsResponse| { &m.grants },
                |m: &mut QueryGrantsResponse| { &mut m.grants },
            ));
            fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::pagination::PageResponse>>(
                "pagination",
                |m: &QueryGrantsResponse| { &m.pagination },
                |m: &mut QueryGrantsResponse| { &mut m.pagination },
            ));
            ::protobuf::reflect::MessageDescriptor::new_pb_name::<QueryGrantsResponse>(
                "QueryGrantsResponse",
                fields,
                file_descriptor_proto()
            )
        })
    }

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

impl ::protobuf::Clear for QueryGrantsResponse {
    fn clear(&mut self) {
        self.grants.clear();
        self.pagination.clear();
        self.unknown_fields.clear();
    }
}

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

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

static file_descriptor_proto_data: &'static [u8] = b"\
    \n\x20cosmos/authz/v1beta1/query.proto\x12\x14cosmos.authz.v1beta1\x1a\
    \x1cgoogle/api/annotations.proto\x1a*cosmos/base/query/v1beta1/paginatio\
    n.proto\x1a\x20cosmos/authz/v1beta1/authz.proto\"\xb2\x01\n\x12QueryGran\
    tsRequest\x12\x18\n\x07granter\x18\x01\x20\x01(\tR\x07granter\x12\x18\n\
    \x07grantee\x18\x02\x20\x01(\tR\x07grantee\x12\x20\n\x0cmsg_type_url\x18\
    \x03\x20\x01(\tR\nmsgTypeUrl\x12F\n\npagination\x18\x04\x20\x01(\x0b2&.c\
    osmos.base.query.v1beta1.PageRequestR\npagination\"\x93\x01\n\x13QueryGr\
    antsResponse\x123\n\x06grants\x18\x01\x20\x03(\x0b2\x1b.cosmos.authz.v1b\
    eta1.GrantR\x06grants\x12G\n\npagination\x18\x02\x20\x01(\x0b2'.cosmos.b\
    ase.query.v1beta1.PageResponseR\npagination2\x8d\x01\n\x05Query\x12\x83\
    \x01\n\x06Grants\x12(.cosmos.authz.v1beta1.QueryGrantsRequest\x1a).cosmo\
    s.authz.v1beta1.QueryGrantsResponse\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/c\
    osmos/authz/v1beta1/grantsB&Z$github.com/cosmos/cosmos-sdk/x/authzb\x06p\
    roto3\
";

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()
    })
}
