gi-secret-0.0.12: Libsecret bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Secret.Objects.Collection

Description

A proxy object representing a collection of secrets in the Secret Service.

Synopsis

Exported types

newtype Collection Source #

Memory-managed wrapper type.

Constructors

Collection (ManagedPtr Collection) 

Instances

Instances details
Eq Collection Source # 
Instance details

Defined in GI.Secret.Objects.Collection

Methods

(==) :: Collection -> Collection -> Bool

(/=) :: Collection -> Collection -> Bool

GObject Collection Source # 
Instance details

Defined in GI.Secret.Objects.Collection

ManagedPtrNewtype Collection Source # 
Instance details

Defined in GI.Secret.Objects.Collection

Methods

toManagedPtr :: Collection -> ManagedPtr Collection

TypedObject Collection Source # 
Instance details

Defined in GI.Secret.Objects.Collection

Methods

glibType :: IO GType

IsGValue Collection Source #

Convert Collection to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Secret.Objects.Collection

Methods

toGValue :: Collection -> IO GValue

fromGValue :: GValue -> IO Collection

HasParentTypes Collection Source # 
Instance details

Defined in GI.Secret.Objects.Collection

type ParentTypes Collection Source # 
Instance details

Defined in GI.Secret.Objects.Collection

type ParentTypes Collection = '[DBusProxy, Object, AsyncInitable, DBusInterface, Initable]

class (GObject o, IsDescendantOf Collection o) => IsCollection o Source #

Type class for types which can be safely cast to Collection, for instance with toCollection.

Instances

Instances details
(GObject o, IsDescendantOf Collection o) => IsCollection o Source # 
Instance details

Defined in GI.Secret.Objects.Collection

toCollection :: (MonadIO m, IsCollection o) => o -> m Collection Source #

Cast to Collection, for types for which this is known to be safe. For general casts, use castTo.

Methods

Overloaded methods

create

collectionCreate Source #

Arguments

:: (HasCallStack, MonadIO m, IsService a, IsCancellable b) 
=> Maybe a

service: a secret service object

-> Text

label: label for the new collection

-> Maybe Text

alias: alias to assign to the collection

-> [CollectionCreateFlags]

flags: currently unused

-> Maybe b

cancellable: optional cancellation object

-> Maybe AsyncReadyCallback

callback: called when the operation completes

-> m () 

Create a new collection in the secret service.

This method returns immediately and completes asynchronously. The secret service may prompt the user. servicePrompt will be used to handle any prompts that are required.

An alias is a well-known tag for a collection, such as 'default' (ie: the default collection to store items in). This allows other applications to easily identify and share a collection. If you specify an alias, and a collection with that alias already exists, then a new collection will not be created. The previous one will be returned instead.

If service is NULL, then serviceGet will be called to get the default Service proxy.

createFinish

collectionCreateFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsAsyncResult a) 
=> a

result: the asynchronous result passed to the callback

-> m Collection

Returns: the new collection, which should be unreferenced with objectUnref (Can throw GError)

Finish operation to create a new collection in the secret service.

createSync

collectionCreateSync Source #

Arguments

:: (HasCallStack, MonadIO m, IsService a, IsCancellable b) 
=> Maybe a

service: a secret service object

-> Text

label: label for the new collection

-> Maybe Text

alias: alias to assign to the collection

-> [CollectionCreateFlags]

flags: currently unused

-> Maybe b

cancellable: optional cancellation object

-> m Collection

Returns: the new collection, which should be unreferenced with objectUnref (Can throw GError)

Create a new collection in the secret service.

This method may block indefinitely and should not be used in user interface threads. The secret service may prompt the user. servicePrompt will be used to handle any prompts that are required.

An alias is a well-known tag for a collection, such as 'default' (ie: the default collection to store items in). This allows other applications to easily identify and share a collection. If you specify an alias, and a collection with that alias already exists, then a new collection will not be created. The previous one will be returned instead.

If service is NULL, then serviceGetSync will be called to get the default Service proxy.

delete

collectionDelete Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) 
=> a

self: a collection

-> Maybe b

cancellable: optional cancellation object

-> Maybe AsyncReadyCallback

callback: called when the operation completes

-> m () 

Delete this collection.

This method returns immediately and completes asynchronously. The secret service may prompt the user. servicePrompt will be used to handle any prompts that show up.

deleteFinish

collectionDeleteFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) 
=> a

self: a collection

-> b

result: asynchronous result passed to the callback

-> m ()

(Can throw GError)

Complete operation to delete this collection.

deleteSync

collectionDeleteSync Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) 
=> a

self: a collection

-> Maybe b

cancellable: optional cancellation object

-> m ()

(Can throw GError)

Delete this collection.

This method may block indefinitely and should not be used in user interface threads. The secret service may prompt the user. servicePrompt will be used to handle any prompts that show up.

forAlias

collectionForAlias Source #

Arguments

:: (HasCallStack, MonadIO m, IsService a, IsCancellable b) 
=> Maybe a

service: a secret service object

-> Text

alias: the alias to lookup

-> [CollectionFlags]

flags: options for the collection initialization

-> Maybe b

cancellable: optional cancellation object

-> Maybe AsyncReadyCallback

callback: called when the operation completes

-> m () 

Lookup which collection is assigned to this alias. Aliases help determine well known collections, such as 'default'.

If service is NULL, then serviceGet will be called to get the default Service proxy.

This method will return immediately and complete asynchronously.

forAliasFinish

collectionForAliasFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsAsyncResult a) 
=> a

result: asynchronous result passed to callback

-> m Collection

Returns: the collection, or Nothing if none assigned to the alias (Can throw GError)

Finish an asynchronous operation to lookup which collection is assigned to an alias.

forAliasSync

collectionForAliasSync Source #

Arguments

:: (HasCallStack, MonadIO m, IsService a, IsCancellable b) 
=> Maybe a

service: a secret service object

-> Text

alias: the alias to lookup

-> [CollectionFlags]

flags: options for the collection initialization

-> Maybe b

cancellable: optional cancellation object

-> m Collection

Returns: the collection, or Nothing if none assigned to the alias (Can throw GError)

Lookup which collection is assigned to this alias. Aliases help determine well known collections, such as 'default'.

If service is NULL, then serviceGetSync will be called to get the default Service proxy.

This method may block and should not be used in user interface threads.

getCreated

collectionGetCreated Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a) 
=> a

self: a collection

-> m Word64

Returns: the created date and time

Get the created date and time of the collection. The return value is the number of seconds since the unix epoch, January 1st 1970.

getFlags

collectionGetFlags Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a) 
=> a

self: the secret collection proxy

-> m [CollectionFlags]

Returns: the flags for features initialized

Get the flags representing what features of the Collection proxy have been initialized.

Use collectionLoadItems to initialize further features and change the flags.

getItems

collectionGetItems Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a) 
=> a

self: a collection

-> m [Item]

Returns: a list of items, when done, the list should be freed with g_list_free, and each item should be released with objectUnref

Get the list of items in this collection.

getLabel

collectionGetLabel Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a) 
=> a

self: a collection

-> m Text

Returns: the label, which should be freed with free

Get the label of this collection.

getLocked

collectionGetLocked Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a) 
=> a

self: a collection

-> m Bool

Returns: whether the collection is locked or not

Get whether the collection is locked or not.

Use serviceLock or serviceUnlock to lock or unlock the collection.

getModified

collectionGetModified Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a) 
=> a

self: a collection

-> m Word64

Returns: the modified date and time

Get the modified date and time of the collection. The return value is the number of seconds since the unix epoch, January 1st 1970.

getService

collectionGetService Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a) 
=> a

self: a collection

-> m Service

Returns: the Secret Service object

Get the Secret Service object that this collection was created with.

loadItems

collectionLoadItems Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) 
=> a

self: the secret collection

-> Maybe b

cancellable: optional cancellation object

-> Maybe AsyncReadyCallback

callback: called when the operation completes

-> m () 

Ensure that the Collection proxy has loaded all the items present in the Secret Service. This affects the result of collectionGetItems.

For collections returned from serviceGetCollections the items will have already been loaded.

This method will return immediately and complete asynchronously.

loadItemsFinish

collectionLoadItemsFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) 
=> a

self: the secret collection

-> b

result: the asynchronous result passed to the callback

-> m ()

(Can throw GError)

Complete an asynchronous operation to ensure that the Collection proxy has loaded all the items present in the Secret Service.

loadItemsSync

collectionLoadItemsSync Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) 
=> a

self: the secret collection

-> Maybe b

cancellable: optional cancellation object

-> m ()

(Can throw GError)

Ensure that the Collection proxy has loaded all the items present in the Secret Service. This affects the result of collectionGetItems.

For collections returned from serviceGetCollections the items will have already been loaded.

This method may block indefinitely and should not be used in user interface threads.

refresh

collectionRefresh Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a) 
=> a

self: the collection

-> m () 

Refresh the properties on this collection. This fires off a request to refresh, and the properties will be updated later.

Calling this method is not normally necessary, as the secret service will notify the client when properties change.

search

collectionSearch Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) 
=> a

self: a secret collection

-> Maybe Schema

schema: the schema for the attributes

-> Map Text Text

attributes: search for items matching these attributes

-> [SearchFlags]

flags: search option flags

-> Maybe b

cancellable: optional cancellation object

-> Maybe AsyncReadyCallback

callback: called when the operation completes

-> m () 

Search for items matching the attributes in the collection. The attributes should be a table of string keys and string values.

If SearchFlagsAll is set in flags, then all the items matching the search will be returned. Otherwise only the first item will be returned. This is almost always the unlocked item that was most recently stored.

If SearchFlagsUnlock is set in flags, then items will be unlocked if necessary. In either case, locked and unlocked items will match the search and be returned. If the unlock fails, the search does not fail.

If SearchFlagsLoadSecrets is set in flags, then the items will have their secret values loaded and available via itemGetSecret.

This function returns immediately and completes asynchronously.

searchFinish

collectionSearchFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) 
=> a

self: the secret collection

-> b

result: asynchronous result passed to callback

-> m [Item]

Returns: a list of items that matched the search (Can throw GError)

Complete asynchronous operation to search for items in a collection.

searchSync

collectionSearchSync Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) 
=> a

self: a secret collection

-> Maybe Schema

schema: the schema for the attributes

-> Map Text Text

attributes: search for items matching these attributes

-> [SearchFlags]

flags: search option flags

-> Maybe b

cancellable: optional cancellation object

-> m [Item]

Returns: a list of items that matched the search (Can throw GError)

Search for items matching the attributes in the collection. The attributes should be a table of string keys and string values.

If SearchFlagsAll is set in flags, then all the items matching the search will be returned. Otherwise only the first item will be returned. This is almost always the unlocked item that was most recently stored.

If SearchFlagsUnlock is set in flags, then items will be unlocked if necessary. In either case, locked and unlocked items will match the search and be returned. If the unlock fails, the search does not fail.

If SearchFlagsLoadSecrets is set in flags, then the items will have their secret values loaded and available via itemGetSecret.

This function may block indefinitely. Use the asynchronous version in user interface threads.

setLabel

collectionSetLabel Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) 
=> a

self: a collection

-> Text

label: a new label

-> Maybe b

cancellable: optional cancellation object

-> Maybe AsyncReadyCallback

callback: called when the operation completes

-> m () 

Set the label of this collection.

This function returns immediately and completes asynchronously.

setLabelFinish

collectionSetLabelFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a, IsAsyncResult b) 
=> a

self: a collection

-> b

result: asynchronous result passed to callback

-> m ()

(Can throw GError)

Complete asynchronous operation to set the label of this collection.

setLabelSync

collectionSetLabelSync Source #

Arguments

:: (HasCallStack, MonadIO m, IsCollection a, IsCancellable b) 
=> a

self: a collection

-> Text

label: a new label

-> Maybe b

cancellable: optional cancellation object

-> m ()

(Can throw GError)

Set the label of this collection.

This function may block indefinitely. Use the asynchronous version in user interface threads.

Properties

created

The date and time (in seconds since the UNIX epoch) that this collection was created.

constructCollectionCreated :: (IsCollection o, MonadIO m) => Word64 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “created” property. This is rarely needed directly, but it is used by new.

getCollectionCreated :: (MonadIO m, IsCollection o) => o -> m Word64 Source #

Get the value of the “created” property. When overloading is enabled, this is equivalent to

get collection #created

setCollectionCreated :: (MonadIO m, IsCollection o) => o -> Word64 -> m () Source #

Set the value of the “created” property. When overloading is enabled, this is equivalent to

set collection [ #created := value ]

flags

A set of flags describing which parts of the secret collection have been initialized.

constructCollectionFlags :: (IsCollection o, MonadIO m) => [CollectionFlags] -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “flags” property. This is rarely needed directly, but it is used by new.

getCollectionFlags :: (MonadIO m, IsCollection o) => o -> m [CollectionFlags] Source #

Get the value of the “flags” property. When overloading is enabled, this is equivalent to

get collection #flags

label

The human readable label for the collection.

Setting this property will result in the label of the collection being set asynchronously. To properly track the changing of the label use the collectionSetLabel function.

clearCollectionLabel :: (MonadIO m, IsCollection o) => o -> m () Source #

Set the value of the “label” property to Nothing. When overloading is enabled, this is equivalent to

clear #label

constructCollectionLabel :: (IsCollection o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “label” property. This is rarely needed directly, but it is used by new.

getCollectionLabel :: (MonadIO m, IsCollection o) => o -> m (Maybe Text) Source #

Get the value of the “label” property. When overloading is enabled, this is equivalent to

get collection #label

setCollectionLabel :: (MonadIO m, IsCollection o) => o -> Text -> m () Source #

Set the value of the “label” property. When overloading is enabled, this is equivalent to

set collection [ #label := value ]

locked

Whether the collection is locked or not.

To lock or unlock a collection use the serviceLock or serviceUnlock functions.

getCollectionLocked :: (MonadIO m, IsCollection o) => o -> m Bool Source #

Get the value of the “locked” property. When overloading is enabled, this is equivalent to

get collection #locked

modified

The date and time (in seconds since the UNIX epoch) that this collection was last modified.

constructCollectionModified :: (IsCollection o, MonadIO m) => Word64 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “modified” property. This is rarely needed directly, but it is used by new.

getCollectionModified :: (MonadIO m, IsCollection o) => o -> m Word64 Source #

Get the value of the “modified” property. When overloading is enabled, this is equivalent to

get collection #modified

setCollectionModified :: (MonadIO m, IsCollection o) => o -> Word64 -> m () Source #

Set the value of the “modified” property. When overloading is enabled, this is equivalent to

set collection [ #modified := value ]

service

The Service object that this collection is associated with and uses to interact with the actual D-Bus Secret Service.

constructCollectionService :: (IsCollection o, MonadIO m, IsService a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “service” property. This is rarely needed directly, but it is used by new.

getCollectionService :: (MonadIO m, IsCollection o) => o -> m Service Source #

Get the value of the “service” property. When overloading is enabled, this is equivalent to

get collection #service