// @generated DO NOT EDIT.
//
// Generated from the CNB OpenAPI specification by `cnb-codegen`.
// Run `cargo run -p cnb-codegen --manifest-path codegen/Cargo.toml \
//      -- --spec codegen/spec/swagger.json --out src` to refresh.

#![allow(clippy::all)]
#![allow(missing_docs)]
#![allow(unused_imports)]
#![allow(unused_mut)]

use reqwest::Method;
use serde::Serialize;

use crate::error::{ApiError, Result};
use crate::http::HttpInner;
use crate::models;

// `Members` resource client (generated, 20 operations).

/// Resource client.
#[derive(Debug, Clone)]
pub struct MembersClient {
    inner: HttpInner,
}

impl MembersClient {
    /// Construct a new resource client. Normally obtained
    /// via [`crate::ApiClient`] rather than directly.
    pub fn new(inner: HttpInner) -> Self {
        Self { inner }
    }

    /// 添加成员。Add members.
    ///
    /// `POST /{group}/-/members/{username}`
    pub async fn add_members_of_group(
        &self,
        group: String,
        username: String,
        body: &crate::models::UpdateMembersRequest,
    ) -> Result<serde_json::Value> {
        let path = format!("/{}/-/members/{}", group, username);
        let mut url = self.inner.url(&path)?;
        self.inner
            .execute_with_body::<serde_json::Value, _>(Method::POST, url, body)
            .await
    }

    /// 添加成员。Add members.
    ///
    /// `POST /{mission}/-/members/{username}`
    pub async fn add_members_of_mission(
        &self,
        mission: String,
        username: String,
        body: &crate::models::UpdateMembersRequest,
    ) -> Result<serde_json::Value> {
        let path = format!("/{}/-/members/{}", mission, username);
        let mut url = self.inner.url(&path)?;
        self.inner
            .execute_with_body::<serde_json::Value, _>(Method::POST, url, body)
            .await
    }

    /// 添加成员。Add members.
    ///
    /// `POST /{registry}/-/members/{username}`
    pub async fn add_members_of_registry(
        &self,
        registry: String,
        username: String,
        body: &crate::models::UpdateMembersRequest,
    ) -> Result<serde_json::Value> {
        let path = format!("/{}/-/members/{}", registry, username);
        let mut url = self.inner.url(&path)?;
        self.inner
            .execute_with_body::<serde_json::Value, _>(Method::POST, url, body)
            .await
    }

    /// 添加成员。Add members.
    ///
    /// `POST /{repo}/-/members/{username}`
    pub async fn add_members_of_repo(
        &self,
        repo: String,
        username: String,
        body: &crate::models::UpdateMembersRequest,
    ) -> Result<serde_json::Value> {
        let path = format!("/{}/-/members/{}", repo, username);
        let mut url = self.inner.url(&path)?;
        self.inner
            .execute_with_body::<serde_json::Value, _>(Method::POST, url, body)
            .await
    }

    /// 删除指定组织的直接成员。Remove direct members from specified organization.
    ///
    /// `DELETE /{group}/-/members/{username}`
    pub async fn delete_members_of_group(
        &self,
        group: String,
        username: String,
    ) -> Result<serde_json::Value> {
        let path = format!("/{}/-/members/{}", group, username);
        let mut url = self.inner.url(&path)?;
        self.inner
            .execute::<serde_json::Value>(Method::DELETE, url)
            .await
    }

    /// 删除指定仓库的直接成员。Remove direct members from specified repository.
    ///
    /// `DELETE /{repo}/-/members/{username}`
    pub async fn delete_members_of_repo(
        &self,
        repo: String,
        username: String,
    ) -> Result<serde_json::Value> {
        let path = format!("/{}/-/members/{}", repo, username);
        let mut url = self.inner.url(&path)?;
        self.inner
            .execute::<serde_json::Value>(Method::DELETE, url)
            .await
    }

    /// 删除指定仓库的外部贡献者。Removes external contributors from specified repository.
    ///
    /// `DELETE /{slug}/-/outside-collaborators/{username}`
    pub async fn delete_outside_collaborators(
        &self,
        slug: String,
        username: String,
    ) -> Result<serde_json::Value> {
        let path = format!("/{}/-/outside-collaborators/{}", slug, username);
        let mut url = self.inner.url(&path)?;
        self.inner
            .execute::<serde_json::Value>(Method::DELETE, url)
            .await
    }

    /// 获取指定组织内, 访问成员在当前层级内的权限信息。Get permission information for accessing members at current level.
    ///
    /// `GET /{group}/-/members/access-level`
    pub async fn get_member_access_level_of_group(
        &self,
        group: String,
        query: &GetMemberAccessLevelOfGroupQuery,
    ) -> Result<crate::models::MemberAccessLevelInSlugUnion> {
        let path = format!("/{}/-/members/access-level", group);
        let mut url = self.inner.url(&path)?;
        {
            let mut pairs = url.query_pairs_mut();
            if let Some(v) = query.include_inherit {
                pairs.append_pair("include_inherit", &v.to_string());
            }
            drop(pairs);
        }
        self.inner
            .execute::<crate::models::MemberAccessLevelInSlugUnion>(Method::GET, url)
            .await
    }

    /// 获取指定仓库内, 访问成员在当前层级内的权限信息。Get permission information for accessing members at current level.
    ///
    /// `GET /{repo}/-/members/access-level`
    pub async fn get_member_access_level_of_repo(
        &self,
        repo: String,
        query: &GetMemberAccessLevelOfRepoQuery,
    ) -> Result<crate::models::MemberAccessLevelInSlugUnion> {
        let path = format!("/{}/-/members/access-level", repo);
        let mut url = self.inner.url(&path)?;
        {
            let mut pairs = url.query_pairs_mut();
            if let Some(v) = query.include_inherit {
                pairs.append_pair("include_inherit", &v.to_string());
            }
            drop(pairs);
        }
        self.inner
            .execute::<crate::models::MemberAccessLevelInSlugUnion>(Method::GET, url)
            .await
    }

    /// 获取指定仓库内的有效成员列表，包含继承成员。List active members in specified repository including inherited members.
    ///
    /// `GET /{slug}/-/list-members`
    pub async fn list_all_members(
        &self,
        slug: String,
        query: &ListAllMembersQuery,
    ) -> Result<Vec<crate::models::UsersWithAccessLevelInSlug>> {
        let path = format!("/{}/-/list-members", slug);
        let mut url = self.inner.url(&path)?;
        {
            let mut pairs = url.query_pairs_mut();
            if let Some(v) = query.page {
                pairs.append_pair("page", &v.to_string());
            }
            if let Some(v) = query.page_size {
                pairs.append_pair("page_size", &v.to_string());
            }
            if let Some(ref v) = query.role {
                pairs.append_pair("role", v);
            }
            if let Some(ref v) = query.search {
                pairs.append_pair("search", v);
            }
            if let Some(ref v) = query.names {
                pairs.append_pair("names", v);
            }
            if let Some(ref v) = query.order_by {
                pairs.append_pair("order_by", v);
            }
            if let Some(v) = query.desc {
                pairs.append_pair("desc", &v.to_string());
            }
            drop(pairs);
        }
        self.inner
            .execute::<Vec<crate::models::UsersWithAccessLevelInSlug>>(Method::GET, url)
            .await
    }

    /// 获取指定组织的继承成员。List inherited members within specified organization
    ///
    /// `GET /{group}/-/inherit-members`
    pub async fn list_inherit_members_of_group(
        &self,
        group: String,
        query: &ListInheritMembersOfGroupQuery,
    ) -> Result<Vec<crate::models::ListInheritMembers>> {
        let path = format!("/{}/-/inherit-members", group);
        let mut url = self.inner.url(&path)?;
        {
            let mut pairs = url.query_pairs_mut();
            if let Some(ref v) = query.search {
                pairs.append_pair("search", v);
            }
            if let Some(ref v) = query.role {
                pairs.append_pair("role", v);
            }
            if let Some(v) = query.page {
                pairs.append_pair("page", &v.to_string());
            }
            if let Some(v) = query.page_size {
                pairs.append_pair("page_size", &v.to_string());
            }
            drop(pairs);
        }
        self.inner
            .execute::<Vec<crate::models::ListInheritMembers>>(Method::GET, url)
            .await
    }

    /// 获取指定仓库内的继承成员。List inherited members within specified repository。
    ///
    /// `GET /{repo}/-/inherit-members`
    pub async fn list_inherit_members_of_repo(
        &self,
        repo: String,
        query: &ListInheritMembersOfRepoQuery,
    ) -> Result<Vec<crate::models::ListInheritMembers>> {
        let path = format!("/{}/-/inherit-members", repo);
        let mut url = self.inner.url(&path)?;
        {
            let mut pairs = url.query_pairs_mut();
            if let Some(ref v) = query.search {
                pairs.append_pair("search", v);
            }
            if let Some(ref v) = query.role {
                pairs.append_pair("role", v);
            }
            if let Some(v) = query.page {
                pairs.append_pair("page", &v.to_string());
            }
            if let Some(v) = query.page_size {
                pairs.append_pair("page_size", &v.to_string());
            }
            drop(pairs);
        }
        self.inner
            .execute::<Vec<crate::models::ListInheritMembers>>(Method::GET, url)
            .await
    }

    /// 获取指定组织内指定成员的权限信息, 结果按组织层级来展示, 包含上层组织的权限继承信息。Get specified member's permissions with organizational hierarchy.
    ///
    /// `GET /{group}/-/members/{username}/access-level`
    pub async fn list_member_access_level_of_group(
        &self,
        group: String,
        username: String,
    ) -> Result<Vec<crate::models::MemberAccessLevel>> {
        let path = format!("/{}/-/members/{}/access-level", group, username);
        let mut url = self.inner.url(&path)?;
        self.inner
            .execute::<Vec<crate::models::MemberAccessLevel>>(Method::GET, url)
            .await
    }

    /// 获取指定仓库内指定成员的权限信息, 结果按组织层级来展示, 包含上层组织的权限继承信息。Get specified member's permissions with organizational hierarchy.
    ///
    /// `GET /{repo}/-/members/{username}/access-level`
    pub async fn list_member_access_level_of_repo(
        &self,
        repo: String,
        username: String,
    ) -> Result<Vec<crate::models::MemberAccessLevel>> {
        let path = format!("/{}/-/members/{}/access-level", repo, username);
        let mut url = self.inner.url(&path)?;
        self.inner
            .execute::<Vec<crate::models::MemberAccessLevel>>(Method::GET, url)
            .await
    }

    /// 获取指定组织内的所有直接成员。List all direct members within specified organization.
    ///
    /// `GET /{group}/-/members`
    pub async fn list_members_of_group(
        &self,
        group: String,
        query: &ListMembersOfGroupQuery,
    ) -> Result<Vec<crate::models::UsersWithAccessLevelInSlug>> {
        let path = format!("/{}/-/members", group);
        let mut url = self.inner.url(&path)?;
        {
            let mut pairs = url.query_pairs_mut();
            if let Some(v) = query.page {
                pairs.append_pair("page", &v.to_string());
            }
            if let Some(v) = query.page_size {
                pairs.append_pair("page_size", &v.to_string());
            }
            if let Some(ref v) = query.role {
                pairs.append_pair("role", v);
            }
            if let Some(ref v) = query.search {
                pairs.append_pair("search", v);
            }
            drop(pairs);
        }
        self.inner
            .execute::<Vec<crate::models::UsersWithAccessLevelInSlug>>(Method::GET, url)
            .await
    }

    /// 获取指定仓库内的所有直接成员。List all direct members within specified repository.
    ///
    /// `GET /{repo}/-/members`
    pub async fn list_members_of_repo(
        &self,
        repo: String,
        query: &ListMembersOfRepoQuery,
    ) -> Result<Vec<crate::models::UsersWithAccessLevelInSlug>> {
        let path = format!("/{}/-/members", repo);
        let mut url = self.inner.url(&path)?;
        {
            let mut pairs = url.query_pairs_mut();
            if let Some(v) = query.page {
                pairs.append_pair("page", &v.to_string());
            }
            if let Some(v) = query.page_size {
                pairs.append_pair("page_size", &v.to_string());
            }
            if let Some(ref v) = query.role {
                pairs.append_pair("role", v);
            }
            if let Some(ref v) = query.search {
                pairs.append_pair("search", v);
            }
            drop(pairs);
        }
        self.inner
            .execute::<Vec<crate::models::UsersWithAccessLevelInSlug>>(Method::GET, url)
            .await
    }

    /// 获取指定仓库内的外部贡献者。List external contributors in specified repository.
    ///
    /// `GET /{slug}/-/outside-collaborators`
    pub async fn list_outside_collaborators(
        &self,
        slug: String,
        query: &ListOutsideCollaboratorsQuery,
    ) -> Result<Vec<crate::models::OutsideCollaboratorInRepo>> {
        let path = format!("/{}/-/outside-collaborators", slug);
        let mut url = self.inner.url(&path)?;
        {
            let mut pairs = url.query_pairs_mut();
            if let Some(v) = query.page {
                pairs.append_pair("page", &v.to_string());
            }
            if let Some(v) = query.page_size {
                pairs.append_pair("page_size", &v.to_string());
            }
            if let Some(ref v) = query.role {
                pairs.append_pair("role", v);
            }
            if let Some(ref v) = query.search {
                pairs.append_pair("search", v);
            }
            drop(pairs);
        }
        self.inner
            .execute::<Vec<crate::models::OutsideCollaboratorInRepo>>(Method::GET, url)
            .await
    }

    /// 更新指定组织的直接成员权限信息。Update permission information for direct members in specified organization.
    ///
    /// `PUT /{group}/-/members/{username}`
    pub async fn update_members_of_group(
        &self,
        group: String,
        username: String,
        body: &crate::models::UpdateMembersRequest,
    ) -> Result<serde_json::Value> {
        let path = format!("/{}/-/members/{}", group, username);
        let mut url = self.inner.url(&path)?;
        self.inner
            .execute_with_body::<serde_json::Value, _>(Method::PUT, url, body)
            .await
    }

    /// 更新指定仓库内的直接成员权限信息。Update permission information for direct members in specified repository.
    ///
    /// `PUT /{repo}/-/members/{username}`
    pub async fn update_members_of_repo(
        &self,
        repo: String,
        username: String,
        body: &crate::models::UpdateMembersRequest,
    ) -> Result<serde_json::Value> {
        let path = format!("/{}/-/members/{}", repo, username);
        let mut url = self.inner.url(&path)?;
        self.inner
            .execute_with_body::<serde_json::Value, _>(Method::PUT, url, body)
            .await
    }

    /// 更新指定仓库的外部贡献者权限信息。 Update permission information for external contributors in specified repository.
    ///
    /// `PUT /{slug}/-/outside-collaborators/{username}`
    pub async fn update_outside_collaborators(
        &self,
        slug: String,
        username: String,
        query: &UpdateOutsideCollaboratorsQuery,
    ) -> Result<serde_json::Value> {
        let path = format!("/{}/-/outside-collaborators/{}", slug, username);
        let mut url = self.inner.url(&path)?;
        {
            let mut pairs = url.query_pairs_mut();
            if let Some(ref v) = query.role {
                pairs.append_pair("role", v);
            }
            drop(pairs);
        }
        self.inner
            .execute::<serde_json::Value>(Method::PUT, url)
            .await
    }
}

/// Query parameters for the matching method on the resource client.
#[derive(Debug, Clone, Default, Serialize)]
pub struct GetMemberAccessLevelOfGroupQuery {
    /// 是否包含继承的权限。If inherited permissions are included.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub include_inherit: Option<bool>,
}

impl GetMemberAccessLevelOfGroupQuery {
    /// Construct an empty query.
    pub fn new() -> Self {
        Self::default()
    }
    /// Set `include_inherit` query parameter.
    pub fn include_inherit(mut self, v: impl Into<bool>) -> Self {
        self.include_inherit = Some(v.into());
        self
    }
}

/// Query parameters for the matching method on the resource client.
#[derive(Debug, Clone, Default, Serialize)]
pub struct GetMemberAccessLevelOfRepoQuery {
    /// 是否包含继承的权限。If inherited permissions are included.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub include_inherit: Option<bool>,
}

impl GetMemberAccessLevelOfRepoQuery {
    /// Construct an empty query.
    pub fn new() -> Self {
        Self::default()
    }
    /// Set `include_inherit` query parameter.
    pub fn include_inherit(mut self, v: impl Into<bool>) -> Self {
        self.include_inherit = Some(v.into());
        self
    }
}

/// Query parameters for the matching method on the resource client.
#[derive(Debug, Clone, Default, Serialize)]
pub struct ListAllMembersQuery {
    /// Pagination page number
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub page: Option<i64>,
    /// Pagination page size
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub page_size: Option<i64>,
    /// Role
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub role: Option<String>,
    /// 过滤成员。Filter by member
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub search: Option<String>,
    /// 精准匹配用户名,多个用户名用逗号间隔。Exact username matching, multiple usernames separated by commas.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub names: Option<String>,
    /// Order field
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub order_by: Option<String>,
    /// Ordering
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub desc: Option<bool>,
}

impl ListAllMembersQuery {
    /// Construct an empty query.
    pub fn new() -> Self {
        Self::default()
    }
    /// Set `page` query parameter.
    pub fn page(mut self, v: impl Into<i64>) -> Self {
        self.page = Some(v.into());
        self
    }
    /// Set `page_size` query parameter.
    pub fn page_size(mut self, v: impl Into<i64>) -> Self {
        self.page_size = Some(v.into());
        self
    }
    /// Set `role` query parameter.
    pub fn role(mut self, v: impl Into<String>) -> Self {
        self.role = Some(v.into());
        self
    }
    /// Set `search` query parameter.
    pub fn search(mut self, v: impl Into<String>) -> Self {
        self.search = Some(v.into());
        self
    }
    /// Set `names` query parameter.
    pub fn names(mut self, v: impl Into<String>) -> Self {
        self.names = Some(v.into());
        self
    }
    /// Set `order_by` query parameter.
    pub fn order_by(mut self, v: impl Into<String>) -> Self {
        self.order_by = Some(v.into());
        self
    }
    /// Set `desc` query parameter.
    pub fn desc(mut self, v: impl Into<bool>) -> Self {
        self.desc = Some(v.into());
        self
    }
}

/// Query parameters for the matching method on the resource client.
#[derive(Debug, Clone, Default, Serialize)]
pub struct ListInheritMembersOfGroupQuery {
    /// 过滤成员。Filter by member
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub search: Option<String>,
    /// Role
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub role: Option<String>,
    /// Pagination page number
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub page: Option<i64>,
    /// Pagination page size
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub page_size: Option<i64>,
}

impl ListInheritMembersOfGroupQuery {
    /// Construct an empty query.
    pub fn new() -> Self {
        Self::default()
    }
    /// Set `search` query parameter.
    pub fn search(mut self, v: impl Into<String>) -> Self {
        self.search = Some(v.into());
        self
    }
    /// Set `role` query parameter.
    pub fn role(mut self, v: impl Into<String>) -> Self {
        self.role = Some(v.into());
        self
    }
    /// Set `page` query parameter.
    pub fn page(mut self, v: impl Into<i64>) -> Self {
        self.page = Some(v.into());
        self
    }
    /// Set `page_size` query parameter.
    pub fn page_size(mut self, v: impl Into<i64>) -> Self {
        self.page_size = Some(v.into());
        self
    }
}

/// Query parameters for the matching method on the resource client.
#[derive(Debug, Clone, Default, Serialize)]
pub struct ListInheritMembersOfRepoQuery {
    /// 过滤成员。Filter by member
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub search: Option<String>,
    /// Role
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub role: Option<String>,
    /// Pagination page number
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub page: Option<i64>,
    /// Pagination page size
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub page_size: Option<i64>,
}

impl ListInheritMembersOfRepoQuery {
    /// Construct an empty query.
    pub fn new() -> Self {
        Self::default()
    }
    /// Set `search` query parameter.
    pub fn search(mut self, v: impl Into<String>) -> Self {
        self.search = Some(v.into());
        self
    }
    /// Set `role` query parameter.
    pub fn role(mut self, v: impl Into<String>) -> Self {
        self.role = Some(v.into());
        self
    }
    /// Set `page` query parameter.
    pub fn page(mut self, v: impl Into<i64>) -> Self {
        self.page = Some(v.into());
        self
    }
    /// Set `page_size` query parameter.
    pub fn page_size(mut self, v: impl Into<i64>) -> Self {
        self.page_size = Some(v.into());
        self
    }
}

/// Query parameters for the matching method on the resource client.
#[derive(Debug, Clone, Default, Serialize)]
pub struct ListMembersOfGroupQuery {
    /// Pagination page number
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub page: Option<i64>,
    /// Pagination page size
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub page_size: Option<i64>,
    /// Role
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub role: Option<String>,
    /// 过滤成员。Filter by member.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub search: Option<String>,
}

impl ListMembersOfGroupQuery {
    /// Construct an empty query.
    pub fn new() -> Self {
        Self::default()
    }
    /// Set `page` query parameter.
    pub fn page(mut self, v: impl Into<i64>) -> Self {
        self.page = Some(v.into());
        self
    }
    /// Set `page_size` query parameter.
    pub fn page_size(mut self, v: impl Into<i64>) -> Self {
        self.page_size = Some(v.into());
        self
    }
    /// Set `role` query parameter.
    pub fn role(mut self, v: impl Into<String>) -> Self {
        self.role = Some(v.into());
        self
    }
    /// Set `search` query parameter.
    pub fn search(mut self, v: impl Into<String>) -> Self {
        self.search = Some(v.into());
        self
    }
}

/// Query parameters for the matching method on the resource client.
#[derive(Debug, Clone, Default, Serialize)]
pub struct ListMembersOfRepoQuery {
    /// Pagination page number
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub page: Option<i64>,
    /// Pagination page size
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub page_size: Option<i64>,
    /// Role
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub role: Option<String>,
    /// 过滤成员。Filter by member.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub search: Option<String>,
}

impl ListMembersOfRepoQuery {
    /// Construct an empty query.
    pub fn new() -> Self {
        Self::default()
    }
    /// Set `page` query parameter.
    pub fn page(mut self, v: impl Into<i64>) -> Self {
        self.page = Some(v.into());
        self
    }
    /// Set `page_size` query parameter.
    pub fn page_size(mut self, v: impl Into<i64>) -> Self {
        self.page_size = Some(v.into());
        self
    }
    /// Set `role` query parameter.
    pub fn role(mut self, v: impl Into<String>) -> Self {
        self.role = Some(v.into());
        self
    }
    /// Set `search` query parameter.
    pub fn search(mut self, v: impl Into<String>) -> Self {
        self.search = Some(v.into());
        self
    }
}

/// Query parameters for the matching method on the resource client.
#[derive(Debug, Clone, Default, Serialize)]
pub struct ListOutsideCollaboratorsQuery {
    /// Pagination page number
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub page: Option<i64>,
    /// Pagination page size
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub page_size: Option<i64>,
    /// Role
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub role: Option<String>,
    /// 过滤成员。Filter by member.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub search: Option<String>,
}

impl ListOutsideCollaboratorsQuery {
    /// Construct an empty query.
    pub fn new() -> Self {
        Self::default()
    }
    /// Set `page` query parameter.
    pub fn page(mut self, v: impl Into<i64>) -> Self {
        self.page = Some(v.into());
        self
    }
    /// Set `page_size` query parameter.
    pub fn page_size(mut self, v: impl Into<i64>) -> Self {
        self.page_size = Some(v.into());
        self
    }
    /// Set `role` query parameter.
    pub fn role(mut self, v: impl Into<String>) -> Self {
        self.role = Some(v.into());
        self
    }
    /// Set `search` query parameter.
    pub fn search(mut self, v: impl Into<String>) -> Self {
        self.search = Some(v.into());
        self
    }
}

/// Query parameters for the matching method on the resource client.
#[derive(Debug, Clone, Default, Serialize)]
pub struct UpdateOutsideCollaboratorsQuery {
    /// Role
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub role: Option<String>,
}

impl UpdateOutsideCollaboratorsQuery {
    /// Construct an empty query.
    pub fn new() -> Self {
        Self::default()
    }
    /// Set `role` query parameter.
    pub fn role(mut self, v: impl Into<String>) -> Self {
        self.role = Some(v.into());
        self
    }
}
