Struct Orgs

Source
pub struct Orgs {
    pub name: String,
}

Fields§

§name: String

Implementations§

Source§

impl Orgs

Source

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

Source

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”.

Source

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”.

Source

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”.

Source

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();
Source

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();
Source

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();
Source

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();
Source

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();
Source

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();
Source

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();
Source

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();
Source

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

Auto Trait Implementations§

§

impl Freeze for Orgs

§

impl RefUnwindSafe for Orgs

§

impl Send for Orgs

§

impl Sync for Orgs

§

impl Unpin for Orgs

§

impl UnwindSafe for Orgs

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T