Rest.Params

Fields

Name

Type

Access

Description

params

[object]

r

ref_count

int

r

Methods

class

new ()

add (param)

are_strings ()

as_string_hash_table ()

copy ()

get (name)

ref ()

remove (name)

unref ()

Details

class Rest.Params
classmethod new()
Returns:

A empty Rest.Params.

Return type:

Rest.Params

Create a new Rest.Params.

add(param)
Parameters:

param (Rest.Param) – a valid Rest.Param

Add param to self.

are_strings()
Returns:

True if all of the parameters are simple strings, False otherwise.

Return type:

bool

Checks if the parameters are all simple strings (have a content type of “text/plain”).

as_string_hash_table()
Returns:

a new GLib.HashTable.

Return type:

{str: Rest.Param}

Create a new GLib.HashTable which contains the name and value of all string (content type of text/plain) parameters.

The values are owned by the Rest.Params, so don’t destroy the Rest.Params before the hash table.

copy()
Returns:

A newly created Rest.Params with the same contents as self

Return type:

Rest.Params

Makes a deep copy of a Rest.Params.

get(name)
Parameters:

name (str) – a parameter name

Returns:

a Rest.Param or None if the name doesn’t exist

Return type:

Rest.Param or None

Return the Rest.Param called name, or None if it doesn’t exist.

ref()
Returns:

self

Return type:

Rest.Params

Increments the reference count of self by one.

remove(name)
Parameters:

name (str) – a parameter name

Remove the Rest.Param called name.

unref()

Decrements the reference count of self by one, freeing the structure when the reference count reaches zero.