Snapd.Notice

g GObject.Object GObject.Object Snapd.Notice Snapd.Notice GObject.Object->Snapd.Notice

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

compare_last_occurred (notice_to_compare)

get_expire_after ()

get_first_occurred ()

get_first_occurred2 ()

get_id ()

get_key ()

get_last_data ()

get_last_data2 ()

get_last_occurred ()

get_last_occurred2 ()

get_last_occurred_nanoseconds ()

get_last_repeated ()

get_last_repeated2 ()

get_notice_type ()

get_occurrences ()

get_repeat_after ()

get_user_id ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

expire-after

int

r/w/co

Time (in ms) since one of these last occurred until we should drop the notice

first-occurred

GLib.DateTime

r/w/co

Time this notice first occurred

id

str

r/w/co

ID of notice

key

str

r/w/co

Key of notice

last-data

GLib.HashTable

r/w/co

Data for this notice

last-occurred

GLib.DateTime

r/w/co

Time this notice last occurred

last-occurred-nanoseconds

int

r/w/co

Time this notice last ocurred, in string format and with nanosecond accuracy

last-repeated

GLib.DateTime

r/w/co

Time this notice was last repeated

notice-type

int

r/w/co

Type of notice

occurrences

int

r/w/co

Number of time one of these notices has occurred

repeat-after

int

r/w/co

Time (in ms) after one of these was last repeated should we allow it to repeat

user-id

str

r/w/co

UserID of the user who may view this notice (None means all users)

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Snapd.Notice(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Snapd.NoticeClass

Snapd.Notice contains information on a notification element.

New in version 1.65.

compare_last_occurred(notice_to_compare)
Parameters:

notice_to_compare (Snapd.Notice) – another Snapd.Notice.

Returns:

-1 if the first one is before the second one; 0 if both are the same time instant, and 1 if the first one is after the second one.

Return type:

int

Compare the last_occurred fields (and the last_occurred_nanosecond if available) of both notices, and returns whether the first one is before, same or after the second one.

New in version 1.66.

get_expire_after()
Returns:

a #GTimeSpan.

Return type:

int

Get the time interval after this notification can expire.

New in version 1.65.

get_first_occurred()
Returns:

a GLib.DateTime.

Return type:

GLib.DateTime

Get the time this notification first occurred.

New in version 1.65.

Deprecated since version 1.66: Use Snapd.Notice.get_first_occurred2()

get_first_occurred2()
Returns:

a GLib.DateTime.

Return type:

GLib.DateTime

Get the time this notification first occurred.

New in version 1.66.

get_id()
Returns:

an ID.

Return type:

str

Get the unique ID for this notice.

New in version 1.65.

get_key()
Returns:

a string with the key.

Return type:

str

Get the notice-id or the instance-name, depending on the type.

New in version 1.65.

get_last_data()
Returns:

a HashTable with the data elements.

Return type:

{object: object}

Get the data of the notice.

New in version 1.65.

Deprecated since version 1.66: Use Snapd.Notice.get_last_data2()

get_last_data2()
Returns:

a HashTable with the data elements.

Return type:

{object: object}

Get the data of the notice.

New in version 1.66.

get_last_occurred()
Returns:

a GLib.DateTime.

Return type:

GLib.DateTime

Get the time this notification last occurred.

New in version 1.65.

Deprecated since version 1.66: Use Snapd.Notice.get_last_occurred2()

get_last_occurred2()
Returns:

a GLib.DateTime.

Return type:

GLib.DateTime

Get the time this notification last occurred.

New in version 1.66.

get_last_occurred_nanoseconds()
Returns:

the nanosecond value between 0 and 999999999, or -1 if no nanosecond value was set.

Return type:

int

Get the nanoseconds value of *last-occurred*, exactly as sent by snapd. Useful when combined with Snapd.Client.notices_set_since_nanoseconds, and used internally by Snapd.Client.notices_set_after_notice, to ensure the maximum possible precission when dealing with timestamps.

New in version 1.66.

get_last_repeated()
Returns:

a GLib.DateTime.

Return type:

GLib.DateTime

Get the time this notification last repeated.

New in version 1.65.

Deprecated since version 1.66: Use Snapd.Notice.get_last_repeated2()

get_last_repeated2()
Returns:

a GLib.DateTime.

Return type:

GLib.DateTime

Get the time this notification last repeated.

New in version 1.66.

get_notice_type()
Returns:

the type of notice.

Return type:

Snapd.NoticeType

Gets the type of notice this is.

New in version 1.65.

get_occurrences()
Returns:

a count.

Return type:

int

Get the number of times that this notification has been triggered.

New in version 1.65.

get_repeat_after()
Returns:

a #GTimeSpan.

Return type:

int

Get the time interval after this notification can be repeated.

New in version 1.65.

get_user_id()
Returns:

an user ID.

Return type:

str

Get the user ID for this notice, or None if no user is defined

New in version 1.65.

Property Details

Snapd.Notice.props.expire_after
Name:

expire-after

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Time (in ms) since one of these last occurred until we should drop the notice

Snapd.Notice.props.first_occurred
Name:

first-occurred

Type:

GLib.DateTime

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Time this notice first occurred

Snapd.Notice.props.id
Name:

id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

ID of notice

Snapd.Notice.props.key
Name:

key

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Key of notice

Snapd.Notice.props.last_data
Name:

last-data

Type:

GLib.HashTable

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Data for this notice

Snapd.Notice.props.last_occurred
Name:

last-occurred

Type:

GLib.DateTime

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Time this notice last occurred

Snapd.Notice.props.last_occurred_nanoseconds
Name:

last-occurred-nanoseconds

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Time this notice last ocurred, in string format and with nanosecond accuracy

Snapd.Notice.props.last_repeated
Name:

last-repeated

Type:

GLib.DateTime

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Time this notice was last repeated

Snapd.Notice.props.notice_type
Name:

notice-type

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Type of notice

Snapd.Notice.props.occurrences
Name:

occurrences

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Number of time one of these notices has occurred

Snapd.Notice.props.repeat_after
Name:

repeat-after

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Time (in ms) after one of these was last repeated should we allow it to repeat

Snapd.Notice.props.user_id
Name:

user-id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

UserID of the user who may view this notice (None means all users)