コード例 #1
0
        /// <summary>
        /// Creates a ping. This corresponds to the
        /// pings.create Hyves method.
        /// </summary>
        /// <param name="targetUserId">The title of the ping.</param>
        /// <param name="pingTypeId"></param>
        /// <param name="body">The body of the ping.</param>
        /// <param name="visibility">The visibility of the ping.</param>
        /// <returns>The new ping; null if the call fails.</returns>
        public Ping CreatePing(string targetUserId, string pingTypeId, string body, HyvesVisibility visibility)
        {
            if (string.IsNullOrEmpty(targetUserId))
            {
                throw new ArgumentException("targetUserId cannot be null or empty.", "targetUserId");
            }

            if (string.IsNullOrEmpty(pingTypeId) && string.IsNullOrEmpty(body))
            {
                throw new ArgumentException("Please enter a ping type or a body.");
            }

            HyvesRequest request = new HyvesRequest(this.session);

            request.Parameters["target_userid"] = targetUserId;
            if (string.IsNullOrEmpty(body))
            {
                request.Parameters["pingtypeid"] = pingTypeId;
            }
            else
            {
                request.Parameters["body"] = body;
            }

            request.Parameters["visibility"] = EnumHelper.GetDescription(visibility);

            HyvesResponse response = request.InvokeMethod(HyvesMethod.PingsCreate);

            if (response.Status == HyvesResponseStatus.Succeeded)
            {
                return(response.ProcessSingleItemResponse <Ping>("ping"));
            }

            return(null);
        }
コード例 #2
0
        /// <summary>
        /// Create a gadget for the current user. This corresponds to the
        /// gadgets.create Hyves method.
        /// </summary>
        /// <param name="title">The title of the gadget.</param>
        /// <param name="html">The html of the gadget.</param>
        /// <param name="visibility">The visibility of the gadget.</param>
        /// <param name="mayCopy">Allow to copy this gadget.</param>
        /// <returns>The new gadget; null if the call fails.</returns>
        public Gadget CreateGadget(string title, string html, HyvesVisibility visibility, bool mayCopy)
        {
            if (string.IsNullOrEmpty(title))
            {
                throw new ArgumentNullException("title");
            }
            if (string.IsNullOrEmpty(html))
            {
                throw new ArgumentNullException("html");
            }

            HyvesRequest request = new HyvesRequest(this.session);

            request.Parameters["title"]      = title;
            request.Parameters["html"]       = html;
            request.Parameters["visibility"] = EnumHelper.GetDescription(visibility);
            request.Parameters["maycopy"]    = mayCopy.ToString();

            HyvesResponse response = request.InvokeMethod(HyvesMethod.GadgetsCreate);

            if (response.Status == HyvesResponseStatus.Succeeded)
            {
                return(response.ProcessSingleItemResponse <Gadget>("gadget"));
            }

            return(null);
        }
コード例 #3
0
        /// <summary>
        /// Update a blog for the current user. This corresponds to the
        /// blog.update Hyves method.
        /// </summary>
        /// <param name="title">The title of the blog.</param>
        /// <param name="body">The body of the blog.</param>
        /// <param name="visibility">The visibility of the blog.</param>
        /// <param name="latitude">Latitude of the geolocation.</param>
        /// <param name="longitude">Longitude of the geolocation. </param>
        /// <param name="responsefields">Get extra information from the blog.</param>
        /// <returns>The new blog; null if the call fails.</returns>
        public Blog UpdateBlog(string blogId, string title, string body, HyvesVisibility visibility, float?latitude, float?longitude, HyvesBlogResponsefield responsefields)
        {
            if (string.IsNullOrEmpty(blogId))
            {
                throw new ArgumentException("blogId");
            }

            if (string.IsNullOrEmpty(title))
            {
                throw new ArgumentException("title");
            }

            if (string.IsNullOrEmpty(body))
            {
                throw new ArgumentException("body");
            }

            if (visibility == HyvesVisibility.Private)
            {
                throw new ArgumentOutOfRangeException("visibility");
            }

            HyvesRequest request = new HyvesRequest(this.session);

            request.Parameters["blogid"]     = blogId;
            request.Parameters["title"]      = title;
            request.Parameters["body"]       = body;
            request.Parameters["visibility"] = EnumHelper.GetDescription(visibility);
            if (latitude.HasValue)
            {
                request.Parameters["latitude"] = latitude.Value.ToString("F");
            }

            if (longitude.HasValue)
            {
                request.Parameters["longitude"] = longitude.Value.ToString("F");
            }

            request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields);

            HyvesResponse response = request.InvokeMethod(HyvesMethod.BlogsUpdate);

            if (response.Status == HyvesResponseStatus.Succeeded)
            {
                return(response.ProcessSingleItemResponse <Blog>("blog"));
            }

            return(null);
        }
コード例 #4
0
        /// <summary>
        /// Gets the builtin albums from a user. This corresponds to the albums.getBuiltin Hyves method.
        /// </summary>
        /// <param name="visibility">The visibility of the albums.</param>
        /// <param name="responsefields">Get extra information from the requested album.</param>
        /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
        /// <returns>The information about the desired albums; null if the call fails.</returns>
        public Collection <Album> GetBuiltinAlbums(HyvesVisibility visibility, HyvesAlbumResponsefield responseFields, bool useFancyLayout)
        {
            HyvesRequest request = new HyvesRequest(this.session);

            request.Parameters["visibility"]        = EnumHelper.GetDescription(visibility);
            request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responseFields);

            HyvesResponse response = request.InvokeMethod(HyvesMethod.AlbumsGetBuiltin, useFancyLayout);

            if (response.Status == HyvesResponseStatus.Succeeded)
            {
                return(response.ProcessResponse <Album>("album"));
            }

            return(null);
        }
コード例 #5
0
        /// <summary>
        /// Creates a new album. This corresponds to the
        /// albums.create Hyves method.
        /// </summary>
        /// <param name="title">Title of the album. </param>
        /// <param name="visibility">The visibility of the album.</param>
        /// <param name="printability">The printability of the album.</param>
        /// <param name="responseFields">Get extra information from the created album.</param>
        /// <returns>True if the call succeeds, false if the call fails.</returns>
        public bool CreateAlbum(string title, HyvesVisibility visibility, HyvesVisibility printability, HyvesAlbumResponsefield responseFields)
        {
            if (string.IsNullOrEmpty(title))
            {
                throw new ArgumentNullException("title");
            }

            HyvesRequest request = new HyvesRequest(this.session);

            request.Parameters["title"]             = title;
            request.Parameters["visibility"]        = EnumHelper.GetDescription(visibility);
            request.Parameters["printability"]      = EnumHelper.GetDescription(printability);
            request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responseFields);

            HyvesResponse response = request.InvokeMethod(HyvesMethod.AlbumsCreate);

            return(response.Status == HyvesResponseStatus.Succeeded);
        }
コード例 #6
0
        /// <summary>
        /// Update the geolocation of a media. This corresponds to the
        /// media.updateGeolocation Hyves method.
        /// </summary>
        /// <param name="targetMediaId">A single gadgetid.</param>
        /// <param name="respectType">The type of the respect.</param>
        /// <returns>True if the call succeeds, false if the call fails.</returns>
        public bool UpdateGeolocation(string mediaId, HyvesVisibility visibility, float latitude, float longitude)
        {
            if (string.IsNullOrEmpty(mediaId))
            {
                throw new ArgumentNullException("mediaId");
            }

            HyvesRequest request = new HyvesRequest(this.session);

            request.Parameters["mediaid"]    = mediaId;
            request.Parameters["visibility"] = EnumHelper.GetDescription(visibility);
            request.Parameters["latitude"]   = latitude.ToString("F");
            request.Parameters["longitude"]  = longitude.ToString("F");

            HyvesResponse response = request.InvokeMethod(HyvesMethod.MediaCreateRespect);

            return(response.Status == HyvesResponseStatus.Succeeded);
        }
        /// <summary>
        /// Create a new www for the current user. This corresponds to the
        /// www.create Hyves method.
        /// </summary>
        /// <param name="emotion">The emotion of the www.</param>
        /// <param name="visibility">The visibility of the www.</param>
        /// <param name="where">The where of the www.</param>
        /// <returns>The new www; null if the call fails.</returns>
        public Www CreateWww(string emotion, HyvesVisibility visibility, string hubId, string privateSpotId, string where, float?latitude, float?longitude)
        {
            if (string.IsNullOrEmpty(emotion))
            {
                throw new ArgumentException("emotion");
            }

            HyvesRequest request = new HyvesRequest(this.session);

            request.Parameters["emotion"]    = emotion;
            request.Parameters["visibility"] = EnumHelper.GetDescription(visibility);

            if (string.IsNullOrEmpty(hubId) == false)
            {
                request.Parameters["hubid"] = hubId;
            }
            else if (string.IsNullOrEmpty(privateSpotId) == false)
            {
                request.Parameters["privatespotid"] = privateSpotId;
            }

            request.Parameters["where"] = where;

            if (latitude.HasValue)
            {
                request.Parameters["latitude"] = latitude.Value.ToString("F");
            }

            if (longitude.HasValue)
            {
                request.Parameters["longitude"] = longitude.Value.ToString("F");
            }

            request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(HyvesWwwResponsefield.All);

            HyvesResponse response = request.InvokeMethod(HyvesMethod.WwwsCreate);

            if (response.Status == HyvesResponseStatus.Succeeded)
            {
                return(response.ProcessSingleItemResponse <Www>("www"));
            }

            return(null);
        }
コード例 #8
0
        /// <summary>
        /// Create a gadget by XML (OpenSocial) for the current user. This corresponds to the
        /// gadgets.createByXML Hyves method.
        /// </summary>
        /// <param name="specUrl">Url where the gadget spec for the gadget can be found.</param>
        /// <param name="visibility">The visibility of the gadget.</param>
        /// <param name="onProfilePage">Show gadget on profilepage.</param>
        /// <param name="onHomepage">Show gadget on the homepage.</param>
        /// <returns>The new gadget; null if the call fails.</returns>
        public Gadget CreateGadget(string specUrl, HyvesVisibility visibility, bool onProfilePage, bool onHomepage)
        {
            if (string.IsNullOrEmpty(specUrl))
            {
                throw new ArgumentNullException("specUrl");
            }

            HyvesRequest request = new HyvesRequest(this.session);

            request.Parameters["specurl"]       = specUrl;
            request.Parameters["visibility"]    = EnumHelper.GetDescription(visibility);
            request.Parameters["onprofilepage"] = onProfilePage.ToString();
            request.Parameters["onhomepage"]    = onHomepage.ToString();

            HyvesResponse response = request.InvokeMethod(HyvesMethod.GadgetsCreateByXML);

            if (response.Status == HyvesResponseStatus.Succeeded)
            {
                return(response.ProcessSingleItemResponse <Gadget>("gadget"));
            }

            return(null);
        }
        private HyvesVisibility TransformPrintability()
        {
            Debug.Assert(printabilityTransformed == false);

            HyvesVisibility printability = HyvesVisibility.NotSpecified;
            string          state        = GetState <string>("printability") ?? String.Empty;

            if (state.Length != 0)
            {
                if (state.Equals("private"))
                {
                    printability = HyvesVisibility.Private;
                }
                else if (state.Equals("friend"))
                {
                    printability = HyvesVisibility.Friend;
                }
                else if (state.Equals("friends_of_friends"))
                {
                    printability = HyvesVisibility.FriendsOfFriends;
                }
                else if (state.Equals("public"))
                {
                    printability = HyvesVisibility.Public;
                }
                else if (state.Equals("superpublic"))
                {
                    printability = HyvesVisibility.SuperPublic;
                }
            }

            this["printability"]    = printability;
            printabilityTransformed = true;

            return(printability);
        }
    /// <summary>
    /// Creates a new album. This corresponds to the
    /// albums.create Hyves method.
    /// </summary>
    /// <param name="title">Title of the album. </param>
    /// <param name="visibility">The visibility of the album.</param>
    /// <param name="printability">The printability of the album.</param>
    /// <param name="responseFields">Get extra information from the created album.</param>
    /// <returns>True if the call succeeds, false if the call fails.</returns>
    public bool CreateAlbum(string title, HyvesVisibility visibility, HyvesVisibility printability, HyvesAlbumResponsefield responseFields)
    {
      if (string.IsNullOrEmpty(title))
      {
        throw new ArgumentNullException("title");
      }

      HyvesRequest request = new HyvesRequest(this.session);
      request.Parameters["title"] = title;
      request.Parameters["visibility"] = EnumHelper.GetDescription(visibility);
      request.Parameters["printability"] = EnumHelper.GetDescription(printability);
      request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responseFields);
      
      HyvesResponse response = request.InvokeMethod(HyvesMethod.AlbumsCreate);
      return response.Status == HyvesResponseStatus.Succeeded;
    }
コード例 #11
0
        /// <summary>
        /// Create a new blog for the current user. This corresponds to the
        /// blog.create Hyves method.
        /// </summary>
        /// <param name="title">The title of the blog.</param>
        /// <param name="body">The body of the blog.</param>
        /// <param name="visibility">The visibility of the blog.</param>
        /// <param name="latitude">Latitude of the geolocation.</param>
        /// <param name="longitude">Longitude of the geolocation. </param>
        /// <param name="hubIds">List of hubIds.</param>
        /// <param name="responsefields">Get extra information from the blog.</param>
        /// <returns>The new blog; null if the call fails.</returns>
        public Blog CreateBlog(string title, string body, HyvesVisibility visibility, float?latitude, float?longitude, Collection <string> hubIds, HyvesBlogResponsefield responsefields)
        {
            if (string.IsNullOrEmpty(title))
            {
                throw new ArgumentException("title");
            }

            if (string.IsNullOrEmpty(body))
            {
                throw new ArgumentException("body");
            }

            if (visibility == HyvesVisibility.Private)
            {
                throw new ArgumentOutOfRangeException("visibility");
            }

            StringBuilder hubIdBuilder = new StringBuilder();

            if (hubIds != null)
            {
                foreach (string id in hubIds)
                {
                    if (hubIdBuilder.Length != 0)
                    {
                        hubIdBuilder.Append(",");
                    }

                    hubIdBuilder.Append(id);
                }
            }

            HyvesRequest request = new HyvesRequest(this.session);

            request.Parameters["title"]      = title;
            request.Parameters["body"]       = body;
            request.Parameters["visibility"] = EnumHelper.GetDescription(visibility);
            if (latitude.HasValue)
            {
                request.Parameters["latitude"] = latitude.Value.ToString("F");
            }

            if (longitude.HasValue)
            {
                request.Parameters["longitude"] = longitude.Value.ToString("F");
            }

            if (hubIdBuilder.Length > 0)
            {
                request.Parameters["hubid"] = hubIdBuilder.ToString();
            }

            request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields);

            HyvesResponse response = request.InvokeMethod(HyvesMethod.BlogsCreate);

            if (response.Status == HyvesResponseStatus.Succeeded)
            {
                return(response.ProcessSingleItemResponse <Blog>("blog"));
            }

            return(null);
        }
コード例 #12
0
 /// <summary>
 /// Create a new blog for the current user. This corresponds to the
 /// blog.create Hyves method.
 /// </summary>
 /// <param name="title">The title of the blog.</param>
 /// <param name="body">The body of the blog.</param>
 /// <param name="visibility">The visibility of the blog.</param>
 /// <param name="responsefields">Get extra information from the blog.</param>
 /// <returns>The new blog; null if the call fails.</returns>
 public Blog CreateBlog(string title, string body, HyvesVisibility visibility, HyvesBlogResponsefield responsefields)
 {
     return(CreateBlog(title, body, visibility, null, null, null, responsefields));
 }
コード例 #13
0
 /// <summary>
 /// Create a new blog for the current user. This corresponds to the
 /// blog.create Hyves method.
 /// </summary>
 /// <param name="title">The title of the blog.</param>
 /// <param name="body">The body of the blog.</param>
 /// <param name="visibility">The visibility of the blog.</param>
 /// <returns>The new blog; null if the call fails.</returns>
 public Blog CreateBlog(string title, string body, HyvesVisibility visibility)
 {
     return(CreateBlog(title, body, visibility, HyvesBlogResponsefield.All));
 }
    /// <summary>
    /// Update the geolocation of a media. This corresponds to the
    /// media.updateGeolocation Hyves method.
    /// </summary>
    /// <param name="targetMediaId">A single gadgetid.</param>
    /// <param name="respectType">The type of the respect.</param>
    /// <returns>True if the call succeeds, false if the call fails.</returns>
    public bool UpdateGeolocation(string mediaId, HyvesVisibility visibility, float latitude, float longitude)
    {
      if (string.IsNullOrEmpty(mediaId))
      {
        throw new ArgumentNullException("mediaId");
      }

      HyvesRequest request = new HyvesRequest(this.session);
      request.Parameters["mediaid"] = mediaId;
      request.Parameters["visibility"] = EnumHelper.GetDescription(visibility);
      request.Parameters["latitude"] = latitude.ToString("F");
      request.Parameters["longitude"] = longitude.ToString("F");

      HyvesResponse response = request.InvokeMethod(HyvesMethod.MediaCreateRespect);
      return response.Status == HyvesResponseStatus.Succeeded;
    }
		/// <summary>
		/// Create a new www for the current user. This corresponds to the
		/// www.create Hyves method.
		/// </summary>
		/// <param name="emotion">The emotion of the www.</param>
		/// <param name="visibility">The visibility of the www.</param>
		/// <param name="where">The where of the www.</param>
		/// <returns>The new www; null if the call fails.</returns>
		public Www CreateWww(string emotion, HyvesVisibility visibility, string hubId, string privateSpotId, string where, float? latitude, float? longitude)
		{
			if (string.IsNullOrEmpty(emotion))
			{
				throw new ArgumentException("emotion");
			}

			HyvesRequest request = new HyvesRequest(this.session);
      request.Parameters["emotion"] = emotion;
      request.Parameters["visibility"] = EnumHelper.GetDescription(visibility);

      if (string.IsNullOrEmpty(hubId) == false)
      {
        request.Parameters["hubid"] = hubId;
      }
      else if (string.IsNullOrEmpty(privateSpotId) == false)
      {
        request.Parameters["privatespotid"] = privateSpotId;
      }

      request.Parameters["where"] = where;

      if (latitude.HasValue)
      {
        request.Parameters["latitude"] = latitude.Value.ToString("F");
      }

      if (longitude.HasValue)
      {
        request.Parameters["longitude"] = longitude.Value.ToString("F");
      }

			request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(HyvesWwwResponsefield.All);

			HyvesResponse response = request.InvokeMethod(HyvesMethod.WwwsCreate);
			if (response.Status == HyvesResponseStatus.Succeeded)
      {
        return response.ProcessSingleItemResponse<Www>("www");
			}

			return null;
		}
    /// <summary>
    /// Create a gadget by XML (OpenSocial) for the current user. This corresponds to the
    /// gadgets.createByXML Hyves method.
    /// </summary>
    /// <param name="specUrl">Url where the gadget spec for the gadget can be found.</param>
    /// <param name="visibility">The visibility of the gadget.</param>
    /// <param name="onProfilePage">Show gadget on profilepage.</param>
    /// <param name="onHomepage">Show gadget on the homepage.</param>
    /// <returns>The new gadget; null if the call fails.</returns>
    public Gadget CreateGadget(string specUrl, HyvesVisibility visibility, bool onProfilePage, bool onHomepage)
    {
      if (string.IsNullOrEmpty(specUrl))
      {
        throw new ArgumentNullException("specUrl");
      }

      HyvesRequest request = new HyvesRequest(this.session);
      request.Parameters["specurl"] = specUrl;
      request.Parameters["visibility"] = EnumHelper.GetDescription(visibility);
      request.Parameters["onprofilepage"] = onProfilePage.ToString();
      request.Parameters["onhomepage"] = onHomepage.ToString();

      HyvesResponse response = request.InvokeMethod(HyvesMethod.GadgetsCreateByXML);
      if (response.Status == HyvesResponseStatus.Succeeded)
      {
        return response.ProcessSingleItemResponse<Gadget>("gadget");
      }

      return null;
    }
    /// <summary>
    /// Creates a ping. This corresponds to the
    /// pings.createByFriend Hyves method.
    /// </summary>
    /// <param name="targetUserId">The title of the ping.</param>
    /// <param name="pingTypeId">The identifier for a ping type.</param>
    /// <param name="body">The html of the ping.</param>
    /// <param name="visibility">The visibility of the ping.</param>
    /// <returns>The new ping; null if the call fails.</returns>
    /// <remarks>Hidden method (for any partner).</remarks>
    public Ping CreatePingByFriend(string targetUserId, string pingTypeId, string body, HyvesVisibility visibility)
    {
      if (string.IsNullOrEmpty(targetUserId))
      {
        throw new ArgumentException("targetUserId cannot be null or empty.", "targetUserId");
      }

      if (string.IsNullOrEmpty(pingTypeId) && string.IsNullOrEmpty(body))
      {
        throw new ArgumentException("Please enter a ping type or a body.");
      }

      HyvesRequest request = new HyvesRequest(this.session);
      request.Parameters["target_userid"] = targetUserId;
      if (string.IsNullOrEmpty(body))
      {
        request.Parameters["pingtypeid"] = pingTypeId;
      }
      else
      {
        request.Parameters["body"] = body;
      }
      
      request.Parameters["visibility"] = EnumHelper.GetDescription(visibility);

      HyvesResponse response = request.InvokeMethod(HyvesMethod.PingsCreateByFriend);
      if (response.Status == HyvesResponseStatus.Succeeded)
      {
        return response.ProcessSingleItemResponse<Ping>("ping");
      }

      return null;
    }
		/// <summary>
		/// Create a gadget for the current user. This corresponds to the
		/// gadgets.create Hyves method.
		/// </summary>
		/// <param name="title">The title of the gadget.</param>
		/// <param name="html">The html of the gadget.</param>
		/// <param name="visibility">The visibility of the gadget.</param>
		/// <param name="mayCopy">Allow to copy this gadget.</param>
		/// <returns>The new gadget; null if the call fails.</returns>
		public Gadget CreateGadget(string title, string html, HyvesVisibility visibility, bool mayCopy)
		{
			if (string.IsNullOrEmpty(title))
			{
				throw new ArgumentNullException("title");
			}
			if (string.IsNullOrEmpty(html))
			{
				throw new ArgumentNullException("html");
			}

			HyvesRequest request = new HyvesRequest(this.session);
			request.Parameters["title"] = title;
			request.Parameters["html"] = html;
      request.Parameters["visibility"] = EnumHelper.GetDescription(visibility);
			request.Parameters["maycopy"] = mayCopy.ToString();

			HyvesResponse response = request.InvokeMethod(HyvesMethod.GadgetsCreate);
			if (response.Status == HyvesResponseStatus.Succeeded)
      {
        return response.ProcessSingleItemResponse<Gadget>("gadget");
			}

			return null;
		}
		/// <summary>
		/// Create a new blog for the current user. This corresponds to the
		/// blog.create Hyves method.
		/// </summary>
		/// <param name="title">The title of the blog.</param>
		/// <param name="body">The body of the blog.</param>
		/// <param name="visibility">The visibility of the blog.</param>
		/// <returns>The new blog; null if the call fails.</returns>
		public Blog CreateBlog(string title, string body, HyvesVisibility visibility)
		{
			return CreateBlog(title, body, visibility, HyvesBlogResponsefield.All);
		}
    /// <summary>
    /// Gets the builtin albums from a user. This corresponds to the albums.getBuiltin Hyves method.
    /// </summary>
    /// <param name="visibility">The visibility of the albums.</param>
    /// <param name="responsefields">Get extra information from the requested album.</param>
    /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
    /// <returns>The information about the desired albums; null if the call fails.</returns>
    public Collection<Album> GetBuiltinAlbums(HyvesVisibility visibility, HyvesAlbumResponsefield responseFields, bool useFancyLayout)
    {
      HyvesRequest request = new HyvesRequest(this.session);
      request.Parameters["visibility"] = EnumHelper.GetDescription(visibility);
      request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responseFields);

      HyvesResponse response = request.InvokeMethod(HyvesMethod.AlbumsGetBuiltin, useFancyLayout);
      if (response.Status == HyvesResponseStatus.Succeeded)
      {
        return response.ProcessResponse<Album>("album");
      }

      return null;
    }
    /// <summary>
    /// Update a blog for the current user. This corresponds to the
    /// blog.update Hyves method.
    /// </summary>
    /// <param name="title">The title of the blog.</param>
    /// <param name="body">The body of the blog.</param>
    /// <param name="visibility">The visibility of the blog.</param>
    /// <param name="latitude">Latitude of the geolocation.</param>
    /// <param name="longitude">Longitude of the geolocation. </param>
    /// <param name="responsefields">Get extra information from the blog.</param>
    /// <returns>The new blog; null if the call fails.</returns>
    public Blog UpdateBlog(string blogId, string title, string body, HyvesVisibility visibility, float? latitude, float? longitude, HyvesBlogResponsefield responsefields)
    {
      if (string.IsNullOrEmpty(blogId))
      {
        throw new ArgumentException("blogId");
      }

      if (string.IsNullOrEmpty(title))
      {
        throw new ArgumentException("title");
      }

      if (string.IsNullOrEmpty(body))
      {
        throw new ArgumentException("body");
      }

      if (visibility == HyvesVisibility.Private)
      {
        throw new ArgumentOutOfRangeException("visibility");
      }

      HyvesRequest request = new HyvesRequest(this.session);
      request.Parameters["blogid"] = blogId;
      request.Parameters["title"] = title;
      request.Parameters["body"] = body;
      request.Parameters["visibility"] = EnumHelper.GetDescription(visibility);
      if (latitude.HasValue)
      {
        request.Parameters["latitude"] = latitude.Value.ToString("F");
      }

      if (longitude.HasValue)
      {
        request.Parameters["longitude"] = longitude.Value.ToString("F");
      }

      request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields);

      HyvesResponse response = request.InvokeMethod(HyvesMethod.BlogsUpdate);
      if (response.Status == HyvesResponseStatus.Succeeded)
      {
        return response.ProcessSingleItemResponse<Blog>("blog");
      }

      return null;
    }
    /// <summary>
    /// Create a new blog for the current user. This corresponds to the
    /// blog.create Hyves method.
    /// </summary>
    /// <param name="title">The title of the blog.</param>
    /// <param name="body">The body of the blog.</param>
    /// <param name="visibility">The visibility of the blog.</param>
    /// <param name="latitude">Latitude of the geolocation.</param>
    /// <param name="longitude">Longitude of the geolocation. </param>
    /// <param name="hubIds">List of hubIds.</param>
    /// <param name="responsefields">Get extra information from the blog.</param>
    /// <returns>The new blog; null if the call fails.</returns>
    public Blog CreateBlog(string title, string body, HyvesVisibility visibility, float? latitude, float? longitude, Collection<string> hubIds, HyvesBlogResponsefield responsefields)
    {
			if (string.IsNullOrEmpty(title))
			{
				throw new ArgumentException("title");
			}

			if (string.IsNullOrEmpty(body))
			{
				throw new ArgumentException("body");
			}

			if (visibility == HyvesVisibility.Private)
			{
				throw new ArgumentOutOfRangeException("visibility");
			}

      StringBuilder hubIdBuilder = new StringBuilder();
      if (hubIds != null)
      {
        foreach (string id in hubIds)
        {
          if (hubIdBuilder.Length != 0)
          {
            hubIdBuilder.Append(",");
          }

          hubIdBuilder.Append(id);
        }
      }

			HyvesRequest request = new HyvesRequest(this.session);
			request.Parameters["title"] = title;
			request.Parameters["body"] = body;
      request.Parameters["visibility"] = EnumHelper.GetDescription(visibility);
      if (latitude.HasValue)
      {
        request.Parameters["latitude"] = latitude.Value.ToString("F");
      }

      if (longitude.HasValue)
      {
        request.Parameters["longitude"] = longitude.Value.ToString("F");
      }

      if (hubIdBuilder.Length > 0)
      {
        request.Parameters["hubid"] = hubIdBuilder.ToString();
      }

			request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields);

			HyvesResponse response = request.InvokeMethod(HyvesMethod.BlogsCreate);
			if (response.Status == HyvesResponseStatus.Succeeded)
      {
        return response.ProcessSingleItemResponse<Blog>("blog");
			}

			return null;
		}
		/// <summary>
		/// Create a new blog for the current user. This corresponds to the
		/// blog.create Hyves method.
		/// </summary>
		/// <param name="title">The title of the blog.</param>
		/// <param name="body">The body of the blog.</param>
		/// <param name="visibility">The visibility of the blog.</param>
		/// <param name="responsefields">Get extra information from the blog.</param>
		/// <returns>The new blog; null if the call fails.</returns>
		public Blog CreateBlog(string title, string body, HyvesVisibility visibility, HyvesBlogResponsefield responsefields)
		{
      return CreateBlog(title, body, visibility, null, null, null, responsefields);
    }