Skip to content

Commit

Permalink
Expose newer methods to Python
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 2, 2021
1 parent 61519ec commit 33a7bc7
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 45 deletions.
Expand Up @@ -32,8 +32,24 @@ Utility functions for working with ArcGIS REST services.
ImageService,
};

static QVariantMap retrieveUserInfo( const QString &communityUrl, const QString &user, const QString &authcfg, QString &errorTitle /Out/, QString &errorText /Out/, const QgsHttpHeaders &requestHeaders = QgsHttpHeaders(), QgsFeedback *feedback = 0 );
%Docstring
Retrieves JSON user info for the specified user name.

If ``user`` is blank then the user associated with the current logon details will be retrieved

:param communityUrl: should be set to the Portal's community URL, e.g. https://mysite.com/portal/sharing/rest/community
:param user: username to query, or an empty string to query the current user
:param authcfg: authentication configuration ID
:param requestHeaders: optional additional request headers
:param feedback: optional feedback argument for cancellation support

:return: - JSON user info
- errorTitle: title summary of any encountered errors
- errorText: error text of any encountered errors
%End

static QVariantMap retrieveUserInfo( const QString &communityUrl, const QString &user, const QString &authcfg, QString &errorTitle /Out/, QString &errorText /Out/, const QMap< QString, QVariant > &requestHeaders = QMap< QString, QVariant >(), QgsFeedback *feedback = 0 );
static QVariantMap retrieveUserInfo( const QString &communityUrl, const QString &user, const QString &authcfg, QString &errorTitle /Out/, QString &errorText /Out/, const QMap< QString, QVariant > &requestHeaders, QgsFeedback *feedback = 0 );
%Docstring
Retrieves JSON user info for the specified user name. Only to avoid API break.

Expand All @@ -50,7 +66,24 @@ If ``user`` is blank then the user associated with the current logon details wil
- errorText: error text of any encountered errors
%End

static QVariantList retrieveUserGroups( const QString &communityUrl, const QString &user, const QString &authcfg, QString &errorTitle /Out/, QString &errorText /Out/, const QMap< QString, QVariant > &requestHeaders = QMap< QString, QVariant >(), QgsFeedback *feedback = 0 );
static QVariantList retrieveUserGroups( const QString &communityUrl, const QString &user, const QString &authcfg, QString &errorTitle /Out/, QString &errorText /Out/, const QgsHttpHeaders &requestHeaders = QgsHttpHeaders(), QgsFeedback *feedback = 0 );
%Docstring
Retrieves JSON definitions for all groups which the specified user name is a member of.

If ``user`` is blank then the user associated with the current logon details will be retrieved

:param communityUrl: should be set to the Portal's community URL, e.g. https://mysite.com/portal/sharing/rest/community
:param user: username to query, or an empty string to query the current user
:param authcfg: authentication configuration ID
:param requestHeaders: optional additional request headers
:param feedback: optional feedback argument for cancellation support

:return: - a list of JSON group info
- errorTitle: title summary of any encountered errors
- errorText: error text of any encountered errors
%End

static QVariantList retrieveUserGroups( const QString &communityUrl, const QString &user, const QString &authcfg, QString &errorTitle /Out/, QString &errorText /Out/, const QMap< QString, QVariant > &requestHeaders, QgsFeedback *feedback = 0 );
%Docstring
Retrieves JSON definitions for all groups which the specified user name is a member of. Only to avoid API break.

Expand All @@ -67,7 +100,23 @@ If ``user`` is blank then the user associated with the current logon details wil
- errorText: error text of any encountered errors
%End

static QVariantList retrieveGroupContent( const QString &contentUrl, const QString &groupId, const QString &authcfg, QString &errorTitle /Out/, QString &errorText /Out/, const QMap< QString, QVariant > &requestHeaders = QMap< QString, QVariant >(), QgsFeedback *feedback = 0, int pageSize = 100 );
static QVariantList retrieveGroupContent( const QString &contentUrl, const QString &groupId, const QString &authcfg, QString &errorTitle /Out/, QString &errorText /Out/, const QgsHttpHeaders &requestHeaders = QgsHttpHeaders(), QgsFeedback *feedback = 0, int pageSize = 100 );
%Docstring
Retrieves JSON definitions for all items which belong the the specified ``groupId``.

:param contentUrl: should be set to the Portal's content URL, e.g. https://mysite.com/portal/sharing/rest/content
:param groupId: ID of group to query
:param authcfg: authentication configuration ID
:param requestHeaders: optional additional request headers
:param feedback: optional feedback argument for cancellation support
:param pageSize: number of results to retrieve for each request. Maximum value is 100.

:return: - a list of JSON item info for all items within the group
- errorTitle: title summary of any encountered errors
- errorText: error text of any encountered errors
%End

static QVariantList retrieveGroupContent( const QString &contentUrl, const QString &groupId, const QString &authcfg, QString &errorTitle /Out/, QString &errorText /Out/, const QMap< QString, QVariant > &requestHeaders, QgsFeedback *feedback = 0, int pageSize = 100 );
%Docstring
Retrieves JSON definitions for all items which belong the the specified ``groupId``. Only to avoid API break.

Expand All @@ -85,9 +134,9 @@ Retrieves JSON definitions for all items which belong the the specified ``groupI

static QVariantList retrieveGroupItemsOfType( const QString &contentUrl, const QString &groupId, const QString &authcfg,
const QList< int > &itemTypes,
QString &errorTitle /Out/, QString &errorText /Out/, const QMap< QString, QVariant > &requestHeaders = QMap< QString, QVariant >(), QgsFeedback *feedback = 0, int pageSize = 100 );
QString &errorTitle /Out/, QString &errorText /Out/, const QgsHttpHeaders &requestHeaders = QgsHttpHeaders(), QgsFeedback *feedback = 0, int pageSize = 100 );
%Docstring
Retrieves JSON definitions for all items which belong the the specified ``groupId``. Only to avoid API break.
Retrieves JSON definitions for all items which belong the the specified ``groupId``.

:param contentUrl: should be set to the Portal's content URL, e.g. https://mysite.com/portal/sharing/rest/content
:param groupId: ID of group to query
Expand All @@ -102,6 +151,24 @@ Retrieves JSON definitions for all items which belong the the specified ``groupI
- errorText: error text of any encountered errors
%End

static QVariantList retrieveGroupItemsOfType( const QString &contentUrl, const QString &groupId, const QString &authcfg,
const QList< int > &itemTypes,
QString &errorTitle /Out/, QString &errorText /Out/, const QMap< QString, QVariant > &requestHeaders, QgsFeedback *feedback = 0, int pageSize = 100 );
%Docstring
Retrieves JSON definitions for all items which belong the the specified ``groupId``. Only to avoid API break.

:param contentUrl: should be set to the Portal's content URL, e.g. https://mysite.com/portal/sharing/rest/content
:param groupId: ID of group to query
:param authcfg: authentication configuration ID
:param itemTypes: list of desired item types (using QgsArcGisPortalUtils.ItemType values)
:param requestHeaders: optional additional request headers
:param feedback: optional feedback argument for cancellation support
:param pageSize: number of results to retrieve for each request. Maximum value is 100.

:return: - a list of JSON item info for all items within the group
- errorTitle: title summary of any encountered errors
- errorText: error text of any encountered errors
%End

};

Expand Down
75 changes: 35 additions & 40 deletions src/core/providers/arcgis/qgsarcgisportalutils.h
Expand Up @@ -47,8 +47,6 @@ class CORE_EXPORT QgsArcGisPortalUtils
ImageService, //!< ArcGIS Server image service
};

#ifndef SIP_RUN

/**
* Retrieves JSON user info for the specified user name.
*
Expand All @@ -67,7 +65,7 @@ class CORE_EXPORT QgsArcGisPortalUtils
static QVariantMap retrieveUserInfo( const QString &communityUrl, const QString &user, const QString &authcfg, QString &errorTitle SIP_OUT, QString &errorText SIP_OUT, const QgsHttpHeaders &requestHeaders = QgsHttpHeaders(), QgsFeedback *feedback = nullptr );

/**
* Retrieves JSON definitions for all groups which the specified user name is a member of.
* Retrieves JSON user info for the specified user name. Only to avoid API break.
*
* If \a user is blank then the user associated with the current logon details will be retrieved
*
Expand All @@ -79,87 +77,83 @@ class CORE_EXPORT QgsArcGisPortalUtils
* \param requestHeaders optional additional request headers
* \param feedback optional feedback argument for cancellation support
*
* \returns a list of JSON group info
* \returns JSON user info
*/
static QVariantList retrieveUserGroups( const QString &communityUrl, const QString &user, const QString &authcfg, QString &errorTitle SIP_OUT, QString &errorText SIP_OUT, const QgsHttpHeaders &requestHeaders = QgsHttpHeaders(), QgsFeedback *feedback = nullptr );
static QVariantMap retrieveUserInfo( const QString &communityUrl, const QString &user, const QString &authcfg, QString &errorTitle SIP_OUT, QString &errorText SIP_OUT, const QMap< QString, QVariant > &requestHeaders, QgsFeedback *feedback = nullptr );

/**
* Retrieves JSON definitions for all items which belong the the specified \a groupId.
* Retrieves JSON definitions for all groups which the specified user name is a member of.
*
* \param contentUrl should be set to the Portal's content URL, e.g. https://mysite.com/portal/sharing/rest/content/
* \param groupId ID of group to query
* If \a user is blank then the user associated with the current logon details will be retrieved
*
* \param communityUrl should be set to the Portal's community URL, e.g. https://mysite.com/portal/sharing/rest/community/
* \param user username to query, or an empty string to query the current user
* \param authcfg authentication configuration ID
* \param errorTitle title summary of any encountered errors
* \param errorText error text of any encountered errors
* \param requestHeaders optional additional request headers
* \param feedback optional feedback argument for cancellation support
* \param pageSize number of results to retrieve for each request. Maximum value is 100.
*
* \returns a list of JSON item info for all items within the group
* \returns a list of JSON group info
*/
static QVariantList retrieveGroupContent( const QString &contentUrl, const QString &groupId, const QString &authcfg, QString &errorTitle SIP_OUT, QString &errorText SIP_OUT, const QgsHttpHeaders &requestHeaders = QgsHttpHeaders(), QgsFeedback *feedback = nullptr, int pageSize = 100 );
static QVariantList retrieveUserGroups( const QString &communityUrl, const QString &user, const QString &authcfg, QString &errorTitle SIP_OUT, QString &errorText SIP_OUT, const QgsHttpHeaders &requestHeaders = QgsHttpHeaders(), QgsFeedback *feedback = nullptr );

/**
* Retrieves JSON definitions for all items which belong the the specified \a groupId.
* Retrieves JSON definitions for all groups which the specified user name is a member of. Only to avoid API break.
*
* \param contentUrl should be set to the Portal's content URL, e.g. https://mysite.com/portal/sharing/rest/content/
* \param groupId ID of group to query
* If \a user is blank then the user associated with the current logon details will be retrieved
*
* \param communityUrl should be set to the Portal's community URL, e.g. https://mysite.com/portal/sharing/rest/community/
* \param user username to query, or an empty string to query the current user
* \param authcfg authentication configuration ID
* \param itemTypes list of desired item types (using QgsArcGisPortalUtils.ItemType values)
* \param errorTitle title summary of any encountered errors
* \param errorText error text of any encountered errors
* \param requestHeaders optional additional request headers
* \param feedback optional feedback argument for cancellation support
* \param pageSize number of results to retrieve for each request. Maximum value is 100.
*
* \returns a list of JSON item info for all items within the group
* \returns a list of JSON group info
*/
static QVariantList retrieveGroupItemsOfType( const QString &contentUrl, const QString &groupId, const QString &authcfg,
const QList< int > &itemTypes,
QString &errorTitle SIP_OUT, QString &errorText SIP_OUT, const QgsHttpHeaders &requestHeaders = QgsHttpHeaders(), QgsFeedback *feedback = nullptr, int pageSize = 100 );

#endif
static QVariantList retrieveUserGroups( const QString &communityUrl, const QString &user, const QString &authcfg, QString &errorTitle SIP_OUT, QString &errorText SIP_OUT, const QMap< QString, QVariant > &requestHeaders, QgsFeedback *feedback = nullptr );

/**
* Retrieves JSON user info for the specified user name. Only to avoid API break.
*
* If \a user is blank then the user associated with the current logon details will be retrieved
* Retrieves JSON definitions for all items which belong the the specified \a groupId.
*
* \param communityUrl should be set to the Portal's community URL, e.g. https://mysite.com/portal/sharing/rest/community/
* \param user username to query, or an empty string to query the current user
* \param contentUrl should be set to the Portal's content URL, e.g. https://mysite.com/portal/sharing/rest/content/
* \param groupId ID of group to query
* \param authcfg authentication configuration ID
* \param errorTitle title summary of any encountered errors
* \param errorText error text of any encountered errors
* \param requestHeaders optional additional request headers
* \param feedback optional feedback argument for cancellation support
* \param pageSize number of results to retrieve for each request. Maximum value is 100.
*
* \returns JSON user info
* \returns a list of JSON item info for all items within the group
*/
static QVariantMap retrieveUserInfo( const QString &communityUrl, const QString &user, const QString &authcfg, QString &errorTitle SIP_OUT, QString &errorText SIP_OUT, const QMap< QString, QVariant > &requestHeaders = QMap< QString, QVariant >(), QgsFeedback *feedback = nullptr );
static QVariantList retrieveGroupContent( const QString &contentUrl, const QString &groupId, const QString &authcfg, QString &errorTitle SIP_OUT, QString &errorText SIP_OUT, const QgsHttpHeaders &requestHeaders = QgsHttpHeaders(), QgsFeedback *feedback = nullptr, int pageSize = 100 );

/**
* Retrieves JSON definitions for all groups which the specified user name is a member of. Only to avoid API break.
*
* If \a user is blank then the user associated with the current logon details will be retrieved
* Retrieves JSON definitions for all items which belong the the specified \a groupId. Only to avoid API break.
*
* \param communityUrl should be set to the Portal's community URL, e.g. https://mysite.com/portal/sharing/rest/community/
* \param user username to query, or an empty string to query the current user
* \param contentUrl should be set to the Portal's content URL, e.g. https://mysite.com/portal/sharing/rest/content/
* \param groupId ID of group to query
* \param authcfg authentication configuration ID
* \param errorTitle title summary of any encountered errors
* \param errorText error text of any encountered errors
* \param requestHeaders optional additional request headers
* \param feedback optional feedback argument for cancellation support
* \param pageSize number of results to retrieve for each request. Maximum value is 100.
*
* \returns a list of JSON group info
* \returns a list of JSON item info for all items within the group
*/
static QVariantList retrieveUserGroups( const QString &communityUrl, const QString &user, const QString &authcfg, QString &errorTitle SIP_OUT, QString &errorText SIP_OUT, const QMap< QString, QVariant > &requestHeaders = QMap< QString, QVariant >(), QgsFeedback *feedback = nullptr );
static QVariantList retrieveGroupContent( const QString &contentUrl, const QString &groupId, const QString &authcfg, QString &errorTitle SIP_OUT, QString &errorText SIP_OUT, const QMap< QString, QVariant > &requestHeaders, QgsFeedback *feedback = nullptr, int pageSize = 100 );

/**
* Retrieves JSON definitions for all items which belong the the specified \a groupId. Only to avoid API break.
* Retrieves JSON definitions for all items which belong the the specified \a groupId.
*
* \param contentUrl should be set to the Portal's content URL, e.g. https://mysite.com/portal/sharing/rest/content/
* \param groupId ID of group to query
* \param authcfg authentication configuration ID
* \param itemTypes list of desired item types (using QgsArcGisPortalUtils.ItemType values)
* \param errorTitle title summary of any encountered errors
* \param errorText error text of any encountered errors
* \param requestHeaders optional additional request headers
Expand All @@ -168,7 +162,9 @@ class CORE_EXPORT QgsArcGisPortalUtils
*
* \returns a list of JSON item info for all items within the group
*/
static QVariantList retrieveGroupContent( const QString &contentUrl, const QString &groupId, const QString &authcfg, QString &errorTitle SIP_OUT, QString &errorText SIP_OUT, const QMap< QString, QVariant > &requestHeaders = QMap< QString, QVariant >(), QgsFeedback *feedback = nullptr, int pageSize = 100 );
static QVariantList retrieveGroupItemsOfType( const QString &contentUrl, const QString &groupId, const QString &authcfg,
const QList< int > &itemTypes,
QString &errorTitle SIP_OUT, QString &errorText SIP_OUT, const QgsHttpHeaders &requestHeaders = QgsHttpHeaders(), QgsFeedback *feedback = nullptr, int pageSize = 100 );

/**
* Retrieves JSON definitions for all items which belong the the specified \a groupId. Only to avoid API break.
Expand All @@ -187,8 +183,7 @@ class CORE_EXPORT QgsArcGisPortalUtils
*/
static QVariantList retrieveGroupItemsOfType( const QString &contentUrl, const QString &groupId, const QString &authcfg,
const QList< int > &itemTypes,
QString &errorTitle SIP_OUT, QString &errorText SIP_OUT, const QMap< QString, QVariant > &requestHeaders = QMap< QString, QVariant >(), QgsFeedback *feedback = nullptr, int pageSize = 100 );

QString &errorTitle SIP_OUT, QString &errorText SIP_OUT, const QMap< QString, QVariant > &requestHeaders, QgsFeedback *feedback = nullptr, int pageSize = 100 );

private:

Expand Down

0 comments on commit 33a7bc7

Please sign in to comment.