Item.createSync

secret.item.Item createSync(secret.collection.Collection collection, secret.schema.Schema schema, string[string] attributes, string label, secret.value.Value value, secret.types.ItemCreateFlags flags, gio.cancellable.Cancellable cancellable = null)

Create a new item in the secret service.

If the flags contains [secret.types.ItemCreateFlags.Replace], then the secret service will search for an item matching the attributes, and update that item instead of creating a new one.

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

Parameters

collectiona secret collection to create this item in
schemathe schema for the attributes
attributesattributes for the new item
labellabel for the new item
valuesecret value for the new item
flagsflags for the creation of the new item
cancellableoptional cancellation object

Returns

the new item, which should be unreferenced

with [gobject.object.ObjectWrap.unref]

Throws

[ErrorWrap]