Struct netsblox_api::Client

source ·
pub struct Client { /* private fields */ }

Implementations§

source§

impl Client

source

pub fn new(cfg: Config) -> Self

source

pub async fn create_user( &self, name: &str, email: &str, password: Option<&str>, group_id: Option<&GroupId>, role: UserRole ) -> Result<(), Error>

source

pub async fn list_users(&self) -> Result<Vec<User>, Error>

source

pub async fn forgot_username(&self, email: &str) -> Result<(), Error>

Send an email containing all usernames associated with the given address to the email address.

source

pub async fn delete_user(&self, username: &str) -> Result<(), Error>

source

pub async fn view_user(&self, username: &str) -> Result<User, Error>

source

pub async fn set_password( &self, username: &str, password: &str ) -> Result<(), Error>

source

pub async fn ban_user(&self, username: &str) -> Result<BannedAccount, Error>

source

pub async fn unban_user(&self, username: &str) -> Result<BannedAccount, Error>

Send a magic link to the given email address. Usable for any user associated with the address.

source

pub async fn create_project( &self, data: &CreateProjectData ) -> Result<ProjectMetadata, Error>

source

pub async fn list_projects( &self, owner: &str ) -> Result<Vec<ProjectMetadata>, Error>

source

pub async fn list_shared_projects( &self, owner: &str ) -> Result<Vec<ProjectMetadata>, Error>

source

pub async fn get_project_metadata( &self, owner: &str, name: &str ) -> Result<ProjectMetadata, Error>

source

pub async fn rename_project( &self, id: &ProjectId, name: &str ) -> Result<(), Error>

source

pub async fn rename_role( &self, id: &ProjectId, role_id: &RoleId, name: &str ) -> Result<(), Error>

source

pub async fn delete_project(&self, id: &ProjectId) -> Result<(), Error>

source

pub async fn delete_role( &self, id: &ProjectId, role_id: &RoleId ) -> Result<(), Error>

source

pub async fn publish_project( &self, id: &ProjectId ) -> Result<PublishState, Error>

source

pub async fn unpublish_project(&self, id: &ProjectId) -> Result<(), Error>

source

pub async fn get_project( &self, id: &ProjectId, latest: &bool ) -> Result<Project, Error>

source

pub async fn get_role( &self, id: &ProjectId, role_id: &RoleId, latest: &bool ) -> Result<RoleData, Error>

source

pub async fn list_collaborators( &self, project_id: &str ) -> Result<Vec<String>, Error>

source

pub async fn remove_collaborator( &self, project_id: &ProjectId, username: &str ) -> Result<(), Error>

source

pub async fn list_collaboration_invites( &self, username: &str ) -> Result<Vec<CollaborationInvite>, Error>

source

pub async fn invite_collaborator( &self, id: &ProjectId, username: &str ) -> Result<(), Error>

source

pub async fn respond_to_collaboration_invite( &self, id: &InvitationId, state: &InvitationState ) -> Result<(), Error>

source

pub async fn list_friends(&self, username: &str) -> Result<Vec<String>, Error>

source

pub async fn list_online_friends( &self, username: &str ) -> Result<Vec<String>, Error>

source

pub async fn list_friend_invites( &self, username: &str ) -> Result<Vec<FriendInvite>, Error>

source

pub async fn send_friend_invite( &self, username: &str, recipient: &str ) -> Result<(), Error>

source

pub async fn respond_to_friend_invite( &self, recipient: &str, sender: &str, state: FriendLinkState ) -> Result<(), Error>

source

pub async fn unfriend(&self, username: &str, friend: &str) -> Result<(), Error>

source

pub async fn block_user( &self, username: &str, other_user: &str ) -> Result<(), Error>

source

pub async fn unblock_user( &self, username: &str, other_user: &str ) -> Result<(), Error>

source

pub async fn get_libraries( &self, username: &str ) -> Result<Vec<LibraryMetadata>, Error>

source

pub async fn get_submitted_libraries( &self ) -> Result<Vec<LibraryMetadata>, Error>

source

pub async fn get_public_libraries(&self) -> Result<Vec<LibraryMetadata>, Error>

source

pub async fn get_library( &self, username: &str, name: &str ) -> Result<String, Error>

source

pub async fn save_library( &self, username: &str, name: &str, blocks: &str, notes: &str ) -> Result<(), Error>

source

pub async fn delete_library( &self, username: &str, library: &str ) -> Result<(), Error>

source

pub async fn publish_library( &self, username: &str, library: &str ) -> Result<(), Error>

source

pub async fn unpublish_library( &self, username: &str, library: &str ) -> Result<(), Error>

source

pub async fn approve_library( &self, username: &str, library: &str, state: &PublishState ) -> Result<(), Error>

source

pub async fn list_groups(&self, username: &str) -> Result<Vec<Group>, Error>

source

pub async fn create_group(&self, owner: &str, name: &str) -> Result<(), Error>

source

pub async fn delete_group(&self, id: &GroupId) -> Result<(), Error>

source

pub async fn list_members(&self, id: &GroupId) -> Result<Vec<User>, Error>

source

pub async fn rename_group(&self, id: &GroupId, name: &str) -> Result<(), Error>

source

pub async fn view_group(&self, id: &GroupId) -> Result<Group, Error>

source

pub async fn list_user_hosts( &self, username: &str ) -> Result<Vec<ServiceHost>, Error>

source

pub async fn list_group_hosts( &self, group_id: &GroupId ) -> Result<Vec<ServiceHost>, Error>

source

pub async fn list_hosts( &self, username: &str ) -> Result<Vec<ServiceHost>, Error>

source

pub async fn set_user_hosts( &self, username: &str, hosts: Vec<ServiceHost> ) -> Result<(), Error>

source

pub async fn set_group_hosts( &self, group_id: &GroupId, hosts: Vec<ServiceHost> ) -> Result<(), Error>

source

pub async fn authorize_host( &self, url: &str, id: &str, visibility: ServiceHostScope ) -> Result<String, Error>

source

pub async fn unauthorize_host(&self, id: &str) -> Result<(), Error>

source

pub async fn list_authorized_hosts( &self ) -> Result<Vec<AuthorizedServiceHost>, Error>

source

pub async fn list_group_settings( &self, group_id: &GroupId ) -> Result<Vec<String>, Error>

source

pub async fn list_user_settings( &self, username: &str ) -> Result<Vec<String>, Error>

source

pub async fn get_all_settings( &self, username: &str, service_id: &str ) -> Result<ServiceSettings, Error>

source

pub async fn get_group_settings( &self, group_id: &GroupId, service_id: &str ) -> Result<String, Error>

source

pub async fn get_user_settings( &self, username: &str, service_id: &str ) -> Result<String, Error>

source

pub async fn set_user_settings( &self, username: &str, service_id: &str, settings: String ) -> Result<String, Error>

source

pub async fn set_group_settings( &self, group_id: &GroupId, service_id: &str, settings: String ) -> Result<String, Error>

source

pub async fn delete_user_settings( &self, username: &str, service_id: &str ) -> Result<String, Error>

source

pub async fn delete_group_settings( &self, group_id: &GroupId, service_id: &str ) -> Result<String, Error>

source

pub async fn list_external_clients(&self) -> Result<Vec<ExternalClient>, Error>

source

pub async fn list_networks(&self) -> Result<Vec<ProjectId>, Error>

source

pub async fn get_room_state(&self, id: &ProjectId) -> Result<RoomState, Error>

source

pub async fn get_client_state( &self, client_id: &ClientId ) -> Result<ClientInfo, Error>

source

pub async fn evict_occupant(&self, client_id: &ClientId) -> Result<(), Error>

source

pub async fn connect(&self, address: &str) -> Result<MessageChannel, Error>

source

pub async fn add_oauth_client( &self, client: &CreateClientData ) -> Result<CreatedClientData, Error>

source

pub async fn remove_oauth_client(&self, id: &ClientId) -> Result<(), Error>

source

pub async fn list_oauth_clients(&self) -> Result<Vec<Client>, Error>

Trait Implementations§

source§

impl Clone for Client

source§

fn clone(&self) -> Client

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

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.

§

impl<T> Instrument for T

§

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

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

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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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