diff --git a/HubSpot.NET/Api/EmailSubscriptions/Dto/SubscribeHubSpotModel.cs b/HubSpot.NET/Api/EmailSubscriptions/Dto/SubscribeHubSpotModel.cs index a55ee65a..02c5a3cc 100644 --- a/HubSpot.NET/Api/EmailSubscriptions/Dto/SubscribeHubSpotModel.cs +++ b/HubSpot.NET/Api/EmailSubscriptions/Dto/SubscribeHubSpotModel.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Runtime.Serialization; using HubSpot.NET.Core.Interfaces; @@ -6,17 +7,44 @@ 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 SubscriptionStatuses { get; set; } [IgnoreDataMember] - public bool IsNameValue { get; } + public bool IsNameValue => true; public void ToHubSpotDataEntity(ref dynamic dataEntity) { diff --git a/HubSpot.NET/Api/EmailSubscriptions/HubSpotEmailSubcriptionsApi.cs b/HubSpot.NET/Api/EmailSubscriptions/HubSpotEmailSubcriptionsApi.cs index 61ac321c..6283f47d 100644 --- a/HubSpot.NET/Api/EmailSubscriptions/HubSpotEmailSubcriptionsApi.cs +++ b/HubSpot.NET/Api/EmailSubscriptions/HubSpotEmailSubcriptionsApi.cs @@ -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}";