PkResults: PackageKit Reference Manual

## PkResults PkResults — Transaction results |

## Functions

PkResults * | pk_results_new ()
gboolean | pk_results_set_exit_code ()
gboolean | pk_results_set_error_code ()
gboolean | pk_results_add_package ()
gboolean | pk_results_add_details ()
gboolean | pk_results_add_update_detail ()
gboolean | pk_results_add_category ()
gboolean | pk_results_add_distro_upgrade ()
gboolean | pk_results_add_require_restart ()
gboolean | pk_results_add_transaction ()
gboolean | pk_results_add_files ()
gboolean | pk_results_add_repo_signature_required ()
gboolean | pk_results_add_eula_required ()
gboolean | pk_results_add_media_change_required ()
gboolean | pk_results_add_repo_detail ()
PkExitEnum | pk_results_get_exit_code ()
PkPackageSack * | pk_results_get_package_sack ()
PkError * | pk_results_get_error_code ()
PkRoleEnum | pk_results_get_role ()
PkBitfield | pk_results_get_transaction_flags ()
PkRestartEnum | pk_results_get_require_restart_worst ()
GPtrArray * | pk_results_get_package_array ()
GPtrArray * | pk_results_get_details_array ()
GPtrArray * | pk_results_get_update_detail_array ()
GPtrArray * | pk_results_get_category_array ()
GPtrArray * | pk_results_get_distro_upgrade_array ()
GPtrArray * | pk_results_get_require_restart_array ()
GPtrArray * | pk_results_get_transaction_array ()
GPtrArray * | pk_results_get_files_array ()
GPtrArray * | pk_results_get_repo_signature_required_array ()
GPtrArray * | pk_results_get_eula_required_array ()
GPtrArray * | pk_results_get_media_change_required_array ()
GPtrArray * | pk_results_get_repo_detail_array ()

## Types and Values

#define | PK_RESULTS_TYPE_ERROR

## 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.

## Functions

### pk_results_new ()

    PkResults *
    pk_results_new (void);

#### Returns

a new PkResults object.

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.

#### Parameters

results | a valid PkResults instance |
exit_enum | the exit code |

#### Returns

`TRUE` if the value was set

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.

#### Parameters

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.

#### Parameters

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_details ()

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

Adds some package details to the results set.

#### Parameters

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.

#### Parameters

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_category ()

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

Adds a category item to the results set.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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_detail ()

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

Adds some repository details to the results set.

#### Parameters

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_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.

#### Parameters

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_package_sack ()

    PkPackageSack *
    pk_results_get_package_sack (PkResults *results);

Gets a package sack from the transaction.

#### Parameters

results | a valid PkResults instance |

#### Returns

A PkPackageSack of data, `g_object_unref()` to free.

[transfer full]

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.

#### Parameters

results | a valid PkResults instance |

#### Returns

A PkError, or `NULL`, free with `g_object_unref()`.

[transfer full]

Since: 0.5.2

### pk_results_get_role ()

    PkRoleEnum
    pk_results_get_role (PkResults *results);

Gets the role that produced these results.

#### Parameters

results | a valid PkResults instance |

#### Returns

The PkRoleEnum or `PK_ROLE_ENUM_UNKNOWN` if not set

Since: 0.7.5

### pk_results_get_transaction_flags ()

    PkBitfield
    pk_results_get_transaction_flags (PkResults *results);

Gets the transaction flag for these results.

#### Parameters

results | a valid PkResults instance |

#### Returns

a PkBitfield containing PkTransactionFlagEnum 0 if not set

Since: 0.8.1

### 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.

#### Parameters

results | a valid PkResults instance |

#### Returns

a PkRestartEnum value, e.g. PK_RESTART_ENUM_SYSTEM

Since: 0.5.2

### pk_results_get_package_array ()

    GPtrArray *
    pk_results_get_package_array (PkResults *results);

Gets the packages from the transaction.

#### Parameters

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_details_array ()

    GPtrArray *
    pk_results_get_details_array (PkResults *results);

Gets the package details from the transaction.

#### Parameters

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_update_detail_array ()

    GPtrArray *
    pk_results_get_update_detail_array (PkResults *results);

Gets the update details from the transaction.

#### Parameters

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_get_category_array ()

    GPtrArray *
    pk_results_get_category_array (PkResults *results);

Gets the categories from the transaction.

#### Parameters

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_distro_upgrade_array ()

    GPtrArray *
    pk_results_get_distro_upgrade_array (PkResults *results);

Gets the distribution upgrades from the transaction.

#### Parameters

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_require_restart_array ()

    GPtrArray *
    pk_results_get_require_restart_array (PkResults *results);

Gets the require restarts from the transaction.

#### Parameters

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_transaction_array ()

    GPtrArray *
    pk_results_get_transaction_array (PkResults *results);

Gets the transactions from the transaction.

#### Parameters

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_files_array ()

    GPtrArray *
    pk_results_get_files_array (PkResults *results);

Gets the files from the transaction.

#### Parameters

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_repo_signature_required_array ()

    GPtrArray *
    pk_results_get_repo_signature_required_array
                                   (PkResults *results);

Gets the repository signatures required from the transaction.

#### Parameters

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_eula_required_array ()

    GPtrArray *
    pk_results_get_eula_required_array (PkResults *results);

Gets the eulas required from the transaction.

#### Parameters

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_media_change_required_array ()

    GPtrArray *
    pk_results_get_media_change_required_array
                                   (PkResults *results);

Gets the media changes required from the transaction.

#### Parameters

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_repo_detail_array ()

    GPtrArray *
    pk_results_get_repo_detail_array (PkResults *results);

Gets the repository details from the transaction.

#### Parameters

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

## Types and Values

### PK_RESULTS_TYPE_ERROR

    #define PK_RESULTS_TYPE_ERROR (pk_results_error_get_type ())