/// <summary> /// Removes an album from a specified sharegroup /// </summary> /// <param name="AlbumToRemove">Album to be removed from the sharegroup</param> /// <returns></returns> public async Task<bool> RemoveAlbumAsync(Album AlbumToRemove) { CommunicationHelper ch = new CommunicationHelper(); // SessionID [required], ShareGroupID [required], AlbumID [required], Callback, Pretty, Strict var resp = await ch.ExecuteMethod<SmugMugResponse>("smugmug.sharegroups.albums.remove", basic, "ShareGroupID", id, "AlbumID", AlbumToRemove.id); if (resp.stat == "ok") { if (this.Albums != null) { // Remove the album from this sharegroup this.Albums.Remove(AlbumToRemove); // Decrease the no of albums this sharegroup has this.AlbumCount--; } return true; } else { Console.WriteLine(resp.message); throw new SmugMugException(resp.code, resp.message, resp.method); } }
/// <summary> /// Creates a new album with the specified title in the current subcategory /// </summary> /// <param name="Title"></param> /// <param name="Unique">Create an album if one of the same name doesn't already exist in the current hierarchy. Default: false </param> /// <param name="Extras">A comma seperated string of additional attributes to return in the response.</param> /// <returns>Album (id and Key)</returns> public Album CreateAlbum(string Title, bool Unique, string Extras) { Album a = new Album(); a.Title = Title; a.basic = basic; a.Category = this.Category; a.SubCategory = this; return a.Create(Unique, Extras); }
/// <summary> /// Removes an album from a specified sharegroup /// </summary> /// <param name="AlbumToRemove">Album to be removed from the sharegroup</param> /// <returns></returns> public bool RemoveAlbum(Album AlbumToRemove) { return RemoveAlbumAsync(AlbumToRemove).Result; }
/// <summary> /// Adds an album to a specified sharegroup /// </summary> /// <param name="AlbumToAdd">Album to be added to the sharegroup.</param> /// <returns></returns> public async Task<bool> AddAlbumAsync(Album AlbumToAdd) { CommunicationHelper ch = new CommunicationHelper(); // SessionID [required], ShareGroupID [required], AlbumID [required], Callback, Pretty, Strict var resp = await ch.ExecuteMethod<SmugMugResponse>("smugmug.sharegroups.albums.add", basic, "ShareGroupID", this.id, "AlbumID", AlbumToAdd.id); if (resp.stat == "ok") { if (this.Albums == null) this.Albums = new List<Album>(); // Add the album to the current object this.Albums.Add(AlbumToAdd); // Increase the no of albums this sharegroup has this.AlbumCount++; return true; } else { Console.WriteLine(resp.message); throw new SmugMugException(resp.code, resp.message, resp.method); } }
/// <summary> /// Creates a new album with the specified title in the current subcategory /// </summary> /// <param name="Title"></param> /// <param name="Unique">Create an album if one of the same name doesn't already exist in the current hierarchy. Default: false </param> /// <param name="Extras">A comma seperated string of additional attributes to return in the response.</param> /// <returns>Album (id and Key)</returns> public async Task<Album> CreateAlbumAsync(string Title, bool Unique, string Extras) { Album a = new Album(); a.Title = Title; a.basic = basic; a.Category = this.Category; a.SubCategory = this; return await a.CreateAsync(Unique, Extras); }
/// <summary> /// Adds an album to a specified sharegroup /// </summary> /// <param name="AlbumToAdd">Album to be added to the sharegroup.</param> /// <returns></returns> public bool AddAlbum(Album AlbumToAdd) { return AddAlbumAsync(AlbumToAdd).Result; }
/// <summary> /// Remove an album restriction to a coupon /// </summary> /// <param name="CouponAlbum">A specific album</param> /// <param name="Extras">A comma separated string of additional attributes to return in the response</param> public async Task<bool> RemoveRestrictionAsync(Album CouponAlbum, string Extras) { CommunicationHelper ch = new CommunicationHelper(); // SessionID [required], CouponID [required], AlbumID [required], Callback, Extras, Pretty, Strict var resp = await ch.ExecuteMethod<CouponResponse>("smugmug.coupons.restrictions.albums.remove", basic, "CouponID", this.id, "AlbumID", CouponAlbum.id, "Extras", Extras); if (resp.stat == "ok") { if (this.Restrictions != null) { if (this.Restrictions.Albums != null) this.Restrictions.Albums.Remove(CouponAlbum); } return true; } else { Console.WriteLine(resp.message); throw new SmugMugException(resp.code, resp.message, resp.method); } }
/// <summary> /// Creates a new album with the specified title in the current category /// </summary> /// <param name="Title"></param> /// <param name="Unique">Create an album if one of the same name doesn't already exist in the current hierarchy.</param> /// <param name="Extras">A comma seperated string of additional attributes to return in the response.</param> /// <returns>Album (id and Key)</returns> public Album CreateAlbum(string Title, bool Unique, string Extras) { Album a = new Album(); a.Title = Title; a.basic = basic; a.Category = this; return a.CreateAsync(Unique, Extras).Result; }
/// <summary> /// Add an album restriction to a coupon /// </summary> /// <param name="CouponAlbum">A specific album</param> public async Task<bool> AddRestrictionAsync(Album CouponAlbum) { return await AddRestrictionAsync(CouponAlbum, ""); }
/// <summary> /// Remove an album restriction to a coupon /// </summary> /// <param name="CouponAlbum">A specific album</param> public async Task<bool> RemoveRestrictionAsync(Album CouponAlbum) { return await RemoveRestrictionAsync(CouponAlbum, ""); }
/// <summary> /// Remove an album restriction to a coupon /// </summary> /// <param name="CouponAlbum">A specific album</param> /// <param name="Extras">A comma separated string of additional attributes to return in the response</param> public bool RemoveRestriction(Album CouponAlbum, string Extras) { return RemoveRestrictionAsync(CouponAlbum, Extras).Result; }
/// <summary> /// Remove an album restriction to a coupon /// </summary> /// <param name="CouponAlbum">A specific album</param> public bool RemoveRestriction(Album CouponAlbum) { return RemoveRestriction(CouponAlbum, ""); }
/// <summary> /// Add an album restriction to a coupon /// </summary> /// <param name="CouponAlbum">A specific album</param> /// <param name="Extras">A comma separated string of additional attributes to return in the response</param> public bool AddRestriction(Album CouponAlbum, string Extras) { return AddRestrictionAsync(CouponAlbum, Extras).Result; }
/// <summary> /// Add an album restriction to a coupon /// </summary> /// <param name="CouponAlbum">A specific album</param> public bool AddRestriction(Album CouponAlbum) { return AddRestriction(CouponAlbum, ""); }
/// <summary> /// Add an album restriction to a coupon /// </summary> /// <param name="CouponAlbum">A specific album</param> /// <param name="Extras">A comma separated string of additional attributes to return in the response</param> public bool AddRestriction(Album CouponAlbum, string Extras) { CommunicationHelper ch = new CommunicationHelper(); // SessionID [required], CouponID [required], AlbumID [required], Callback, Extras, Pretty, Strict var resp = ch.ExecuteMethod<CouponResponse>("smugmug.coupons.restrictions.albums.add", basic, "CouponID", this.id, "AlbumID", CouponAlbum.id, "Extras", Extras); if (resp.stat == "ok") { if (this.Restrictions == null) this.Restrictions = new Restrictions(); if (this.Restrictions.Albums == null) this.Restrictions.Albums = new List<Album>(); this.Restrictions.Albums.Add(CouponAlbum); return true; } else { Console.WriteLine(resp.message); throw new SmugMugException(resp.code, resp.message, resp.method); } }