-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add all emma subscriptions endpoints #52
base: master
Are you sure you want to change the base?
Conversation
@joseph3114 can you add tests? |
Hi joseph3114, I'm checking out your PR as you seem to have implemented the Subscriptions model. Only thing I noticed is "SubscriptionImportBulk" seems to be missing. Would you be able to commit that object / source file to this pull request? Otherwise, I fixed the missing angle iron on the one tag that the CI test was complaining about on Line 22 of Methods/Subscriptions.cs: was missing it's leading angle iron: /parm>Otherwise, I also updated the two Nuget dependencies "RestSharp" and "Netwonsoft" to current versions. EDIT: Never mind, I just saw that the file is there, but wasn't in the Visual Studio project. Sorry for the confusion. I'm going to submit a pull request to your fork. SECOND EDIT: By the way, thank you for writing the Subscriptions model! I was bummed while developing a PowerShell wrapper for this and finding out that Subscriptions didn't exist. I was asked to get the Subscriptions piece working as well on my end and was pleasantly surprised when I saw your pull request. |
Updated the dependencies to the latest versions and added SubscriptionImportBulk.cs to the csproj file. Also corrected typo on line 22 of Methods/Subscriptions.cs...
@lwg-galuise Same use case on my end, my company only needed the API to manage subscriptions....the one thing this package was missing. Hope it's working! Approved the PR and put it into the master on mine. |
Updated dependecies + fixed typo + added src file
It works like a charm! Thank you! |
Added all subscription endpoints and models. Tested each in our company's Emma environment.
Usage is as follows:
Get Subscriptions:
var getallsubs = emmasharp.GetAccountSubscritpions();
Get Subscription Details:
var getasub = emmasharp.GetAccountSubscription("sub id");
Get Members of a Subscription:
var getmembersofasub = emmasharp.GetSubscriptionMembers("sub id");
Get Opted-Out Members of a Subscription:
var checkforoptout = emmasharp.GetOptOutSubscriptionMembers("sub id");
Create a New Subscription Option:
SubscriptionNew newSub = new SubscriptionNew { Name = "Test New API", Description = "This was programmatically added by the API" };
var postNewSub = emmasharp.PostNewSubscription(newSub);
Subscribe Member IDs in Bulk:
SubscriptionBulk memberIds = new SubscriptionBulk { MemberIds = new List<long> { memberid, memberid} };
var bulkmemmeers = emmasharp.PostBulkMemberSubscrpitions(memberIds, "sub id");
Update Name or Description of an Existing Subscrpition:
SubscriptionNew editSub = new SubscriptionNew{ Name = "Test New API - UPDATED", Description = "This was programmatically added by the API - UPDATED" };
var editasub = emmasharp.EditSubscrpition(editSub, "sub id");
Delete an Existing Subscrpition:
var deleteasub = emmasharp.DeleteSubscrpition("sub id");