Ejemplo n.º 1
0
        /// <summary>
        ///     Returns the number of unread notifications for the active user.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/notifications/get-inbox-new-count-84610 </para>
        /// </summary>
        /// <returns></returns>
        public async Task <int> GetInboxNewCount()
        {
            string  url      = "/notification/inbox/new/count";
            dynamic response = await _podio.Get <dynamic>(url);

            return((int)response["new"]);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Returns the number of other users with access to the given object.
        ///     <para>
        ///         Podio API Reference:
        ///         https://developers.podio.com/doc/reference/count-user-profiles-with-access-to-object-19190550
        ///     </para>
        /// </summary>
        /// <param name="refType"></param>
        /// <param name="refId"></param>
        /// <returns></returns>
        public async Task <int> CountUserWithAccess(string refType, int refId)
        {
            string  url      = string.Format("/reference/{0}/{1}/accessible_by/count", refType, refId);
            dynamic response = await _podio.Get <dynamic>(url);

            return((int)response["count"]);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Returns the count of grants on the given object.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/grants/count-grants-on-object-19275931 </para>
        /// </summary>
        /// <param name="refType"></param>
        /// <param name="refId"></param>
        /// <returns></returns>
        public async Task <int> CountGrantsOnObject(string refType, dynamic refId)
        {
            string  url      = string.Format("/grant/{0}/{1}/count", refType, refId);
            dynamic response = await _podio.Get <dynamic>(url);

            return((int)response["count"]);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     Returns the categories available in the system.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/app-market/get-categories-37009 </para>
        /// </summary>
        /// <param name="only_used">
        ///     If true, returns only categories that are used by shares in the active users language. If
        ///     false, all categories are returned.Default value: true
        /// </param>
        /// <returns></returns>
        public async Task <AppMarketCategory> GetCategories(bool only_used = true)
        {
            var requestData = new Dictionary <string, string>()
            {
                { "only_used", only_used.ToString() }
            };
            string url = "/app_store/category/";

            return(await _podio.Get <AppMarketCategory>(url, requestData));
        }
Ejemplo n.º 5
0
        /// <summary>
        ///     Returns the items and tasks that are related to the given app.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/calendar/get-app-calendar-22460 </para>
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="dateFrom">The date to return events from</param>
        /// <param name="dateTo">The date to search to</param>
        /// <param name="priority">The minimum priority for the events to return Default value: 1</param>
        /// <returns></returns>
        public async Task <IEnumerable <CalendarEvent> > GetAppCalendar(int appId, DateTime dateFrom, DateTime dateTo,
                                                                        int?priority = null)
        {
            string url         = string.Format("/calendar/app/{0}/", appId);
            var    requestData = new Dictionary <string, string>();

            requestData["date_from"] = dateFrom.ToString("yyyy-MM-dd");
            requestData["date_to"]   = dateTo.ToString("yyyy-MM-dd");
            if (priority.HasValue)
            {
                requestData["priority"] = priority.Value.ToString();
            }

            return(await _podio.Get <List <CalendarEvent> >(url, requestData));
        }
Ejemplo n.º 6
0
        /// <summary>
        ///     Returns the reminder for the given object.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/reminders/get-reminder-3415569 </para>
        /// </summary>
        /// <param name="refType"></param>
        /// <param name="refId"></param>
        /// <returns></returns>
        public async Task <int> GetReminder(string refType, int refId)
        {
            string  url      = string.Format("/reminder/{0}/{1}", refType, refId);
            dynamic response = await _podio.Get <dynamic>(url);

            return((int)response["remind_delta"]);
        }
Ejemplo n.º 7
0
        /// <summary>
        ///     Returns the objects that are tagged with the given text on the app. The objects are returned sorted descending by
        ///     the time the tag was added.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/tags/get-objects-on-app-with-tag-22469 </para>
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="text">The tag to search for.</param>
        /// <returns></returns>
        public async Task <List <TaggedObject> > GetObjectsOnAppWithTag(int appId, string text)
        {
            string url         = string.Format("/tag/app/{0}/search/", appId);
            var    requestData = new Dictionary <string, string>()
            {
                { "text", text }
            };

            return(await _podio.Get <List <TaggedObject> >(url, requestData));
        }
Ejemplo n.º 8
0
        /// <summary>
        ///     Get's the setting for the given client type and notification type.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/users/get-notification-setting-3649859 </para>
        /// </summary>
        /// <param name="clientType">Client type: "email" and "mobile".</param>
        /// <param name="notificationType">
        ///     Notification type: "digest", "bulletin", "reference", "message", "space",
        ///     "subscription", "user", "reminder", "push_notification", "push_notification_sound" or "push_notification_browser".
        /// </param>
        /// <returns></returns>
        public async Task <bool> GetNotificationSetting(string clientType, string notificationType)
        {
            string  url      = string.Format("/user/setting/{0}/{1}", clientType, notificationType);
            dynamic response = await _podio.Get <dynamic>(url);

            return((bool)response["value"]);
        }
Ejemplo n.º 9
0
        /// <summary>
        ///     Get the number of users who liked the given object.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/ratings/get-like-count-32161225 </para>
        /// </summary>
        /// <param name="refType"></param>
        /// <param name="refId"></param>
        /// <returns></returns>
        public async Task <int> GetLikeCount(string refType, int refId)
        {
            string  url      = string.Format("/rating/{0}/{1}/like_count", refType, refId);
            dynamic response = await _podio.Get <dynamic>(url);

            return((int)response["like_count"]);
        }
Ejemplo n.º 10
0
        /// <summary>
        ///     Returns the recurrence for the given object
        ///     <para>Podio API Reference: https://developers.podio.com/doc/recurrence/get-recurrence-3415545 </para>
        /// </summary>
        /// <param name="refType"></param>
        /// <param name="refId"></param>
        /// <returns></returns>
        public async Task <Recurrence> GetRecurrence(string refType, int refId)
        {
            string url = string.Format("/recurrence/{0}/{1}", refType, refId);

            return(await _podio.Get <Recurrence>(url));
        }
Ejemplo n.º 11
0
        /// <summary>
        ///     Gets the definition of an app and can include configuration and fields.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/applications/get-app-22349 </para>
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="type">
        ///     The type of the view of the app requested. Can be either "full", "short", "mini" or "micro". Default
        ///     value: full
        /// </param>
        /// <returns></returns>
        public async Task <Application> GetApp(int appId, string type = "full")
        {
            string url         = string.Format("/app/{0}", appId);
            var    requestData = new Dictionary <string, string>()
            {
                { "type", type }
            };

            return(await _podio.Get <Application>(url, requestData));
        }
Ejemplo n.º 12
0
        /// <summary>
        ///     Returns the active members of the given space.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/space-members/get-active-members-of-space-22395 </para>
        /// </summary>
        /// <param name="spaceId"></param>
        /// <returns></returns>
        public async Task <List <SpaceMember> > GetActiveMembersOfSpace(int spaceId)
        {
            string url = string.Format("/space/{0}/member/", spaceId);

            return(await _podio.Get <List <SpaceMember> >(url));
        }
Ejemplo n.º 13
0
        /// <summary>
        ///     Returns the task summary for the active user.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/tasks/get-task-summary-1612017 </para>
        /// </summary>
        /// <param name="limit"></param>
        /// <returns></returns>
        public async Task <TaskSummary> GetTaskSummary(int limit = 4)
        {
            string url         = "/task/summary";
            var    requestData = new Dictionary <string, string>()
            {
                { "limit", limit.ToString() }
            };

            return(await _podio.Get <TaskSummary>(url, requestData));
        }
Ejemplo n.º 14
0
        /// <summary>
        ///     Returns the action with the given id.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/actions/get-action-1701120 </para>
        /// </summary>
        /// <param name="actionId"></param>
        /// <returns></returns>
        public async Task <Action> GetAction(int actionId)
        {
            string url = string.Format("/action/{0}", actionId);

            return(await _podio.Get <Action>(url));
        }
Ejemplo n.º 15
0
        /// <summary>
        ///     Returns the subscription with the given id.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/subscriptions/get-subscription-by-id-22446 </para>
        /// </summary>
        /// <param name="subscriptionId"></param>
        /// <returns></returns>
        public async Task <Subscription> GetSubscriptionById(int subscriptionId)
        {
            string url = string.Format("/subscription/{0}", subscriptionId);

            return(await _podio.Get <Subscription>(url));
        }
Ejemplo n.º 16
0
        /// <summary>
        ///     Returns the flow with the given id.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/flows/get-flow-by-id-26312313 </para>
        /// </summary>
        /// <param name="flowId"></param>
        /// <returns></returns>
        public async Task <Flow> GetFlowById(int flowId)
        {
            string url = string.Format("/flow/{0}", flowId);

            return(await _podio.Get <Flow>(url));
        }
Ejemplo n.º 17
0
        /// <summary>
        ///     Returns the fields available from the configuration.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/integrations/get-available-fields-86890 </para>
        /// </summary>
        /// <param name="appId"></param>
        /// <returns></returns>
        public async Task <List <IntegrationAvailableAppField> > GetAvailableFields(int appId)
        {
            string url = string.Format("/integration/{0}/field/", appId);

            return(await _podio.Get <List <IntegrationAvailableAppField> >(url));
        }
Ejemplo n.º 18
0
        /// <summary>
        ///     Returns the total number of contacts for the active user.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/contacts/get-contact-totals-v3-34629208 </para>
        /// </summary>
        /// <returns></returns>
        public async Task <ContactTotal> GetContactTotals()
        {
            string url = "/contact/totals/v3/";

            return(await _podio.Get <ContactTotal>(url));
        }
Ejemplo n.º 19
0
        /// <summary>
        ///     Returns the form with the given id.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/forms/get-form-53754 </para>
        /// </summary>
        /// <param name="formId"></param>
        /// <returns></returns>
        public async Task <Form> GetForm(int formId)
        {
            string url = string.Format("/form/{0}", formId);

            return(await _podio.Get <Form>(url));
        }
Ejemplo n.º 20
0
        /// <summary>
        ///     Returns the contents of a comment. It is not possible to see where the comment was made, only the comment itself.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/comments/get-a-comment-22345 </para>
        /// </summary>
        /// <param name="commentId"></param>
        /// <returns></returns>
        public async Task <Comment> GetComment(int commentId)
        {
            string url = string.Format("/comment/{0}", commentId);

            return(await _podio.Get <Comment>(url));
        }
Ejemplo n.º 21
0
        /// <summary>
        ///     Returns the workspaces in the organization that are accesible for the active user.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/spaces/get-list-of-organization-workspaces-238875316 </para>
        /// </summary>
        /// <param name="orgId"></param>
        /// <returns></returns>
        public async Task <List <SpaceMicro> > GetOrganizationSpaces(int orgId)
        {
            string url = string.Format("/space/org/{0}/", orgId);

            return(await _podio.Get <List <SpaceMicro> >(url));
        }
Ejemplo n.º 22
0
        /// <summary>
        ///     Returns the batch with the given id.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/batch/get-batch-6144225 </para>
        /// </summary>
        /// <param name="batchId"></param>
        /// <returns></returns>
        public async Task <Batch> GetBatch(int batchId)
        {
            string url = string.Format("/batch/{0}", batchId);

            return(await _podio.Get <Batch>(url));
        }
Ejemplo n.º 23
0
        /// <summary>
        ///     Returns the file with the given id
        ///     <para>Podio API Reference: https://developers.podio.com/doc/files/get-file-22451 </para>
        /// </summary>
        /// <param name="fileId"></param>
        /// <returns></returns>
        public async Task <FileAttachment> GetFile(int fileId)
        {
            string url = string.Format("/file/{0}", fileId);

            return(await _podio.Get <FileAttachment>(url));
        }
Ejemplo n.º 24
0
        /// <summary>
        ///     Returns the global stream. The types of objects in the stream can be either "item", "status", "task", "action" or
        ///     "file". The data part of the result depends on the type of object. See area for more deatils.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/stream/get-global-stream-80012 </para>
        /// </summary>
        /// <param name="limit">How many objects should be returned. Default: 10</param>
        /// <param name="offset">How far should the objects be offset</param>
        /// <returns></returns>
        public async Task <IEnumerable <StreamObject> > GetGlobalStream(int?limit = null, int?offset = null)
        {
            string url         = "/stream/";
            var    requestData = new Dictionary <string, string>
            {
                { "limit", limit.ToStringOrNull() },
                { "offset", offset.ToStringOrNull() }
            };

            return(await _podio.Get <List <StreamObject> >(url, requestData));
        }
Ejemplo n.º 25
0
        /// <summary>
        ///     Returns the definition for the given view. The view can be either a view id, a standard view or "last" for the last
        ///     view used.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/views/get-view-27450 </para>
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="viewIdOrName"></param>
        /// <returns></returns>
        public async Task <View> GetView(int appId, string viewIdOrName)
        {
            string url = string.Format("/view/app/{0}/{1}", appId, viewIdOrName);

            return(await _podio.Get <View>(url));
        }
Ejemplo n.º 26
0
        /// <summary>
        ///     Gets the definition of an app and can include configuration and fields.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/applications/get-app-22349 </para>
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="view">
        ///     The type of the view of the app requested. Can be either "full", "short", "mini" or "micro". Default
        ///     value: full
        /// </param>
        /// <param name="fields">
        ///     This parameter can be used to include more or less content in responses than the defaults provided by Podio.
        ///     E.g. space.view(full)
        /// </param>
        /// <returns></returns>
        public async Task <Application> GetApp(int appId, string view = "full", string fields = null)
        {
            string url         = string.Format("/app/{0}", appId);
            var    requestData = new Dictionary <string, string>()
            {
                { "view", view }
            };

            if (!string.IsNullOrEmpty(fields))
            {
                requestData.Add("fields", fields);
            }

            return(await _podio.Get <Application>(url, requestData));
        }
Ejemplo n.º 27
0
        /// <summary>
        ///     Retrieves a status message by its id.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/status/get-status-message-22337 </para>
        /// </summary>
        /// <param name="statusId"></param>
        /// <returns></returns>
        public async Task <Status> GetStatusMessage(int statusId)
        {
            string url = string.Format("/status/{0}", statusId);

            return(await _podio.Get <Status>(url));
        }
Ejemplo n.º 28
0
        /// <summary>
        ///     Returns the item with the specified id.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/items/get-item-22360 </para>
        /// </summary>
        /// <param name="itemId"></param>
        /// <param name="markedAsViewed">
        ///     If true marks any new notifications on the given item as viewed, otherwise leaves any
        ///     notifications untouched, Default value true
        /// </param>
        public async Task <Item> GetItem(int itemId, bool markedAsViewed = true)
        {
            string markAsViewdValue = markedAsViewed == true ? "1" : "0";
            var    requestData      = new Dictionary <string, string>()
            {
                { "mark_as_viewed", markAsViewdValue }
            };
            string url = string.Format("/item/{0}", itemId);

            return(await _podio.Get <Item>(url, requestData));
        }
Ejemplo n.º 29
0
        /// <summary>
        ///     Returns the widget with the given id.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/widgets/get-widget-22489 </para>
        /// </summary>
        /// <param name="widgetId"></param>
        /// <returns></returns>
        public async Task <Widget> GetWidget(int widgetId)
        {
            string url = string.Format("/widget/{0}", widgetId);

            return(await _podio.Get <Widget>(url));
        }
Ejemplo n.º 30
0
        /// <summary>
        ///     Returns the import information about the given file.
        ///     <para>Podio API Reference: https://developers.podio.com/doc/importer/get-info-5929504 </para>
        /// </summary>
        /// <param name="fileId"></param>
        /// <returns></returns>
        public async Task <ImporterInfo> GetInfo(int fileId)
        {
            string url = string.Format("/importer/{0}/info", fileId);

            return(await _podio.Get <ImporterInfo>(url));
        }