Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

joseph3114
Copy link

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");

@joseph3114 joseph3114 changed the title F subscriptions Add all emma subscriptions endpoints Feb 2, 2021
@Heanthor
Copy link

@joseph3114 can you add tests?

@lwg-galuise
Copy link

lwg-galuise commented Jun 30, 2021

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...
@joseph3114
Copy link
Author

joseph3114 commented Jul 1, 2021

@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
@lwg-galuise
Copy link

It works like a charm! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants