pub struct Orgs {
pub name: String,
}
Fields§
§name: String
Implementations§
Source§impl Orgs
impl Orgs
Sourcepub fn create(&self) -> CreateOrgBuilder
pub fn create(&self) -> CreateOrgBuilder
Create a new Organization.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
client
.orgs("org-name")
.create()
.full_name("Organization")
.send(&client)
.await
.unwrap();
This will create a new organization with the name “org-name” and the full name “Organization
Sourcepub fn get(&self) -> GetOrgBuilder
pub fn get(&self) -> GetOrgBuilder
Get an Organization.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
let org = client
.orgs("org-name")
.get()
.send(&client)
.await
.unwrap();
This will get the organization with the name “org-name”.
Sourcepub fn delete(&self) -> DeleteOrgBuilder
pub fn delete(&self) -> DeleteOrgBuilder
Delete an Organization. This will delete the organization with the name “org-name”. This action is irreversible.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
client
.orgs("org-name")
.delete()
.send(&client)
.await
.unwrap();
This will delete the organization with the name “org-name”.
Sourcepub fn edit(&self) -> EditOrgBuilder
pub fn edit(&self) -> EditOrgBuilder
Edit an Organization.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
client
.orgs("org-name")
.edit()
.description("New description")
.send(&client)
.await
.unwrap();
This will edit the organization with the name “org-name” to have the description “New description”.
Sourcepub fn list_repos(&self) -> ListReposBuilder
pub fn list_repos(&self) -> ListReposBuilder
List an Organization’s Repositories.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
let repos = client
.orgs("org-name")
.list_repos()
.page(2)
.limit(10)
.send(&client)
.await
.unwrap();
Sourcepub fn create_repo(&self, name: impl ToString) -> CreateRepoBuilder
pub fn create_repo(&self, name: impl ToString) -> CreateRepoBuilder
Create a new Repository in an Organization.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
client
.orgs("org-name")
.create_repo("repo-name")
.auto_init(true)
.license("mit")
.send(&client)
.await
.unwrap();
Sourcepub fn list_members(&self) -> ListMembersBuilder
pub fn list_members(&self) -> ListMembersBuilder
List the members of an Organization.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
let members = client
.orgs("org-name")
.list_members()
.send(&client)
.await
.unwrap();
Sourcepub fn is_member(&self, username: impl ToString) -> IsMemberBuilder
pub fn is_member(&self, username: impl ToString) -> IsMemberBuilder
Check if a user is a member of an Organization.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
let is_member = client
.orgs("org-name")
.is_member("username")
.send(&client)
.await
.unwrap();
Sourcepub fn remove_member(&self, username: impl ToString) -> RemoveMemberBuilder
pub fn remove_member(&self, username: impl ToString) -> RemoveMemberBuilder
Remove a user from an Organization.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
client
.orgs("org-name")
.remove_member("username")
.send(&client)
.await
.unwrap();
Sourcepub fn list_public_members(&self) -> ListPublicMembersBuilder
pub fn list_public_members(&self) -> ListPublicMembersBuilder
List the public members of an Organization. This will return a list of [User] objects.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
let public_members = client
.orgs("org-name")
.list_public_members()
.send(&client)
.await
.unwrap();
Sourcepub fn is_public_member(&self, username: impl ToString) -> IsPublicMemberBuilder
pub fn is_public_member(&self, username: impl ToString) -> IsPublicMemberBuilder
Check if a user is a public member of an Organization.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
let is_public_member = client
.orgs("org-name")
.is_public_member("username")
.send(&client)
.await
.unwrap();
Sourcepub fn conceal_membership(
&self,
username: impl ToString,
) -> ConcealMembershipBuilder
pub fn conceal_membership( &self, username: impl ToString, ) -> ConcealMembershipBuilder
Conceal a user’s membership in an Organization. This will hide the user from the organization’s public members list.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
client
.orgs("org-name")
.conceal_membership("username")
.send(&client)
.await
.unwrap();
Sourcepub fn publicize_membership(
&self,
username: impl ToString,
) -> PublicizeMembershipBuilder
pub fn publicize_membership( &self, username: impl ToString, ) -> PublicizeMembershipBuilder
Publicize a user’s membership in an Organization. This will make the user visible in the organization’s public members list.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
client
.orgs("org-name")
.publicize_membership("username")
.send(&client)
.await
.unwrap();