// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Group {
    #[prost(string, tag = "1")]
    pub rid: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub org_rid: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub group_id: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub display_name: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub description: ::prost::alloc::string::String,
    #[prost(string, repeated, tag = "6")]
    pub user_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(message, optional, tag = "7")]
    pub created_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(message, optional, tag = "8")]
    pub updated_at: ::core::option::Option<
        super::super::super::super::google::protobuf::Timestamp,
    >,
    #[prost(message, optional, tag = "9")]
    pub symbol: ::core::option::Option<super::super::super::scout::elements::v1::Symbol>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchGroupsQuery {
    #[prost(oneof = "search_groups_query::Query", tags = "1, 2, 3")]
    pub query: ::core::option::Option<search_groups_query::Query>,
}
/// Nested message and enum types in `SearchGroupsQuery`.
pub mod search_groups_query {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Query {
        #[prost(string, tag = "1")]
        ExactSubstringText(::prost::alloc::string::String),
        #[prost(message, tag = "2")]
        And(super::SearchQueryAnd),
        #[prost(message, tag = "3")]
        Or(super::SearchQueryOr),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchQueryAnd {
    #[prost(message, repeated, tag = "1")]
    pub queries: ::prost::alloc::vec::Vec<SearchGroupsQuery>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchQueryOr {
    #[prost(message, repeated, tag = "1")]
    pub queries: ::prost::alloc::vec::Vec<SearchGroupsQuery>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchGroupsRequest {
    #[prost(int32, optional, tag = "1")]
    pub page_size: ::core::option::Option<i32>,
    #[prost(string, optional, tag = "2")]
    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(message, optional, tag = "3")]
    pub query: ::core::option::Option<SearchGroupsQuery>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchGroupsResponse {
    #[prost(message, repeated, tag = "1")]
    pub results: ::prost::alloc::vec::Vec<Group>,
    #[prost(string, optional, tag = "2")]
    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetGroupRequest {
    #[prost(string, tag = "1")]
    pub group_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetGroupResponse {
    #[prost(message, optional, tag = "1")]
    pub group: ::core::option::Option<Group>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetGroupByIdRequest {
    #[prost(string, tag = "1")]
    pub group_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetGroupByIdResponse {
    #[prost(message, optional, tag = "1")]
    pub group: ::core::option::Option<Group>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetGroupsRequest {
    #[prost(string, repeated, tag = "1")]
    pub group_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetGroupsResponse {
    #[prost(map = "string, message", tag = "1")]
    pub groups: ::std::collections::HashMap<::prost::alloc::string::String, Group>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateGroupMetadataRequest {
    #[prost(string, optional, tag = "1")]
    pub display_name: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "2")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(message, optional, tag = "3")]
    pub symbol: ::core::option::Option<
        update_group_metadata_request::UpdateGroupSymbolWrapper,
    >,
}
/// Nested message and enum types in `UpdateGroupMetadataRequest`.
pub mod update_group_metadata_request {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct UpdateGroupSymbolWrapper {
        #[prost(message, optional, tag = "1")]
        pub value: ::core::option::Option<
            super::super::super::super::scout::elements::v1::Symbol,
        >,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateGroupMetadataRequestWrapper {
    #[prost(string, tag = "1")]
    pub group_rid: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub request: ::core::option::Option<UpdateGroupMetadataRequest>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateGroupMetadataResponse {
    #[prost(message, optional, tag = "1")]
    pub group: ::core::option::Option<Group>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateOrUpdateGroupRequest {
    #[prost(message, optional, tag = "1")]
    pub group: ::core::option::Option<Group>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateOrUpdateGroupResponse {
    #[prost(message, optional, tag = "1")]
    pub group: ::core::option::Option<Group>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum GroupErrors {
    Unauthorized = 0,
    NotFound = 1,
    RequestedPageSizeTooLarge = 2,
    IdConflict = 3,
    IdentityMismatch = 4,
    MissingRequiredField = 5,
}
impl GroupErrors {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unauthorized => "GROUP_ERRORS_UNAUTHORIZED",
            Self::NotFound => "GROUP_ERRORS_NOT_FOUND",
            Self::RequestedPageSizeTooLarge => {
                "GROUP_ERRORS_REQUESTED_PAGE_SIZE_TOO_LARGE"
            }
            Self::IdConflict => "GROUP_ERRORS_ID_CONFLICT",
            Self::IdentityMismatch => "GROUP_ERRORS_IDENTITY_MISMATCH",
            Self::MissingRequiredField => "GROUP_ERRORS_MISSING_REQUIRED_FIELD",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "GROUP_ERRORS_UNAUTHORIZED" => Some(Self::Unauthorized),
            "GROUP_ERRORS_NOT_FOUND" => Some(Self::NotFound),
            "GROUP_ERRORS_REQUESTED_PAGE_SIZE_TOO_LARGE" => {
                Some(Self::RequestedPageSizeTooLarge)
            }
            "GROUP_ERRORS_ID_CONFLICT" => Some(Self::IdConflict),
            "GROUP_ERRORS_IDENTITY_MISMATCH" => Some(Self::IdentityMismatch),
            "GROUP_ERRORS_MISSING_REQUIRED_FIELD" => Some(Self::MissingRequiredField),
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod group_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    #[derive(Debug, Clone)]
    pub struct GroupServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl GroupServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> GroupServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> GroupServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            GroupServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        pub async fn get_group(
            &mut self,
            request: impl tonic::IntoRequest<super::GetGroupRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetGroupResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.authentication.groups.v1.GroupService/GetGroup",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.authentication.groups.v1.GroupService",
                        "GetGroup",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn get_groups(
            &mut self,
            request: impl tonic::IntoRequest<super::GetGroupsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetGroupsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.authentication.groups.v1.GroupService/GetGroups",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.authentication.groups.v1.GroupService",
                        "GetGroups",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn get_group_by_id(
            &mut self,
            request: impl tonic::IntoRequest<super::GetGroupByIdRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetGroupByIdResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.authentication.groups.v1.GroupService/GetGroupById",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.authentication.groups.v1.GroupService",
                        "GetGroupById",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn update_group_metadata(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateGroupMetadataRequestWrapper>,
        ) -> std::result::Result<
            tonic::Response<super::UpdateGroupMetadataResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.authentication.groups.v1.GroupService/UpdateGroupMetadata",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.authentication.groups.v1.GroupService",
                        "UpdateGroupMetadata",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn search_groups(
            &mut self,
            request: impl tonic::IntoRequest<super::SearchGroupsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SearchGroupsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.authentication.groups.v1.GroupService/SearchGroups",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.authentication.groups.v1.GroupService",
                        "SearchGroups",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn create_or_update_group(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateOrUpdateGroupRequest>,
        ) -> std::result::Result<
            tonic::Response<super::CreateOrUpdateGroupResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.authentication.groups.v1.GroupService/CreateOrUpdateGroup",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.authentication.groups.v1.GroupService",
                        "CreateOrUpdateGroup",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
