Skip to content

Commit

Permalink
Correct application of portal subscription basis on email subscriptio…
Browse files Browse the repository at this point in the history
…ns and make old properties obsolete
  • Loading branch information
lakesol authored and cdmdotnet committed Feb 19, 2022
1 parent 4379b58 commit 76b7319
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
36 changes: 32 additions & 4 deletions HubSpot.NET/Api/EmailSubscriptions/Dto/SubscribeHubSpotModel.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,50 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using HubSpot.NET.Core.Interfaces;

namespace HubSpot.NET.Api.EmailSubscriptions.Dto
{
public class SubscribeHubSpotModel : IHubSpotModel
{

[DataMember(Name = "portalSubscriptionLegalBasis")]
public string SubscriptionLegalBasis { get;set; }
public string PortalSubscriptionLegalBasis { get;set; }

[DataMember(Name = "portalSubscriptionLegalBasisExplanation")]
public string SubscriptionLegalBasisExplanation { get; set; }
public string PortalSubscriptionLegalBasisExplanation { get; set; }

[IgnoreDataMember]
[Obsolete]
public string SubscriptionLegalBasis {
get
{
return PortalSubscriptionLegalBasis;
}
set
{
PortalSubscriptionLegalBasis = value;
}
}

[IgnoreDataMember]
[Obsolete]
public string SubscriptionLegalBasisExplanation {
get
{
return PortalSubscriptionLegalBasisExplanation;
}
set
{
PortalSubscriptionLegalBasisExplanation = value;
}
}

[DataMember(Name = "subscriptionStatuses")]
public List<SubscribeStatusHubSpotModel> SubscriptionStatuses { get; set; }

[IgnoreDataMember]
public bool IsNameValue { get; }
public bool IsNameValue => true;

public void ToHubSpotDataEntity(ref dynamic dataEntity)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ public void SubscribeTo(string email, long id, string basis, string basisExplana
};
if (setPortalSubscriptionBasis)
{
model.SubscriptionLegalBasis = basis;
model.SubscriptionLegalBasisExplanation = basisExplanation;
model.PortalSubscriptionLegalBasis = basis;
model.PortalSubscriptionLegalBasisExplanation = basisExplanation;
}

var path = $"{model.RouteBasePath}/{email}";
Expand Down

0 comments on commit 76b7319

Please sign in to comment.