Skip to content

Commit

Permalink
Mark the legacy client, legacy resources and legacy model classes as …
Browse files Browse the repository at this point in the history
…obsolete

Resolves #537
  • Loading branch information
Jericho committed Jan 15, 2025
1 parent afd2c5f commit 6448e39
Show file tree
Hide file tree
Showing 27 changed files with 50 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/StrongGrid/ILegacyClient.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
using System;

namespace StrongGrid
{
/// <summary>
/// Interface for the SendGrid REST client for SendGrid's legacy API.
/// </summary>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public interface ILegacyClient
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/LegacyClient.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.Extensions.Logging;
using StrongGrid.Utilities;
using System;
using System.Net;
using System.Net.Http;

Expand All @@ -8,6 +9,7 @@ namespace StrongGrid
/// <summary>
/// REST client for interacting with SendGrid's legacy API.
/// </summary>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public class LegacyClient : BaseClient, ILegacyClient
{
private static readonly StrongGridClientOptions _defaultOptions = new StrongGridClientOptions()
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Models/Legacy/Campaign.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Text.Json.Serialization;

namespace StrongGrid.Models.Legacy
Expand All @@ -7,6 +8,7 @@ namespace StrongGrid.Models.Legacy
/// you will be required to provide a subject, sender ID, content (we suggest both html
/// and plain text), and at least one list or segment ID.
/// </summary>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public class Campaign
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Models/Legacy/CampaignStatus.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using StrongGrid.Json;
using System;
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

Expand All @@ -7,6 +8,7 @@ namespace StrongGrid.Models.Legacy
/// <summary>
/// Enumeration to indicate the status of a campaign.
/// </summary>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
[JsonConverter(typeof(StringEnumConverter<CampaignStatus>))]
public enum CampaignStatus
{
Expand Down
1 change: 1 addition & 0 deletions Source/StrongGrid/Models/Legacy/Contact.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace StrongGrid.Models.Legacy
/// <summary>
/// A contact (also known as a recipient).
/// </summary>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public class Contact
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Models/Legacy/CustomFieldMetadata.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Text.Json.Serialization;

namespace StrongGrid.Models.Legacy
Expand All @@ -6,6 +7,7 @@ namespace StrongGrid.Models.Legacy
/// Metadata about a custom field.
/// </summary>
/// <seealso cref="StrongGrid.Models.Legacy.FieldMetadata" />
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public class CustomFieldMetadata : FieldMetadata
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Models/Legacy/Field.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
using System.Text.Json.Serialization;

namespace StrongGrid.Models.Legacy
{
/// <summary>
/// A field.
/// </summary>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public class Field
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Models/Legacy/FieldMetadata.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
using System.Text.Json.Serialization;

namespace StrongGrid.Models.Legacy
{
/// <summary>
/// Metadata about a field.
/// </summary>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public class FieldMetadata
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Models/Legacy/ImportResult.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
using System.Text.Json.Serialization;

namespace StrongGrid.Models.Legacy
{
/// <summary>
/// The result of importing a group of contacts.
/// </summary>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public class ImportResult
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Models/Legacy/List.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
using System.Text.Json.Serialization;

namespace StrongGrid.Models.Legacy
{
/// <summary>
/// A list of contacts.
/// </summary>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public class List
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Models/Legacy/LogicalOperator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using StrongGrid.Json;
using System;
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

Expand All @@ -7,6 +8,7 @@ namespace StrongGrid.Models.Legacy
/// <summary>
/// Enumeration to indicate a logical operator.
/// </summary>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
[JsonConverter(typeof(StringEnumConverter<LogicalOperator>))]
public enum LogicalOperator
{
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Models/Legacy/SearchCondition.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
using System.Text.Json.Serialization;

namespace StrongGrid.Models.Legacy
{
/// <summary>
/// Search condition.
/// </summary>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public class SearchCondition
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Models/Legacy/Segment.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
using System.Text.Json.Serialization;

namespace StrongGrid.Models.Legacy
{
/// <summary>
/// Segment.
/// </summary>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public class Segment
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions Source/StrongGrid/Resources/Legacy/Campaigns.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace StrongGrid.Resources.Legacy
/// <remarks>
/// See <a href="https://sendgrid.com/docs/API_Reference/Web_API_v3/Marketing_Campaigns/campaigns.html">SendGrid documentation</a> for more information.
/// </remarks>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public class Campaigns : ICampaigns
{
private const string _endpoint = "campaigns";
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Resources/Legacy/Categories.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Pathoschild.Http.Client;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -12,6 +13,7 @@ namespace StrongGrid.Resources.Legacy
/// <remarks>
/// See <a href="https://sendgrid.com/docs/API_Reference/Web_API_v3/Categories/categories.html">SendGrid documentation</a> for more information.
/// </remarks>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public class Categories : ICategories
{
private const string _endpoint = "categories";
Expand Down
1 change: 1 addition & 0 deletions Source/StrongGrid/Resources/Legacy/Contacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace StrongGrid.Resources.Legacy
/// <remarks>
/// See <a href="https://sendgrid.com/docs/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.html">SendGrid documentation</a> for more information.
/// </remarks>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public class Contacts : IContacts
{
private const string _endpoint = "contactdb/recipients";
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Resources/Legacy/CustomFields.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Pathoschild.Http.Client;
using StrongGrid.Json;
using StrongGrid.Models;
using System;
using System.Threading;
using System.Threading.Tasks;

Expand All @@ -13,6 +14,7 @@ namespace StrongGrid.Resources.Legacy
/// <remarks>
/// See <a href="https://sendgrid.com/docs/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.html">SendGrid documentation</a> for more information.
/// </remarks>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public class CustomFields : ICustomFields
{
private const string _endpoint = "contactdb/custom_fields";
Expand Down
1 change: 1 addition & 0 deletions Source/StrongGrid/Resources/Legacy/ICampaigns.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace StrongGrid.Resources.Legacy
/// <remarks>
/// See <a href="https://sendgrid.com/docs/API_Reference/Web_API_v3/Marketing_Campaigns/campaigns.html">SendGrid documentation</a> for more information.
/// </remarks>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public interface ICampaigns
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Resources/Legacy/ICategories.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Threading;
using System.Threading.Tasks;

Expand All @@ -9,6 +10,7 @@ namespace StrongGrid.Resources.Legacy
/// <remarks>
/// See <a href="https://sendgrid.com/docs/API_Reference/Web_API_v3/Categories/categories.html">SendGrid documentation</a> for more information.
/// </remarks>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public interface ICategories
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Resources/Legacy/IContacts.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using StrongGrid.Models;
using StrongGrid.Utilities;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -12,6 +13,7 @@ namespace StrongGrid.Resources.Legacy
/// <remarks>
/// See <a href="https://sendgrid.com/docs/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.html">SendGrid documentation</a> for more information.
/// </remarks>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public interface IContacts
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Resources/Legacy/ICustomFields.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using StrongGrid.Models;
using System;
using System.Threading;
using System.Threading.Tasks;

Expand All @@ -10,6 +11,7 @@ namespace StrongGrid.Resources.Legacy
/// <remarks>
/// See <a href="https://sendgrid.com/docs/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.html">SendGrid documentation</a> for more information.
/// </remarks>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public interface ICustomFields
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Resources/Legacy/ILists.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -10,6 +11,7 @@ namespace StrongGrid.Resources.Legacy
/// <remarks>
/// See <a href="https://sendgrid.com/docs/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.html">SendGrid documentation</a> for more information.
/// </remarks>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public interface ILists
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Resources/Legacy/ISegments.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -10,6 +11,7 @@ namespace StrongGrid.Resources.Legacy
/// <remarks>
/// See <a href="https://sendgrid.com/docs/API_Reference/Web_API_v3/Marketing_Campaigns/campaigns.html">SendGrid documentation</a> for more information.
/// </remarks>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public interface ISegments
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Resources/Legacy/ISenderIdentities.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using StrongGrid.Models;
using StrongGrid.Utilities;
using System;
using System.Threading;
using System.Threading.Tasks;

Expand All @@ -11,6 +12,7 @@ namespace StrongGrid.Resources.Legacy
/// <remarks>
/// See <a href="https://sendgrid.com/docs/API_Reference/Web_API_v3/Marketing_Campaigns/sender_identities.html">SendGrid documentation</a> for more information.
/// </remarks>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public interface ISenderIdentities
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions Source/StrongGrid/Resources/Legacy/Lists.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace StrongGrid.Resources.Legacy
/// <remarks>
/// See <a href="https://sendgrid.com/docs/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.html">SendGrid documentation</a> for more information.
/// </remarks>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public class Lists : ILists
{
private const string _endpoint = "contactdb/lists";
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Resources/Legacy/Segments.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Pathoschild.Http.Client;
using StrongGrid.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
Expand All @@ -14,6 +15,7 @@ namespace StrongGrid.Resources.Legacy
/// <remarks>
/// See <a href="https://sendgrid.com/docs/API_Reference/Web_API_v3/Marketing_Campaigns/campaigns.html">SendGrid documentation</a> for more information.
/// </remarks>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public class Segments : ISegments
{
private const string _endpoint = "contactdb/segments";
Expand Down
2 changes: 2 additions & 0 deletions Source/StrongGrid/Resources/Legacy/SenderIdentities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using StrongGrid.Json;
using StrongGrid.Models;
using StrongGrid.Utilities;
using System;
using System.Threading;
using System.Threading.Tasks;

Expand All @@ -14,6 +15,7 @@ namespace StrongGrid.Resources.Legacy
/// <remarks>
/// See <a href="https://sendgrid.com/docs/API_Reference/Web_API_v3/Marketing_Campaigns/sender_identities.html">SendGrid documentation</a> for more information.
/// </remarks>
[Obsolete("The legacy client, legacy resources and legacy model classes are obsolete")]
public class SenderIdentities : ISenderIdentities
{
private const string _endpoint = "senders";
Expand Down

0 comments on commit 6448e39

Please sign in to comment.