Exemplo n.º 1
0
		/// <summary>
		/// Updates the space with the given id.
		/// <para>Podio API Reference: https://developers.podio.com/doc/spaces/update-space-22391 </para>
		/// </summary>
		/// <param name="spaceId">The space identifier.</param>
		/// <param name="name">The name of the space</param>
		/// <param name="urlLabel">The new URL label, if any changes</param>
		/// <param name="privacy">The privacy level of the space, either "open" or "closed", defaults to "closed"</param>
		/// <param name="autoJoin">True if new employees should be joined automatically, false otherwise, defaults to false</param>
		/// <param name="postOnNewApp">True if new apps should be announced with a status update, false otherwise</param>
		/// <param name="postOnNewMember">True if new members should be announced with a status update, false otherwise</param>
		/// <returns>Task.</returns>
		public async Task UpdateSpace(int spaceId, string name = null, string urlLabel = null, Space.PrivacyTypes privacy = Space.PrivacyTypes.Closed, bool? autoJoin = null, bool? postOnNewApp = null, bool? postOnNewMember = null)
        {
            string url = string.Format("/space/{0}", spaceId);
            dynamic requestData = new
            {
                name = name,
                url_label = urlLabel,
                privacy = privacy,
                auto_join = autoJoin,
                post_on_new_app = postOnNewApp,
                post_on_new_member = postOnNewMember
            };
            await _podio.PutAsync<dynamic>(url, requestData);
        }
Exemplo n.º 2
0
		/// <summary>
		/// Add a new space to an organization.
		/// <para>Podio API Reference: https://developers.podio.com/doc/spaces/create-space-22390 </para>
		/// </summary>
		/// <param name="orgId">The org identifier.</param>
		/// <param name="name">The name of the space</param>
		/// <param name="privacy">The privacy level of the space, either "open" or "closed", defaults to "closed"</param>
		/// <param name="autoJoin">True if new employees should be joined automatically, false otherwise, defaults to false</param>
		/// <param name="postOnNewApp">True if new apps should be announced with a status update, false otherwise</param>
		/// <param name="postOnNewMember">True if new members should be announced with a status update, false otherwise</param>
		/// <returns>Task&lt;System.Int32&gt;.</returns>
		public async Task<int> CreateSpace(int orgId, string name, Space.PrivacyTypes privacy = Space.PrivacyTypes.Closed, bool? autoJoin = null, bool? postOnNewApp = null, bool? postOnNewMember = null)
        {
            string url = "/space/";
            dynamic requestData = new
            {
                org_id = orgId,
                name = name,
                privacy = privacy,
                auto_join = autoJoin,
                post_on_new_app = postOnNewApp,
                post_on_new_member = postOnNewMember
            };
            dynamic respone = await _podio.PostAsync<dynamic>(url, requestData);
            return (int)respone["space_id"];
        }