Skip to content

Commit

Permalink
Add support for /cra/check_report/pdf/get endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
viceroypenguin committed Dec 3, 2024
1 parent 728a96b commit cac899e
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Plaid/Credit/CheckReportPdfGetRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Going.Plaid.Credit;

/// <summary>
/// <para>CheckReportPdfGetRequest defines the request schema for <c>/cra/check_report/pdf/get</c></para>
/// </summary>
public partial class CheckReportPdfGetRequest : RequestBase
{
/// <summary>
/// <para>Use this field to include other reports in the PDF.</para>
/// <para>Possible values: <c>cra_income_insights</c></para>
/// </summary>
[JsonPropertyName("add_ons")]
public IReadOnlyList<Entity.CheckReportPdfGetRequestAddOnsEnum> AddOns { get; set; } = default!;
}
14 changes: 14 additions & 0 deletions src/Plaid/Credit/PlaidClient.Manual.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Going.Plaid;

public sealed partial class PlaidClient
{
/// <summary>
/// <para>The <c>/cra/check_report/pdf/get</c> retrieves the most recent Consumer Report in PDF format. By default, the most recent Base Report (if it exists) for the user will be returned. To request that the most recent Income Insights report be included in the PDF as well, use the <c>add-ons</c> field.</para>
/// <para>The response to <c>/asset_report/pdf/get</c> is the PDF binary data. The <c>request_id</c> is returned in the <c>Plaid-Request-ID</c> header.</para>
/// <para><a href="https://plaid.com/documents/sample-asset-report.pdf">View a sample PDF Asset Report</a></para>
/// </summary>
/// <remarks><see href="https://plaid.com/docs/api/products/assets/#asset_reportpdfget" /></remarks>
public Task<FileResponse> CreditCheckReportPdfGetAsync(Credit.CheckReportPdfGetRequest request) =>
PostAsync("/cra/check_report/pdf/get", request)
.ParseFileResponseAsync();
}
22 changes: 22 additions & 0 deletions src/Plaid/Entity/CheckReportPdfGetRequestAddOnsEnum.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace Going.Plaid.Entity;

/// <summary>
/// <para>Use this enum to specify other reports to include in the PDF.</para>
/// <para>Possible values: <c>cra_income_insights</c></para>
/// </summary>
public enum CheckReportPdfGetRequestAddOnsEnum
{

/// <summary>
/// <para>Include Check Report Income Insights</para>
/// </summary>
[EnumMember(Value = "cra_income_insights")]
CraIncomeInsights,

/// <summary>
/// <para>Catch-all for unknown values returned by Plaid. If you encounter this, please check if there is a later version of the Going.Plaid library.</para>
/// </summary>
[EnumMember(Value = "undefined")]
Undefined,

}

0 comments on commit cac899e

Please sign in to comment.