[][src]Struct nextcloud_passwords_client::password::PasswordApi

pub struct PasswordApi<'a> { /* fields omitted */ }

Actions on the PasswordApi API

Implementations

impl<'a> PasswordApi<'a>[src]

pub async fn list<'_>(
    &'_ self,
    details: Option<Details>
) -> Result<Vec<Password>, Error>
[src]

The list action lists all passwords of the user except those in trash and the hidden ones.

The return value is a list of password objects with the given detail level

Notes

  • The list will not include trashed passwords
  • The list will not include hidden passwords
  • The list will not include suspended passwords where the folder or a parent folder is in the trash

pub async fn get<'_>(
    &'_ self,
    details: Option<Details>,
    id: Uuid
) -> Result<Password, Error>
[src]

The show action lists the properties of a single password.

The return value is a password object with the given detail level

Notes

  • This is the only action that can access hidden passwords

pub async fn find<'_>(
    &'_ self,
    criteria: PasswordSearch,
    details: Option<Details>
) -> Result<Vec<Password>, Error>
[src]

The find action can be used to find all passwords matching the given search criteria.

The return value is a list of password objects that match the criteria with the given detail level

Notes

  • The property trashed will be set to false if not present
  • The list will not include hidden passwords
  • The list will not include suspended passwords where the folder or a parent folder is in the trash

pub async fn create<'_>(
    &'_ self,
    value: CreatePassword
) -> Result<PasswordIdentifier, Error>
[src]

The create action creates a new password with the given attributes.

Notes

  • If the password is not hidden and should be created in a hidden folder, it will be created in the base folder instead
  • If the folder uuid is invalid or does not exist, the base folder uuid will be used instead
  • If the edited argument is "0" or missing, the current time will be used
  • If the edited time is in the future, the current time will be used
  • If the cseType is set to "none", the hash will be calculated on the server
  • If the tags argument contains invalid tag ids, they will be ignored
  • You can assign hidden tags to a not hidden password, but they will not be visible.
  • Therefore another client might remove the tag by accident

pub async fn update<'_>(
    &'_ self,
    folder: UpdatePassword
) -> Result<PasswordIdentifier, Error>
[src]

The update action creates a new revision of a password with an updated set of attributes.

Notes

  • If the password is not editable any change to the encrypted properties, the cseType and the hash will be ignored.
  • If the password is shared you can only use cse types which support sharing
  • If the password is shared you can not hide the password
  • If the password is not hidden and should be moved to a hidden folder, it will be moved to the base folder instead
  • If the password has tags and you want to remove all tags, you need to submit an array with one invalid tag id
  • If the folder uuid is invalid or does not exist, the base folder uuid will be used instead
  • If the edited argument is "0" or missing, the timestamp from the last revision will be used
  • If the edited time is in the future, the current time will be used
  • If the hash has not changed, the edited field from the last revision will be used
  • If the cseType is set to "none", the hash will be calculated on the server
  • If the tags argument is empty or missing, no changes will be made
  • If the tags argument contains invalid tag ids, they will be ignored
  • You can assign hidden tags to a not hidden password, but they will not be visible.
  • Therefore another client might remove the tag by accident

pub async fn delete<'_>(
    &'_ self,
    id: Uuid,
    revision: Option<Uuid>
) -> Result<TrashedIdentifier, Error>
[src]

The delete action moves a password to the trash or deletes it completely if it is already in the trash.

Notes

  • If a password is moved to the trash, the relations to tags will be hidden from the tag, but not the password.
  • If the revision is set, the password will only be deleted if that revision is the current revision. Otherwise an "Outdated revision id" error is returned. This way, a password is not accidentally deleted instead of trashed if the client is out of sync.

pub async fn restore<'_>(
    &'_ self,
    id: Uuid,
    revision: Option<Uuid>
) -> Result<PasswordIdentifier, Error>
[src]

The restore action can restore an earlier state of a password.

Notes

  • If no revision is given and the password is in trash, it will be removed from trash
  • If no revision is given and the password is not in trash, nothing is done
  • If a revision is given and the revision is marked as in trash, it will be removed from trash
  • If a revision is given that does not belong to the model, a "Invalid revision id" error will be returned.
  • The action will fail if the password is shared but the revision to restore does not meet the requirements for sharing
  • This action will always create a new revision
  • The server side encryption type may change
  • If the folder does not exist anymore, it will be moved to the base folder
  • Tag relations can not be restored
  • Deleted passwords can not be restored

Auto Trait Implementations

impl<'a> !RefUnwindSafe for PasswordApi<'a>

impl<'a> Send for PasswordApi<'a>

impl<'a> Sync for PasswordApi<'a>

impl<'a> Unpin for PasswordApi<'a>

impl<'a> !UnwindSafe for PasswordApi<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.