Msg.Service

g GObject.Object GObject.Object Msg.Service Msg.Service GObject.Object->Msg.Service

Subclasses:

Msg.ContactService, Msg.DriveService, Msg.MessageService, Msg.UserService

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

accept_certificate_cb (msg, tls_cert, tls_errors, session)

class

get_https_port ()

class

get_next_link (object)

class

parse_response (bytes, object)

build_message (method, uri, etag, etag_if_match)

get_authorizer ()

get_session ()

refresh_authorization (cancellable)

send (message, cancellable)

send_and_parse_response (message, object, cancellable)

send_and_read (message, cancellable)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

authorizer

Msg.Authorizer

w/co

The authorizer for this service

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Msg.Service(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Msg.ServiceClass

classmethod accept_certificate_cb(msg, tls_cert, tls_errors, session)
Parameters:
Return type:

bool

classmethod get_https_port()
Return type:

int

Parameters:

object (Json.Object) – a Json.Object

Returns:

next link or None if not available

Return type:

str

Get next link

classmethod parse_response(bytes, object)
Parameters:
  • bytes (GLib.Bytes) – input bytes containing response buffer

  • object (Json.Object) – a pointer to the returning root object

Raises:

GLib.Error

Returns:

a Json.Parser

Return type:

Json.Parser

Parse response data and check for errors. In case no errors are found, return json root object.

build_message(method, uri, etag, etag_if_match)
Parameters:
  • method (str) – transfer method

  • uri (str) – uri to access

  • etag (str) – an optional etag

  • etag_if_match (bool) – use etag if

Returns:

a Soup.Message or None on error.

Return type:

Soup.Message

Construct and checks a Soup.Message for transfer

get_authorizer()
Returns:

a Msg.Authorizer

Return type:

Msg.Authorizer

Get related authorizer.

get_session()
Returns:

a Soup.Session

Return type:

Soup.Session

Get related soup session

refresh_authorization(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) –

Raises:

GLib.Error

Return type:

bool

send(message, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a Gio.InputStream

Return type:

Gio.InputStream

Adds authorizer information to message and send it.

send_and_parse_response(message, object, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a Json.Parser or None on error

Return type:

Json.Parser

A combination of msg_service_send_and_read and msg_service_parse_response

send_and_read(message, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a GLib.Bytes or None on error.

Return type:

GLib.Bytes

Adds authorizer information to message and send it.

Property Details

Msg.Service.props.authorizer
Name:

authorizer

Type:

Msg.Authorizer

Default Value:

None

Flags:

WRITABLE, CONSTRUCT_ONLY

The authorizer for this service