From cac899ee401af539d09323c299d99e5027278d00 Mon Sep 17 00:00:00 2001 From: Stuart Turner Date: Tue, 3 Dec 2024 10:16:11 -0600 Subject: [PATCH] Add support for `/cra/check_report/pdf/get` endpoint --- src/Plaid/Credit/CheckReportPdfGetRequest.cs | 14 ++++++++++++ src/Plaid/Credit/PlaidClient.Manual.cs | 14 ++++++++++++ .../CheckReportPdfGetRequestAddOnsEnum.cs | 22 +++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 src/Plaid/Credit/CheckReportPdfGetRequest.cs create mode 100644 src/Plaid/Credit/PlaidClient.Manual.cs create mode 100644 src/Plaid/Entity/CheckReportPdfGetRequestAddOnsEnum.cs diff --git a/src/Plaid/Credit/CheckReportPdfGetRequest.cs b/src/Plaid/Credit/CheckReportPdfGetRequest.cs new file mode 100644 index 0000000..b2c6948 --- /dev/null +++ b/src/Plaid/Credit/CheckReportPdfGetRequest.cs @@ -0,0 +1,14 @@ +namespace Going.Plaid.Credit; + +/// +/// CheckReportPdfGetRequest defines the request schema for /cra/check_report/pdf/get +/// +public partial class CheckReportPdfGetRequest : RequestBase +{ + /// + /// Use this field to include other reports in the PDF. + /// Possible values: cra_income_insights + /// + [JsonPropertyName("add_ons")] + public IReadOnlyList AddOns { get; set; } = default!; +} diff --git a/src/Plaid/Credit/PlaidClient.Manual.cs b/src/Plaid/Credit/PlaidClient.Manual.cs new file mode 100644 index 0000000..cbde16e --- /dev/null +++ b/src/Plaid/Credit/PlaidClient.Manual.cs @@ -0,0 +1,14 @@ +namespace Going.Plaid; + +public sealed partial class PlaidClient +{ + /// + /// The /cra/check_report/pdf/get 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 add-ons field. + /// The response to /asset_report/pdf/get is the PDF binary data. The request_id is returned in the Plaid-Request-ID header. + /// View a sample PDF Asset Report + /// + /// + public Task CreditCheckReportPdfGetAsync(Credit.CheckReportPdfGetRequest request) => + PostAsync("/cra/check_report/pdf/get", request) + .ParseFileResponseAsync(); +} diff --git a/src/Plaid/Entity/CheckReportPdfGetRequestAddOnsEnum.cs b/src/Plaid/Entity/CheckReportPdfGetRequestAddOnsEnum.cs new file mode 100644 index 0000000..950c1b3 --- /dev/null +++ b/src/Plaid/Entity/CheckReportPdfGetRequestAddOnsEnum.cs @@ -0,0 +1,22 @@ +namespace Going.Plaid.Entity; + +/// +/// Use this enum to specify other reports to include in the PDF. +/// Possible values: cra_income_insights +/// +public enum CheckReportPdfGetRequestAddOnsEnum +{ + + /// + /// Include Check Report Income Insights + /// + [EnumMember(Value = "cra_income_insights")] + CraIncomeInsights, + + /// + /// 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. + /// + [EnumMember(Value = "undefined")] + Undefined, + +}