Secret.Item.create_sync
Description: Reference for Secret.Item.create_sync

### Function

# Secret Itemcreate_sync

#### Declaration [src]

    SecretItem*
    secret_item_create_sync (
      SecretCollection* collection,
      const SecretSchema* schema,
      GHashTable* attributes,
      const gchar* label,
      SecretValue* value,
      SecretItemCreateFlags flags,
      GCancellable* cancellable,
      GError** error
    )

#### Description [src]

Create a new item in the secret service.

If the `flags` contains `SECRET_ITEM_CREATE_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_prompt()` will be used to handle any prompts that are required.

#### Parameters

`collection` | `SecretCollection`
| A secret collection to create this item in.
| The data is owned by the caller of the function.
`schema` | `SecretSchema`
| The schema for the attributes.
| The argument can be `NULL`.
| The data is owned by the caller of the function.
`attributes` | `GHashTable`
| Attributes for the new item.
| The data is owned by the caller of the function.
`label` | `const gchar*`
| Label for the new item.
| The data is owned by the caller of the function.
| The value is a NUL terminated UTF-8 string.
`value` | `SecretValue`
| Secret value for the new item.
| The data is owned by the caller of the function.
`flags` | `SecretItemCreateFlags`
| Flags for the creation of the new item.
`cancellable` | `GCancellable`
| Optional cancellation object.
| The argument can be `NULL`.
| The data is owned by the caller of the function.
`error` | `GError **`
| The return location for a `GError*`, or `NULL`.

#### Return value

Returns: | `SecretItem`
| The new item, which should be unreferenced with `g_object_unref()`
| The caller of the function takes ownership of the data, and is responsible for freeing it.