EDataServer.WebDAVSession¶
- Subclasses:
None
Methods¶
- Inherited:
EDataServer.SoupSession (29), Soup.Session (43), GObject.Object (37)
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
Class Details¶
- class EDataServer.WebDAVSession(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Contains only private data that should be read and manipulated using the functions below.
New in version 3.26.
- classmethod new(source)¶
- Parameters:
source (
EDataServer.Source) – anEDataServer.Source- Returns:
a new
EDataServer.WebDAVSession; free it withGObject.Object.unref(), when no longer needed.- Return type:
Creates a new
EDataServer.WebDAVSessionassociated with given source. TheEDataServer.WebDAVSessionuses anEDataServer.SourceWebdavextension on certain places when it’s defined for the source.New in version 3.26.
- classmethod util_free_privileges(privileges)¶
- Parameters:
privileges (
GLib.NodeorNone) – a tree ofEDataServer.WebDAVPrivilegestructures
Frees privileges returned by
EDataServer.WebDAVSession.get_supported_privilege_set_sync(). The function does nothing, if privileges isNone.New in version 3.26.
- classmethod util_item_href_equal(href1, href2)¶
- Parameters:
- Returns:
whether the two href-s reference the same item
- Return type:
Compares two hrefs and return whether they reference the same item on the server. The comparison is done in a relaxed way, not considering scheme
Camel.partand comparing the host name case insensitively, while the path case sensitively. It also ignores the username/password information in the hostnameCamel.part, if it’s included. The function doesn’t decode any URI-encoded characters.New in version 3.40.
- acl_sync(uri, xml, cancellable)¶
- Parameters:
uri (
strorNone) – URI to issue the request for, orNoneto read fromEDataServer.Sourcexml (
EDataServer.XmlDocument) – the request itself, as anEDataServer.XmlDocument, the root element should be DAV:aclcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- Return type:
Issues ACL request on the provided uri, or, in case it’s
None, on the URI defined in associatedEDataServer.Source.New in version 3.26.
- copy_sync(source_uri, destination_uri, depth, can_overwrite, cancellable)¶
- Parameters:
source_uri (
str) – URI of the resource or collection to copydestination_uri (
str) – URI of the destinationdepth (
str) – requested depth, can be one ofEDataServer.WEBDAV_DEPTH_THISorEDataServer.WEBDAV_DEPTH_INFINITYcan_overwrite (
bool) – whether can overwrite destination_uri, when it existscancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- Return type:
Copies a resource identified by source_uri to destination_uri on the server. The source_uri can reference also collections, in which case the depth influences whether only the collection itself is copied (
EDataServer.WEBDAV_DEPTH_THIS) or whether the collection with all its children is copied (EDataServer.WEBDAV_DEPTH_INFINITY).New in version 3.26.
- delete_sync(uri, depth, etag, cancellable)¶
- Parameters:
uri (
str) – URI of the resource to deletedepth (
strorNone) – optional requested depth, can be one ofEDataServer.WEBDAV_DEPTH_THISorEDataServer.WEBDAV_DEPTH_INFINITY, orNoneetag (
strorNone) – an optional ETag of the resource, orNonecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- Return type:
Deletes a resource identified by uri on the server. The URI can reference a collection, in which case depth should be
EDataServer.WEBDAV_DEPTH_INFINITY. Use depthEDataServer.WEBDAV_DEPTH_THISwhen deleting a regular resource, orNone, to let the server use default Depth.The etag argument is used to avoid clashes when overwriting existing resources. Use
Noneetag when deleting collection resources or to force the deletion, otherwise provide a valid ETag of a non-collection resource to verify that the version requested to delete is the same as on the server.Note that the actual usage of etag is also influenced by
EDataServer.SourceWebdav:avoid-ifmatchproperty of the associatedEDataServer.Source.New in version 3.26.
- delete_with_headers_sync(uri, depth, etag, in_headers, cancellable)¶
- Parameters:
uri (
str) – URI of the resource to deletedepth (
strorNone) – optional requested depth, can be one ofEDataServer.WEBDAV_DEPTH_THISorEDataServer.WEBDAV_DEPTH_INFINITY, orNoneetag (
strorNone) – an optional ETag of the resource, orNonein_headers (
Soup.MessageHeadersorNone) – additionalSoup.MessageHeadersto be added to the request, orNonecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- Return type:
Deletes a resource identified by uri on the server. The URI can reference a collection, in which case depth should be
EDataServer.WEBDAV_DEPTH_INFINITY. Use depthEDataServer.WEBDAV_DEPTH_THISwhen deleting a regular resource, orNone, to let the server use default Depth.The etag argument is used to avoid clashes when overwriting existing resources. Use
Noneetag when deleting collection resources or to force the deletion, otherwise provide a valid ETag of a non-collection resource to verify that the version requested to delete is the same as on the server.The optional in_headers can contain additional headers to be added to the request. These headers replace any existing in the request headers, without support for the list-values headers.
Note that the actual usage of etag is also influenced by
EDataServer.SourceWebdav:avoid-ifmatchproperty of the associatedEDataServer.Source.New in version 3.50.
- ensure_full_uri(request_uri, href)¶
- Parameters:
- Returns:
The href as a full URI
- Return type:
Converts possibly path-only href into a full URI under the request_uri. When the request_uri is
None, the URI defined in associatedEDataServer.Sourceis used instead, taken from theEDataServer.SourceWebdavextension, if defined.Free the returned pointer with
GLib.free(), when no longer needed.New in version 3.24.
- get_acl_restrictions_sync(uri, cancellable)¶
- Parameters:
uri (
strorNone) – URI to issue the request for, orNoneto read fromEDataServer.Sourcecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_restrictions:
return location for bit-or of
EDataServer.WebDAVACLRestrictions- out_principal_kind:
return location for principal kind
- out_principal_hrefs:
return location for a
GLib.SListof principal href-s
- Return type:
(
bool, out_restrictions:int, out_principal_kind:EDataServer.WebDAVACEPrincipalKind, out_principal_hrefs: [str])
Gets Access Control List (ACL) restrictions for the uri, or, in case it’s
None, for the URI defined in associatedEDataServer.Source. The out_principal_kind is valid only if the out_restrictions containsEDataServer.WebDAVACLRestrictions.REQUIRED_PRINCIPAL. The out_principal_hrefs is valid only if the out_principal_kind is valid and when it isEDataServer.WebDAVACEPrincipalKind.HREF.Free the returned out_principal_hrefs with g_slist_free_full (entries,
GLib.free); when no longer needed.New in version 3.26.
- get_acl_sync(uri, cancellable)¶
- Parameters:
uri (
strorNone) – URI to issue the request for, orNoneto read fromEDataServer.Sourcecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_entries:
return location for a
GLib.SListofEDataServer.WebDAVAccessControlEntry
- Return type:
(
bool, out_entries: [EDataServer.WebDAVAccessControlEntry])
Gets Access Control List (ACL) for the uri, or, in case it’s
None, for the URI defined in associatedEDataServer.Source.This function doesn’t read general
EDataServer.WebDAVACEPrincipalKind.PROPERTY.Free the returned out_entries with g_slist_free_full (entries,
EDataServer.WebDAVAccessControlEntry.free); when no longer needed.New in version 3.26.
- get_current_user_privilege_set_full_sync(uri, cancellable)¶
- Parameters:
uri (
strorNone) – URI to issue the request for, orNoneto read fromEDataServer.Sourcecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_privileges:
return location for a
GLib.SListofEDataServer.WebDAVPrivilege- out_capabilities:
return location for DAV capabilities, or
None- out_allows:
return location for allowed operations, or
None
- Return type:
(
bool, out_privileges: [EDataServer.WebDAVPrivilege], out_capabilities: {object:object}, out_allows: {object:object})
Gets current user privileges for the uri, or, in case it’s
None, for the URI defined in associatedEDataServer.Source, with optional read of the capabilities and what the user is allowed. SeeEDataServer.WebDAVSession.options_sync() for more information about the out_capabilities and out_allows values.Free the returned out_privileges with g_slist_free_full (privileges,
EDataServer.WebDAVPrivilege.free); when no longer needed.New in version 3.26.
- get_current_user_privilege_set_sync(uri, cancellable)¶
- Parameters:
uri (
strorNone) – URI to issue the request for, orNoneto read fromEDataServer.Sourcecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_privileges:
return location for a
GLib.SListofEDataServer.WebDAVPrivilege
- Return type:
(
bool, out_privileges: [EDataServer.WebDAVPrivilege])
Gets current user privileges for the uri, or, in case it’s
None, for the URI defined in associatedEDataServer.Source.Free the returned out_privileges with g_slist_free_full (privileges,
EDataServer.WebDAVPrivilege.free); when no longer needed.New in version 3.26.
- get_data_sync(uri, cancellable)¶
- Parameters:
uri (
str) – URI of the resource to readcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_href:
optional return location for href of the resource, or
None- out_etag:
optional return location for etag of the resource, or
None- out_headers:
optional return location for response
Soup.MessageHeaders, orNone- out_bytes:
return location for bytes being read
- out_length:
option return location for length of bytes being read, or
None
- Return type:
(
bool, out_href:strorNone, out_etag:strorNone, out_headers:Soup.MessageHeaders, out_bytes:str, out_length:int)
Reads a resource identified by uri from the server. The URI cannot reference a collection.
The out_bytes is filled by actual data being read. If not
None, out_length is populated with how many bytes had been read. The out_bytes is always NUL-terminated, while this termination byte is notCamel.partof out_length. Free the out_bytes withGLib.free(), when no longer needed.Free returned pointer of out_href and out_etag, if not
None, withGLib.free(), when no longer needed.The optional out_headers contains response headers. Free it with soup_message_headers_free(), when no longer needed.
To read large data use
EDataServer.WebDAVSession.get_sync() instead.New in version 3.26.
- get_last_dav_error_code()¶
- Returns:
a DAV error from the last request, or
None, when no error had been recognized.- Return type:
Returns last DAV error code as returned by the server. Each recognized code is enclosed in “[]” in the returned string, to be able to distinguish between them, in case the server returned multiple codes.
The string is valid until the next request is executed.
New in version 3.36.
- get_last_dav_error_is_permission()¶
- Returns:
whether the last recognized DAV error code contains an error which means that user doesn’t have permission for the operation. If there is no DAV error stored, then returns
False.- Return type:
New in version 3.36.
- get_principal_collection_set_sync(uri, cancellable)¶
- Parameters:
uri (
strorNone) – URI to issue the request for, orNoneto read fromEDataServer.Sourcecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_principal_hrefs:
return location for a
GLib.SListof principal href-s
- Return type:
Gets list of principal collection href for the uri, or, in case it’s
None, for the URI defined in associatedEDataServer.Source. The out_principal_hrefs are root collections that contain the principals that are available on the server that implements this resource.Free the returned out_principal_hrefs with g_slist_free_full (entries,
GLib.free); when no longer needed.New in version 3.26.
- get_supported_privilege_set_sync(uri, cancellable)¶
- Parameters:
uri (
strorNone) – URI to issue the request for, orNoneto read fromEDataServer.Sourcecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_privileges:
return location for the tree of supported privileges
- Return type:
Gets supported privileges for the uri, or, in case it’s
None, for the URI defined in associatedEDataServer.Source.The root node of out_privileges has always
Nonedata.Free the returned out_privileges with
EDataServer.WebDAVSession.util_free_privileges() when no longer needed.New in version 3.26.
- get_sync(uri, cancellable)¶
- Parameters:
uri (
str) – URI of the resource to readcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_href:
optional return location for href of the resource, or
None- out_etag:
optional return location for etag of the resource, or
None- out_headers:
optional return location for response
Soup.MessageHeaders, orNone- out_stream:
a
Gio.OutputStreamto write data to
- Return type:
(
bool, out_href:strorNone, out_etag:strorNone, out_headers:Soup.MessageHeaders, out_stream:Gio.OutputStream)
Reads a resource identified by uri from the server and writes it to the stream. The URI cannot reference a collection.
Free returned pointer of out_href and out_etag, if not
None, withGLib.free(), when no longer needed.The optional out_headers contains response headers. Free it with soup_message_headers_free(), when no longer needed.
The
EDataServer.WebDAVSession.get_data_sync() can be used to read the resource data directly to memory.New in version 3.26.
- getctag_sync(uri, cancellable)¶
- Parameters:
uri (
strorNone) – URI to issue the request for, orNoneto read fromEDataServer.Sourcecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_ctag:
return location for the ctag
- Return type:
Issues a getctag property request for a collection identified by uri, or, in case it’s
None, on the URI defined in associatedEDataServer.Source. The ctag is a collection tag, which changes whenever the collection changes (similar to etag). The getctag is an extension, thus the function can fail when the server doesn’t support it.Free the returned out_ctag with
GLib.free(), when no longer needed.New in version 3.26.
- list_sync(uri, depth, flags, cancellable)¶
- Parameters:
uri (
strorNone) – URI to issue the request for, orNoneto read fromEDataServer.Sourcedepth (
str) – requested depth, can be one ofEDataServer.WEBDAV_DEPTH_THIS,EDataServer.WEBDAV_DEPTH_THIS_AND_CHILDRENorEDataServer.WEBDAV_DEPTH_INFINITYflags (
int) – a bit-or ofEDataServer.WebDAVListFlags, claiming what properties to readcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_resources:
return location for the resources
- Return type:
(
bool, out_resources: [EDataServer.WebDAVResource])
Lists content of the uri, or, in case it’s
None, of the URI defined in associatedEDataServer.Source, which should point to a collection. The flags influences which properties are read for the resources.The out_resources is in no particular order.
Free the returned out_resources with g_slist_free_full (resources,
EDataServer.WebDAVResource.free); when no longer needed.New in version 3.26.
- lock_resource_sync(uri, lock_scope, lock_timeout, owner, cancellable)¶
- Parameters:
uri (
strorNone) – URI to lock, orNoneto read fromEDataServer.Sourcelock_scope (
EDataServer.WebDAVLockScope) – anEDataServer.WebDAVLockScopeto define the scope of the locklock_timeout (
int) – timeout for the lock, in seconds, on 0 to infinityowner (
strorNone) – optional identificator of the owner of the lock, orNonecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_lock_token:
return location of the obtained or refreshed lock token
- Return type:
Locks a resource identified by uri, or, in case it’s
None, by the URI defined in associatedEDataServer.Source. It obtains a write lock with the given lock_scope.The owner is used to identify the lock owner. When it’s an http:// or https://, then it’s referenced as DAV:href, otherwise the value is treated as plain text. If it’s
None, then the user name from the associatedEDataServer.Sourceis used.The out_lock_token can be refreshed with
EDataServer.WebDAVSession.refresh_lock_sync(). Release the lock withEDataServer.WebDAVSession.unlock_sync(). Free the returned out_lock_token withGLib.free(), when no longer needed.New in version 3.26.
- lock_sync(uri, depth, lock_timeout, xml, cancellable)¶
- Parameters:
uri (
strorNone) – URI to lock, orNoneto read fromEDataServer.Sourcedepth (
str) – requested depth, can be one ofEDataServer.WEBDAV_DEPTH_THISorEDataServer.WEBDAV_DEPTH_INFINITYlock_timeout (
int) – timeout for the lock, in seconds, on 0 to infinityxml (
EDataServer.XmlDocument) – an XML describing the lock request, with DAV:lockinfo root elementcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_lock_token:
return location of the obtained or refreshed lock token
- out_xml_response:
optional return location for the server response as
libxml2.DocPtr
- Return type:
(
bool, out_lock_token:str, out_xml_response:libxml2.DocorNone)
Locks a resource identified by uri, or, in case it’s
None, on the URI defined in associatedEDataServer.Source.The out_lock_token can be refreshed with
EDataServer.WebDAVSession.refresh_lock_sync(). Release the lock withEDataServer.WebDAVSession.unlock_sync(). Free the returned out_lock_token withGLib.free(), when no longer needed.If provided, free the returned out_xml_response with xmlFreeDoc(), when no longer needed.
New in version 3.26.
- mkcalendar_sync(uri, display_name, description, color, supports, cancellable)¶
- Parameters:
uri (
str) – URI of the collection to createdisplay_name (
strorNone) – a human-readable display name to set, orNonedescription (
strorNone) – a human-readable description of the calendar, orNonecolor (
strorNone) – a color to set, in format “#RRGGBB”, orNonesupports (
int) – a bit-or ofEDataServer.WebDAVResourceSupportsvaluescancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- Return type:
Creates a new calendar collection identified by uri on the server. The supports defines what component types can be stored into the created calendar collection. Only
EDataServer.WebDAVResourceSupports.NONEand values related to iCalendar content can be used here. UsingEDataServer.WebDAVResourceSupports.NONEmeans that everything is supported.Note that CalDAV RFC 4791 Section 4.2 forbids to create calendar resources under other calendar resources (no nested calendars are allowed).
New in version 3.26.
- mkcol_addressbook_sync(uri, display_name, description, cancellable)¶
- Parameters:
- Raises:
- Returns:
Whether succeeded.
- Return type:
Creates a new address book collection identified by uri on the server.
Note that CardDAV RFC 6352 Section 5.2 forbids to create address book resources under other address book resources (no nested address books are allowed).
New in version 3.26.
- mkcol_sync(uri, cancellable)¶
- Parameters:
uri (
str) – URI of the collection to createcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- Return type:
Creates a new generic collection identified by uri on the server. To create specific collections use
EDataServer.WebDAVSession.mkcalendar_sync() orEDataServer.WebDAVSession.mkcol_addressbook_sync().New in version 3.26.
- move_sync(source_uri, destination_uri, can_overwrite, cancellable)¶
- Parameters:
source_uri (
str) – URI of the resource or collection to copydestination_uri (
str) – URI of the destinationcan_overwrite (
bool) – whether can overwrite destination_uri, when it existscancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- Return type:
Moves a resource identified by source_uri to destination_uri on the server. The source_uri can reference also collections.
New in version 3.26.
- new_message(method, uri)¶
- Parameters:
method (
str) – an HTTP methoduri (
strorNone) – URI to create the request for, orNoneto read fromEDataServer.Source
- Raises:
- Returns:
A new
Soup.Messagefor the given uri, or, whenNone, for the URI stored in the associatedEDataServer.Source. Free the returned structure withGObject.Object.unref(), when no longer needed.- Return type:
New in version 3.26.
- options_sync(uri, cancellable)¶
- Parameters:
uri (
strorNone) – URI to issue the request for, orNoneto read fromEDataServer.Sourcecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_capabilities:
return location for DAV capabilities
- out_allows:
return location for allowed operations
- Return type:
(
bool, out_capabilities: {object:object}, out_allows: {object:object})
Issues OPTIONS request on the provided uri, or, in case it’s
None, on the URI defined in associatedEDataServer.Source.The out_capabilities contains a set of returned capabilities. Some known are defined as
EDataServer.WEBDAV_CAPABILITY_CLASS_1, and so on. The ‘value’ of theGLib.HashTabledoesn’t have any particular meaning and the strings are compared case insensitively. Free the hash table withGLib.HashTable.destroy(), when no longer needed. The returned value can beNoneon success, it’s when the server doesn’t provide the information.The out_allows contains a set of allowed methods returned by the server. Some known are defined as %SOUP_METHOD_OPTIONS, and so on. The ‘value’ of the
GLib.HashTabledoesn’t have any particular meaning and the strings are compared case insensitively. Free the hash table withGLib.HashTable.destroy(), when no longer needed. The returned value can beNoneon success, it’s when the server doesn’t provide the information.New in version 3.26.
- post_sync(uri, data, data_length, in_content_type, in_headers, cancellable)¶
- Parameters:
uri (
strorNone) – URI to issue the request for, orNoneto read fromEDataServer.Sourcedata (
str) – data to post to the serverdata_length (
int) – length of data, or -1, when data is NUL-terminatedin_content_type (
strorNone) – a Content-Type of the data, orNone, to use application/xmlin_headers (
Soup.MessageHeadersorNone) – additionalSoup.MessageHeadersto be added to the request, orNonecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_content_type:
return location for response Content-Type, or
None- out_headers:
optional return location for response
Soup.MessageHeaders, orNone- out_content:
return location for response content, or
None
- Return type:
(
bool, out_content_type:strorNone, out_headers:Soup.MessageHeaders, out_content:bytes)
Issues POST request on the provided uri, or, in case it’s
None, on the URI defined in associatedEDataServer.Source.The optional in_headers can contain additional headers to be added to the request. These headers replace any existing in the request headers, without support for the list-values headers.
The optional out_content_type can be used to get content type of the response. Free it with
GLib.free(), when no longer needed.The optional out_headers contains response headers. Free it with soup_message_headers_free(), when no longer needed.
The optional out_content can be used to get actual result content. Free it with
GLib.ByteArray.free(), when no longer needed.New in version 3.32.
- principal_property_search_sync(uri, apply_to_principal_collection_set, match_ns_uri, match_property, match_value, cancellable)¶
- Parameters:
uri (
strorNone) – URI to issue the request for, orNoneto read fromEDataServer.Sourceapply_to_principal_collection_set (
bool) – whether to apply to principal-collection-setmatch_ns_uri (
strorNone) – namespace URI of the property to search in, orNoneforEDataServer.WEBDAV_NS_DAVmatch_property (
str) – name of the property to search inmatch_value (
str) – a string value to search forcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded. Note it can report success also when no matching principal had been found.
- out_principals:
return location for matching principals
- Return type:
(
bool, out_principals: [EDataServer.WebDAVResource])
Issues a DAV:principal-property-search for the uri, or, in case it’s
None, for the URI defined in associatedEDataServer.Source. The DAV:principal-property-search performs a search for all principals whose properties contain character data that matches the search criteria match_value in match_property property of namespace match_ns_uri.By default, the function searches all members (at any depth) of the collection identified by the uri. If apply_to_principal_collection_set is set to
True, the search is applied instead to each collection returned byEDataServer.WebDAVSession.get_principal_collection_set_sync() for the uri.The out_principals is a
GLib.SListofEDataServer.WebDAVResource, where the kind is set toEDataServer.WebDAVResourceKind.PRINCIPALand only href with displayname are filled. All other members ofEDataServer.WebDAVResourceare not set.Free the returned out_principals with g_slist_free_full (principals,
EDataServer.WebDAVResource.free); when no longer needed.New in version 3.26.
- propfind_sync(uri, depth, xml, func, func_user_data, cancellable)¶
- Parameters:
uri (
strorNone) – URI to issue the request for, orNoneto read fromEDataServer.Sourcedepth (
str) – requested depth, can be one ofEDataServer.WEBDAV_DEPTH_THIS,EDataServer.WEBDAV_DEPTH_THIS_AND_CHILDRENorEDataServer.WEBDAV_DEPTH_INFINITYxml (
EDataServer.XmlDocumentorNone) – the request itself, as anEDataServer.XmlDocument, the root element should be DAV:propfind, orNonefunc (
EDataServer.WebDAVPropstatTraverseFunc) – anEDataServer.WebDAVPropstatTraverseFuncfunction to call for each DAV:propstat in the multistatus responsecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- Return type:
Issues PROPFIND request on the provided uri, or, in case it’s
None, on the URI defined in associatedEDataServer.Source. On success, calls func for each returned DAV:propstat.The xml can be
None, in which case the server should behave like DAV:allprop request.New in version 3.26.
- proppatch_sync(uri, xml, cancellable)¶
- Parameters:
uri (
strorNone) – URI to issue the request for, orNoneto read fromEDataServer.Sourcexml (
EDataServer.XmlDocument) – anEDataServer.XmlDocumentwith request changes, its root element should be DAV:propertyupdatecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- Return type:
Issues PROPPATCH request on the provided uri, or, in case it’s
None, on the URI defined in associatedEDataServer.Source, with the changes. The order of requested changes inside xml is significant, unlike on other places.New in version 3.26.
- put_data_sync(uri, etag, content_type, in_headers, bytes, length, cancellable)¶
- Parameters:
uri (
str) – URI of the resource to writeetag (
strorNone) – an ETag of the resource, if it’s an existing resource, orNonecontent_type (
str) – Content-Type of the bytes to be writtenin_headers (
Soup.MessageHeadersorNone) – additionalSoup.MessageHeadersto be added to the request, orNonebytes (
str) – actual bytes to be writtenlength (
int) – how many bytes to write, or -1, when the bytes is NUL-terminatedcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_href:
optional return location for href of the resource, or
None- out_etag:
optional return location for etag of the resource, or
None- out_headers:
optional return location for response
Soup.MessageHeaders, orNone
- Return type:
(
bool, out_href:strorNone, out_etag:strorNone, out_headers:Soup.MessageHeaders)
Writes data to a resource identified by uri to the server. The URI cannot reference a collection.
The etag argument is used to avoid clashes when overwriting existing resources. It can contain three values:
None- to write completely new resourceempty string - write new resource or overwrite any existing, regardless changes on the server
valid ETag - overwrite existing resource only if it wasn’t changed on the server.
Note that the actual usage of etag is also influenced by
EDataServer.SourceWebdav:avoid-ifmatchproperty of the associatedEDataServer.Source.The optional in_headers can contain additional headers to be added to the request. These headers replace any existing in the request headers, without support for the list-values headers.
The out_href, if provided, is filled with the resulting URI of the written resource. It can be different from the uri when the server redirected to a different location.
The out_etag contains ETag of the resource after it had been saved.
The optional out_headers contains response headers. Free it with soup_message_headers_free(), when no longer needed.
To write large data use
EDataServer.WebDAVSession.put_sync() instead.New in version 3.26.
- put_sync(uri, etag, content_type, in_headers, stream, stream_length, cancellable)¶
- Parameters:
uri (
str) – URI of the resource to writeetag (
strorNone) – an ETag of the resource, if it’s an existing resource, orNonecontent_type (
str) – Content-Type of the bytes to be writtenin_headers (
Soup.MessageHeadersorNone) – additionalSoup.MessageHeadersto be added to the request, orNonestream (
Gio.InputStream) – aGio.InputStreamwith data to be writtenstream_length (
int) – length of the stream, or -1 if unknowncancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_href:
optional return location for href of the resource, or
None- out_etag:
optional return location for etag of the resource, or
None- out_headers:
optional return location for response
Soup.MessageHeaders, orNone
- Return type:
(
bool, out_href:strorNone, out_etag:strorNone, out_headers:Soup.MessageHeaders)
Writes data from stream to a resource identified by uri to the server. The URI cannot reference a collection.
The etag argument is used to avoid clashes when overwriting existing resources. It can contain three values:
None- to write completely new resourceempty string - write new resource or overwrite any existing, regardless changes on the server
valid ETag - overwrite existing resource only if it wasn’t changed on the server.
Note that the actual behaviour is also influenced by
EDataServer.SourceWebdav:avoid-ifmatchproperty of the associatedEDataServer.Source.The optional in_headers can contain additional headers to be added to the request. These headers replace any existing in the request headers, without support for the list-values headers.
The out_href, if provided, is filled with the resulting URI of the written resource. It can be different from the uri when the server redirected to a different location.
The out_etag contains ETag of the resource after it had been saved.
The optional out_headers contains response headers. Free it with soup_message_headers_free(), when no longer needed.
The stream should support also
Gio.Seekableinterface, because the data send can require restart of the send due to redirect or other reasons.This method uses Transfer-Encoding:chunked, in contrast to the
EDataServer.WebDAVSession.put_data_sync(), which writes data stored in memory like any other request.New in version 3.26.
- refresh_lock_sync(uri, lock_token, lock_timeout, cancellable)¶
- Parameters:
uri (
strorNone) – URI to lock, orNoneto read fromEDataServer.Sourcelock_token (
str) – token of an existing locklock_timeout (
int) – timeout for the lock, in seconds, on 0 to infinitycancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- Return type:
Refreshes existing lock lock_token for a resource identified by uri, or, in case it’s
None, on the URI defined in associatedEDataServer.Source. The lock_token is returned fromEDataServer.WebDAVSession.lock_sync() and the uri should be the same as that used withEDataServer.WebDAVSession.lock_sync().New in version 3.26.
- replace_with_detailed_error(message, response_data, ignore_multistatus, prefix)¶
- Parameters:
message (
Soup.Message) – aSoup.Messageresponse_data (
bytesorNone) – received response data, orNoneignore_multistatus (
bool) – whether to ignore multistatus responsesprefix (
strorNone) – error message prefix, used when replacing, orNone
- Raises:
- Returns:
Whether any detailed error had been recognized.
- Return type:
Tries to read detailed error information from response_data, if not provided, then from message's response_body. If the detailed error cannot be found, then does nothing, otherwise frees the content of inout_error, if any, and then populates it with an error message prefixed with prefix.
The prefix might be of form “Failed to something”, because the resulting error message will be: “Failed to something: HTTP error code XXX (reason_phrase): detailed_error”. When prefix is
None, the error message will be: “Failed with HTTP error code XXX (reason phrase): detailed_error”.As the caller might not be interested in errors, also the inout_error can be
None, in which case the function does nothing.New in version 3.26.
- report_sync(uri, depth, xml, func, func_user_data, out_content_type, out_content, cancellable)¶
- Parameters:
uri (
strorNone) – URI to issue the request for, orNoneto read fromEDataServer.Sourcedepth (
strorNone) – requested depth, can beNone, then no Depth header is sentxml (
EDataServer.XmlDocument) – the request itself, as anEDataServer.XmlDocumentfunc (
EDataServer.WebDAVPropstatTraverseFuncorNone) – anEDataServer.WebDAVPropstatTraverseFuncfunction to call for each DAV:propstat in the multistatus response, orNoneout_content_type (
strorNone) – return location for response Content-Type, orNoneout_content (
bytesorNone) – return location for response content, orNonecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- Return type:
Issues REPORT request on the provided uri, or, in case it’s
None, on the URI defined in associatedEDataServer.Source. On success, calls func for each returned DAV:propstat.The report can result in a multistatus response, but also to raw data. In case the func is provided and the result is a multistatus response, then it is traversed using this func.
The optional out_content_type can be used to get content type of the response. Free it with
GLib.free(), when no longer needed.The optional out_content can be used to get actual result content. Free it with
GLib.ByteArray.free(), when no longer needed.New in version 3.26.
- set_acl_sync(uri, entries, cancellable)¶
- Parameters:
uri (
strorNone) – URI to issue the request for, orNoneto read fromEDataServer.Sourceentries ([
EDataServer.WebDAVAccessControlEntry]) – entries to writecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- Return type:
Changes Access Control List (ACL) for the uri, or, in case it’s
None, for the URI defined in associatedEDataServer.Source.Make sure that the entries satisfy ACL restrictions, as returned by
EDataServer.WebDAVSession.get_acl_restrictions_sync(). The order in the entries is preserved. It cannot contain anyEDataServer.WebDAVACEFlag.PROTECTED, norEDataServer.WebDAVACEFlag.INHERITED, items.Use
EDataServer.WebDAVSession.get_acl_sync() to read currently known ACL entries, remove from the list those protected and inherited, and then modify the rest with the required changed.Note this function doesn’t support general
EDataServer.WebDAVACEPrincipalKind.PROPERTYand returnsGio.IOErrorEnum.NOT_SUPPORTEDerror when any such is tried to be written.In case the returned entries contain any
EDataServer.WebDAVACEPrincipalKind.PROPERTY, or there’s a need to write such Access Control Entry, then do not useEDataServer.WebDAVSession.get_acl_sync(), neitherEDataServer.WebDAVSession.set_acl_sync(), and write more generic implementation.New in version 3.26.
- traverse_mkcalendar_response(message, xml_data, func, *func_user_data)¶
- Parameters:
message (
Soup.MessageorNone) – an optionalSoup.Messagecorresponding to the response, orNonexml_data (
bytes) – aGLib.ByteArraycontaining CALDAV:mkcalendar-response responsefunc (
EDataServer.WebDAVPropstatTraverseFunc) – anEDataServer.WebDAVPropstatTraverseFuncfunction to call for each DAV:propstat in the response
- Raises:
- Returns:
Whether succeeded.
- Return type:
Traverses a CALDAV:mkcalendar-response response and calls func for each returned DAV:propstat.
The message, if provided, is used to verify that the response is an XML Content-Type. It’s used to get the request URI as well.
New in version 3.26.
- traverse_mkcol_response(message, xml_data, func, *func_user_data)¶
- Parameters:
message (
Soup.MessageorNone) – an optionalSoup.Messagecorresponding to the response, orNonexml_data (
bytes) – aGLib.ByteArraycontaining DAV:mkcol-response responsefunc (
EDataServer.WebDAVPropstatTraverseFunc) – anEDataServer.WebDAVPropstatTraverseFuncfunction to call for each DAV:propstat in the response
- Raises:
- Returns:
Whether succeeded.
- Return type:
Traverses a DAV:mkcol-response response and calls func for each returned DAV:propstat.
The message, if provided, is used to verify that the response is an XML Content-Type. It’s used to get the request URI as well.
New in version 3.26.
- traverse_multistatus_response(message, xml_data, func, *func_user_data)¶
- Parameters:
message (
Soup.MessageorNone) – an optionalSoup.Messagecorresponding to the response, orNonexml_data (
bytes) – aGLib.ByteArraycontaining DAV:multistatus responsefunc (
EDataServer.WebDAVPropstatTraverseFunc) – anEDataServer.WebDAVPropstatTraverseFuncfunction to call for each DAV:propstat in the multistatus response
- Raises:
- Returns:
Whether succeeded.
- Return type:
Traverses a DAV:multistatus response and calls func for each returned DAV:propstat.
The message, if provided, is used to verify that the response is a multi-status and that the Content-Type is properly set. It’s used to get a request URI as well.
New in version 3.26.
- unlock_sync(uri, lock_token, cancellable)¶
- Parameters:
uri (
strorNone) – URI to lock, orNoneto read fromEDataServer.Sourcelock_token (
str) – token of an existing lockcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- Return type:
Releases (unlocks) existing lock lock_token for a resource identified by uri, or, in case it’s
None, on the URI defined in associatedEDataServer.Source. The lock_token is returned fromEDataServer.WebDAVSession.lock_sync() and the uri should be the same as that used withEDataServer.WebDAVSession.lock_sync().New in version 3.26.
- update_properties_sync(uri, changes, cancellable)¶
- Parameters:
uri (
strorNone) – URI to issue the request for, orNoneto read fromEDataServer.Sourcechanges ([
EDataServer.WebDAVPropertyChange]) – aGLib.SListwith request changescancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- Return type:
Updates properties (set/remove) on the provided uri, or, in case it’s
None, on the URI defined in associatedEDataServer.Source, with the changes. The order of changes is significant, unlike on other places.This function supports only flat properties, those not under other element. To support more complex property tries use
EDataServer.WebDAVSession.proppatch_sync() directly.New in version 3.26.