## PkResults PkResults — Transaction results |

## Synopsis

    #define             PK_RESULTS_TYPE_ERROR
    struct              PkResults;
    struct              PkResultsClass;
    gboolean            pk_results_add_category             (PkResults *results,
                                                             PkCategory *item);
    gboolean            pk_results_add_details              (PkResults *results,
                                                             PkDetails *item);
    gboolean            pk_results_add_distro_upgrade       (PkResults *results,
                                                             PkDistroUpgrade *item);
    gboolean            pk_results_add_eula_required        (PkResults *results,
                                                             PkEulaRequired *item);
    gboolean            pk_results_add_files                (PkResults *results,
                                                             PkFiles *item);
    gboolean            pk_results_add_media_change_required
                                                            (PkResults *results,
                                                             PkMediaChangeRequired *item);
    gboolean            pk_results_add_message              (PkResults *results,
                                                             PkMessage *item);
    gboolean            pk_results_add_package              (PkResults *results,
                                                             PkPackage *item);
    gboolean            pk_results_add_repo_detail          (PkResults *results,
                                                             PkRepoDetail *item);
    gboolean            pk_results_add_repo_signature_required
                                                            (PkResults *results,
                                                             PkRepoSignatureRequired *item);
    gboolean            pk_results_add_require_restart      (PkResults *results,
                                                             PkRequireRestart *item);
    gboolean            pk_results_add_transaction          (PkResults *results,
                                                             PkTransactionPast *item);
    gboolean            pk_results_add_update_detail        (PkResults *results,
                                                             PkUpdateDetail *item);
    GPtrArray *         pk_results_get_category_array       (PkResults *results);
    GPtrArray *         pk_results_get_details_array        (PkResults *results);
    GPtrArray *         pk_results_get_distro_upgrade_array (PkResults *results);
    PkError *           pk_results_get_error_code           (PkResults *results);
    GPtrArray *         pk_results_get_eula_required_array  (PkResults *results);
    PkExitEnum          pk_results_get_exit_code            (PkResults *results);
    GPtrArray *         pk_results_get_files_array          (PkResults *results);
    GPtrArray *         pk_results_get_media_change_required_array
                                                            (PkResults *results);
    GPtrArray *         pk_results_get_message_array        (PkResults *results);
    GPtrArray *         pk_results_get_package_array        (PkResults *results);
    PkPackageSack *     pk_results_get_package_sack         (PkResults *results);
    GPtrArray *         pk_results_get_repo_detail_array    (PkResults *results);
    GPtrArray *         pk_results_get_repo_signature_required_array
                                                            (PkResults *results);
    GPtrArray *         pk_results_get_require_restart_array
                                                            (PkResults *results);
    PkRestartEnum       pk_results_get_require_restart_worst
                                                            (PkResults *results);
    PkRoleEnum          pk_results_get_role                 (PkResults *results);
    GPtrArray *         pk_results_get_transaction_array    (PkResults *results);
    GPtrArray *         pk_results_get_update_detail_array  (PkResults *results);
    PkResults *         pk_results_new                      (void);
    gboolean            pk_results_set_error_code           (PkResults *results,
                                                             PkError *item);
    gboolean            pk_results_set_exit_code            (PkResults *results,
                                                             PkExitEnum exit_enum);
    void                pk_results_test                     (gpointer user_data);

## Object Hierarchy

      GObject
       +----PkResults

## Properties

      "inputs"                   guint                 : Read / Write
      "progress"                 PkProgress*           : Read / Write
      "role"                     guint                 : Read / Write

## Description

This GObject allows a client program to query the results sent from PackageKit. This will include `Package()`, `ErrorCode()` and all the other types of objects. Everything is refcounted, so ensure you unref when done with the data.

## Details

### PK_RESULTS_TYPE_ERROR

    #define PK_RESULTS_TYPE_ERROR (pk_results_error_get_type ())

### struct PkResults

    struct PkResults;

### struct PkResultsClass

    struct PkResultsClass {
    	GObjectClass parent_class;
    	/* padding for future expansion */
    	void (*_pk_reserved1) (void);
    	void (*_pk_reserved2) (void);
    	void (*_pk_reserved3) (void);
    	void (*_pk_reserved4) (void);
    	void (*_pk_reserved5) (void);
    };

### pk_results_add_category ()

    gboolean            pk_results_add_category             (PkResults *results,
                                                             PkCategory *item);

Adds a category item to the results set.

`results` : | a valid PkResults instance
`item` : | the object to add to the array
Returns : | `TRUE` if the value was set

Since 0.5.2

### pk_results_add_details ()

    gboolean            pk_results_add_details              (PkResults *results,
                                                             PkDetails *item);

Adds some package details to the results set.

`results` : | a valid PkResults instance
`item` : | the object to add to the array
Returns : | `TRUE` if the value was set

Since 0.5.2

### pk_results_add_distro_upgrade ()

    gboolean            pk_results_add_distro_upgrade       (PkResults *results,
                                                             PkDistroUpgrade *item);

Adds a distribution upgrade item to the results set.

`results` : | a valid PkResults instance
`item` : | the object to add to the array
Returns : | `TRUE` if the value was set

Since 0.5.2

### pk_results_add_eula_required ()

    gboolean            pk_results_add_eula_required        (PkResults *results,
                                                             PkEulaRequired *item);

Adds some EULA details to the results set.

`results` : | a valid PkResults instance
`item` : | the object to add to the array
Returns : | `TRUE` if the value was set

Since 0.5.2

### pk_results_add_files ()

    gboolean            pk_results_add_files                (PkResults *results,
                                                             PkFiles *item);

Adds some files details to the results set.

`results` : | a valid PkResults instance
`item` : | the object to add to the array
Returns : | `TRUE` if the value was set

Since 0.5.2

### pk_results_add_media_change_required ()

    gboolean            pk_results_add_media_change_required
                                                            (PkResults *results,
                                                             PkMediaChangeRequired *item);

Adds some media change details to the results set.

`results` : | a valid PkResults instance
`item` : | the object to add to the array
Returns : | `TRUE` if the value was set

Since 0.5.2

### pk_results_add_message ()

    gboolean            pk_results_add_message              (PkResults *results,
                                                             PkMessage *item);

Adds some message details to the results set.

`results` : | a valid PkResults instance
`item` : | the object to add to the array
Returns : | `TRUE` if the value was set

Since 0.5.2

### pk_results_add_package ()

    gboolean            pk_results_add_package              (PkResults *results,
                                                             PkPackage *item);

Adds a package to the results set.

`results` : | a valid PkResults instance
`item` : | the object to add to the array
Returns : | `TRUE` if the value was set

Since 0.5.3

### pk_results_add_repo_detail ()

    gboolean            pk_results_add_repo_detail          (PkResults *results,
                                                             PkRepoDetail *item);

Adds some repository details to the results set.

`results` : | a valid PkResults instance
`item` : | the object to add to the array
Returns : | `TRUE` if the value was set

Since 0.5.2

### pk_results_add_repo_signature_required ()

    gboolean            pk_results_add_repo_signature_required
                                                            (PkResults *results,
                                                             PkRepoSignatureRequired *item);

Adds some repository signature details to the results set.

`results` : | a valid PkResults instance
`item` : | the object to add to the array
Returns : | `TRUE` if the value was set

Since 0.5.2

### pk_results_add_require_restart ()

    gboolean            pk_results_add_require_restart      (PkResults *results,
                                                             PkRequireRestart *item);

Adds a require restart item to the results set.

`results` : | a valid PkResults instance
`item` : | the object to add to the array
Returns : | `TRUE` if the value was set

Since 0.5.2

### pk_results_add_transaction ()

    gboolean            pk_results_add_transaction          (PkResults *results,
                                                             PkTransactionPast *item);

Adds a transaction item to the results set.

`results` : | a valid PkResults instance
`item` : | the object to add to the array
Returns : | `TRUE` if the value was set

Since 0.5.2

### pk_results_add_update_detail ()

    gboolean            pk_results_add_update_detail        (PkResults *results,
                                                             PkUpdateDetail *item);

Adds some update details to the results set.

`results` : | a valid PkResults instance
`item` : | the object to add to the array
Returns : | `TRUE` if the value was set

Since 0.5.2

### pk_results_get_category_array ()

    GPtrArray *         pk_results_get_category_array       (PkResults *results);

Gets the categories from the transaction.

`results` : | a valid PkResults instance
Returns : | A GPtrArray array of PkCategory's, free with `g_ptr_array_unref()`. [element-type PkCategory][transfer container]

Since 0.5.2

### pk_results_get_details_array ()

    GPtrArray *         pk_results_get_details_array        (PkResults *results);

Gets the package details from the transaction.

`results` : | a valid PkResults instance
Returns : | A GPtrArray array of PkDetails's, free with `g_ptr_array_unref()`. [element-type PkDetails][transfer container]

Since 0.5.2

### pk_results_get_distro_upgrade_array ()

    GPtrArray *         pk_results_get_distro_upgrade_array (PkResults *results);

Gets the distribution upgrades from the transaction.

`results` : | a valid PkResults instance
Returns : | A GPtrArray array of PkDistroUpgrade's, free with `g_ptr_array_unref()`. [element-type PkDistroUpgrade][transfer container]

Since 0.5.2

### pk_results_get_error_code ()

    PkError *           pk_results_get_error_code           (PkResults *results);

Gets the last error code from the transaction.

`results` : | a valid PkResults instance
Returns : | A PkError, or `NULL`, free with `g_object_unref()`. [transfer full]

Since 0.5.2

### pk_results_get_eula_required_array ()

    GPtrArray *         pk_results_get_eula_required_array  (PkResults *results);

Gets the eulas required from the transaction.

`results` : | a valid PkResults instance
Returns : | A GPtrArray array of PkEulaRequired's, free with `g_ptr_array_unref()`. [element-type PkEulaRequired][transfer container]

Since 0.5.2

### pk_results_get_exit_code ()

    PkExitEnum          pk_results_get_exit_code            (PkResults *results);

Gets the exit enum. You probably don't want to be using this function, and instead using the much more useful `pk_results_get_error_code()` function.

`results` : | a valid PkResults instance
Returns : | The PkExitEnum or `PK_EXIT_ENUM_UNKNOWN` for error or if it was not set

Since 0.5.2

### pk_results_get_files_array ()

    GPtrArray *         pk_results_get_files_array          (PkResults *results);

Gets the files from the transaction.

`results` : | a valid PkResults instance
Returns : | A GPtrArray array of PkFiles's, free with `g_ptr_array_unref()`. [element-type PkFiles][transfer container]

Since 0.5.2

### pk_results_get_media_change_required_array ()

    GPtrArray *         pk_results_get_media_change_required_array
                                                            (PkResults *results);

Gets the media changes required from the transaction.

`results` : | a valid PkResults instance
Returns : | A GPtrArray array of PkMediaChangeRequired's, free with `g_ptr_array_unref()`. [element-type PkMediaChangeRequired][transfer container]

Since 0.5.2

### pk_results_get_message_array ()

    GPtrArray *         pk_results_get_message_array        (PkResults *results);

Gets the messages from the transaction.

`results` : | a valid PkResults instance
Returns : | A GPtrArray array of PkMessage's, free with `g_ptr_array_unref()`. [element-type PkMessage][transfer container]

Since 0.5.2

### pk_results_get_package_array ()

    GPtrArray *         pk_results_get_package_array        (PkResults *results);

Gets the packages from the transaction.

`results` : | a valid PkResults instance
Returns : | A GPtrArray array of PkPackage's, free with `g_ptr_array_unref()`. [element-type PkPackage][transfer container]

Since 0.5.2

### pk_results_get_package_sack ()

    PkPackageSack *     pk_results_get_package_sack         (PkResults *results);

Gets a package sack from the transaction.

`results` : | a valid PkResults instance
Returns : | A PkPackageSack of data, `g_object_unref()` to free. [transfer full]

Since 0.5.2

### pk_results_get_repo_detail_array ()

    GPtrArray *         pk_results_get_repo_detail_array    (PkResults *results);

Gets the repository details from the transaction.

`results` : | a valid PkResults instance
Returns : | A GPtrArray array of PkRepoDetail's, free with `g_ptr_array_unref()`. [element-type PkRepoDetail][transfer container]

Since 0.5.2

### pk_results_get_repo_signature_required_array ()

    GPtrArray *         pk_results_get_repo_signature_required_array
                                                            (PkResults *results);

Gets the repository signatures required from the transaction.

`results` : | a valid PkResults instance
Returns : | A GPtrArray array of PkRepoSignatureRequired's, free with `g_ptr_array_unref()`. [element-type PkRepoSignatureRequired][transfer container]

Since 0.5.2

### pk_results_get_require_restart_array ()

    GPtrArray *         pk_results_get_require_restart_array
                                                            (PkResults *results);

Gets the require restarts from the transaction.

`results` : | a valid PkResults instance
Returns : | A GPtrArray array of PkRequireRestart's, free with `g_ptr_array_unref()`. [element-type PkRequireRestart][transfer container]

Since 0.5.2

### pk_results_get_require_restart_worst ()

    PkRestartEnum       pk_results_get_require_restart_worst
                                                            (PkResults *results);

This method returns the 'worst' restart of all the transactions. It is needed as multiple sub-transactions may emit require-restart with different values, and we always want to get the most invasive of all.

For instance, if a transaction emits RequireRestart(system) and then RequireRestart(session) then pk_client_get_require_restart will return system as a session restart is implied with a system restart.

`results` : | a valid PkResults instance
Returns : | a PkRestartEnum value, e.g. PK_RESTART_ENUM_SYSTEM

Since 0.5.2

### pk_results_get_role ()

    PkRoleEnum          pk_results_get_role                 (PkResults *results);

Gets the role that produced these results.

`results` : | a valid PkResults instance
Returns : | The PkRoleEnum or `PK_ROLE_ENUM_UNKNOWN` if not set

Since 0.7.5

### pk_results_get_transaction_array ()

    GPtrArray *         pk_results_get_transaction_array    (PkResults *results);

Gets the transactions from the transaction.

`results` : | a valid PkResults instance
Returns : | A GPtrArray array of PkTransactionPast's, free with `g_ptr_array_unref()`. [element-type PkTransactionPast][transfer container]

Since 0.5.2

### pk_results_get_update_detail_array ()

    GPtrArray *         pk_results_get_update_detail_array  (PkResults *results);

Gets the update details from the transaction.

`results` : | a valid PkResults instance
Returns : | A GPtrArray array of PkUpdateDetail's, free with `g_ptr_array_unref()`. [element-type PkUpdateDetail][transfer container]

Since 0.5.2

### pk_results_new ()

    PkResults *         pk_results_new                      (void);

Returns : | a new PkResults object.

Since 0.5.2

### pk_results_set_error_code ()

    gboolean            pk_results_set_error_code           (PkResults *results,
                                                             PkError *item);

Adds some error details to the results set.

`results` : | a valid PkResults instance
`item` : | the object to add to the array
Returns : | `TRUE` if the value was set

Since 0.5.2

### pk_results_set_exit_code ()

    gboolean            pk_results_set_exit_code            (PkResults *results,
                                                             PkExitEnum exit_enum);

Sets the results object to have the given exit code.

`results` : | a valid PkResults instance
`exit_enum` : | the exit code
Returns : | `TRUE` if the value was set

Since 0.5.2

### pk_results_test ()

    void                pk_results_test                     (gpointer user_data);

## Property Details

### The `"inputs"` property

      "inputs"                   guint                 : Read / Write

Default value: 0

Since 0.5.3

### The `"progress"` property

      "progress"                 PkProgress*           : Read / Write

The progress instance.

Since 0.5.3

### The `"role"` property

      "role"                     guint                 : Read / Write

Allowed values: <= 38

Default value: 0

Since 0.5.2