Skip to content

Commit

Permalink
Update to Plaid v1.503.0
Browse files Browse the repository at this point in the history
  • Loading branch information
viceroypenguin committed Mar 22, 2024
1 parent 7d7cb7f commit daf16ff
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 49 deletions.
2 changes: 1 addition & 1 deletion plaid-openapi
Submodule plaid-openapi updated 2 files
+101 −27 2020-09-14.yml
+3 −0 CHANGELOG.md
1 change: 1 addition & 0 deletions src/Plaid/Converters/WebhookBaseConverter.Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public partial class WebhookBaseConverter : JsonConverter<WebhookBase>
[(WebhookType.CraIncome, WebhookCode.Error)] = typeof(CraBankIncomeErrorWebhook),
[(WebhookType.Income, WebhookCode.BankIncomeComplete)] = typeof(BankIncomeCompleteWebhook),
[(WebhookType.CraInsights, WebhookCode.PartnerInsightsComplete)] = typeof(CraPartnerInsightsCompleteWebhook),
[(WebhookType.CraInsights, WebhookCode.PartnerInsightsError)] = typeof(CraPartnerInsightsErrorWebhook),
[(WebhookType.Income, WebhookCode.IncomeVerificationRefreshReconnectNeeded)] = typeof(IncomeVerificationRefreshReconnectNeededWebhook),
[(WebhookType.Income, WebhookCode.BankIncomeRefreshUpdate)] = typeof(BankIncomeRefreshUpdateWebhook),
[(WebhookType.Income, WebhookCode.BankIncomeRefreshComplete)] = typeof(BankIncomeRefreshCompleteWebhook),
Expand Down
32 changes: 32 additions & 0 deletions src/Plaid/Cra/BaseReportCreateRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
namespace Going.Plaid.Cra;

/// <summary>
/// <para>BaseReportCreateRequest defines the request schema for <c>/cra/base_report/create</c></para>
/// </summary>
public partial class BaseReportCreateRequest : RequestBase
{
/// <summary>
/// <para>The user token associated with the User data is being requested for.</para>
/// </summary>
[JsonPropertyName("user_token")]
public string UserToken { get; set; } = default!;

/// <summary>
/// <para>The duration of transaction history you requested</para>
/// </summary>
[JsonPropertyName("days_requested")]
public int DaysRequested { get; set; } = default!;

/// <summary>
/// <para>URL to which Plaid will send Assets webhooks, for example when the requested Asset Report is ready.</para>
/// </summary>
[JsonPropertyName("webhook")]
public string? Webhook { get; set; } = default!;

/// <summary>
/// <para>This enum describes the reason a consumer report is created for</para>
/// </summary>
[JsonPropertyName("consumer_report_permissible_purpose")]
public Entity.ConsumerReportPermissiblePurpose ConsumerReportPermissiblePurpose { get; set; } = default!;

}
8 changes: 8 additions & 0 deletions src/Plaid/Cra/BaseReportCreateResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Going.Plaid.Cra;

/// <summary>
/// <para>BaseReportCreateResponse defines the response schema for <c>cra/base_report/create</c></para>
/// </summary>
public record BaseReportCreateResponse : ResponseBase
{
}
8 changes: 8 additions & 0 deletions src/Plaid/Cra/PlaidClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ public sealed partial class PlaidClient
PostAsync("/cra/base_report/get", request)
.ParseResponseAsync<Cra.BaseReportGetResponse>();

/// <summary>
/// <para>This endpoint allows the customer to create a Base Report by passing in a user token. The Base Report will be generated based on the most recently linked item from the user token.</para>
/// </summary>
/// <remarks><see href="https://plaid.com/docs/none/" /></remarks>
public Task<Cra.BaseReportCreateResponse> CraBaseReportCreateAsync(Cra.BaseReportCreateRequest request) =>
PostAsync("/cra/base_report/create", request)
.ParseResponseAsync<Cra.BaseReportCreateResponse>();

/// <summary>
/// <para><c>/cra/bank_income/get</c> returns the bank income report(s) for a specified user.</para>
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Plaid/Entity/BaseReportAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public record BaseReportAccount
/// <para>Calculated data about the historical balances on the account. Only returned by Base Report endpoints and currently not supported by <c>brokerage</c> or <c>investment</c> accounts.</para>
/// </summary>
[JsonPropertyName("historical_balances")]
public IReadOnlyList<Entity.HistoricalBalance> HistoricalBalances { get; init; } = default!;
public IReadOnlyList<Entity.HistoricalBalance>? HistoricalBalances { get; init; } = default!;

/// <summary>
/// <para>Calculated insights derived from transaction-level data.</para>
Expand Down
32 changes: 0 additions & 32 deletions src/Plaid/Entity/CraPartnerInsightsCompleteResult.cs

This file was deleted.

8 changes: 4 additions & 4 deletions src/Plaid/Entity/LinkTokenCreateRequestAuth.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Going.Plaid.Entity;

/// <summary>
/// <para>Specifies options for initializing Link for use with the Auth product. This field can be used to enable or disable extended Auth flows for the resulting Link session. Omitting any field will result in a default that can be configured by your account manager.</para>
/// <para>Specifies options for initializing Link for use with the Auth product. This field can be used to enable or disable extended Auth flows for the resulting Link session. Omitting any field will result in a default that can be configured by your account manager. The default behavior described in the documentation is the default behavior that will apply if you have not requested your account manager to apply a different default.</para>
/// </summary>
public class LinkTokenCreateRequestAuth
{
Expand All @@ -12,7 +12,7 @@ public class LinkTokenCreateRequestAuth
public bool? AuthTypeSelectEnabled { get; set; } = default!;

/// <summary>
/// <para>Specifies whether the Link session is enabled for the Automated Micro-deposits flow.</para>
/// <para>Specifies whether the Link session is enabled for the Automated Micro-deposits flow. Default behavior is <c>false</c>.</para>
/// </summary>
[JsonPropertyName("automated_microdeposits_enabled")]
public bool? AutomatedMicrodepositsEnabled { get; set; } = default!;
Expand All @@ -24,13 +24,13 @@ public class LinkTokenCreateRequestAuth
public bool? InstantMatchEnabled { get; set; } = default!;

/// <summary>
/// <para>Specifies whether the Link session is enabled for the Same Day Micro-deposits flow.</para>
/// <para>Specifies whether the Link session is enabled for the Same Day Micro-deposits flow. Default behavior is <c>false</c>.</para>
/// </summary>
[JsonPropertyName("same_day_microdeposits_enabled")]
public bool? SameDayMicrodepositsEnabled { get; set; } = default!;

/// <summary>
/// <para>Specifies whether the Link session is enabled for the Instant Micro-deposits flow.</para>
/// <para>Specifies whether the Link session is enabled for the Instant Micro-deposits flow. Default behavior is <c>true</c>.</para>
/// </summary>
[JsonPropertyName("instant_microdeposits_enabled")]
public bool? InstantMicrodepositsEnabled { get; set; } = default!;
Expand Down
6 changes: 3 additions & 3 deletions src/Plaid/Entity/TransactionsUpdateStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ namespace Going.Plaid.Entity;
public enum TransactionsUpdateStatus
{
/// <summary>
/// <para>Error, unable to fetch transactions update state for item.</para>
/// <para>Unable to fetch transactions update status for item.</para>
/// </summary>
[EnumMember(Value = "TRANSACTIONS_UPDATE_STATE_UNKNOWN")]
TransactionsUpdateStateUnknown,
[EnumMember(Value = "TRANSACTIONS_UPDATE_STATUS_UNKNOWN")]
TransactionsUpdateStatusUnknown,

/// <summary>
/// <para>The item is pending transaction pull.</para>
Expand Down
6 changes: 6 additions & 0 deletions src/Plaid/Entity/WebhookCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,12 @@ public enum WebhookCode
[EnumMember(Value = "PARTNER_INSIGHTS_COMPLETE")]
PartnerInsightsComplete,

/// <summary>
///
/// </summary>
[EnumMember(Value = "PARTNER_INSIGHTS_ERROR")]
PartnerInsightsError,

/// <summary>
///
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Plaid/Link/LinkTokenCreateRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public partial class LinkTokenCreateRequest : RequestBase
public Entity.ConsumerReportPermissiblePurpose? ConsumerReportPermissiblePurpose { get; set; } = default!;

/// <summary>
/// <para>Specifies options for initializing Link for use with the Auth product. This field can be used to enable or disable extended Auth flows for the resulting Link session. Omitting any field will result in a default that can be configured by your account manager.</para>
/// <para>Specifies options for initializing Link for use with the Auth product. This field can be used to enable or disable extended Auth flows for the resulting Link session. Omitting any field will result in a default that can be configured by your account manager. The default behavior described in the documentation is the default behavior that will apply if you have not requested your account manager to apply a different default.</para>
/// </summary>
[JsonPropertyName("auth")]
public Entity.LinkTokenCreateRequestAuth? Auth { get; set; } = default!;
Expand Down
8 changes: 1 addition & 7 deletions src/Plaid/Webhook/CraPartnerInsightsCompleteWebhook.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Going.Plaid.Webhook;

/// <summary>
/// <para>Fired when a partner insights report has finished generating or failed to generate.</para>
/// <para>Fired when a partner insights report has finished generating and results are available</para>
/// </summary>
public record CraPartnerInsightsCompleteWebhook : WebhookBase
{
Expand All @@ -19,10 +19,4 @@ public record CraPartnerInsightsCompleteWebhook : WebhookBase
[JsonPropertyName("user_id")]
public string UserId { get; init; } = default!;

/// <summary>
/// <para>The result of the partner insights report generation</para>
/// </summary>
[JsonPropertyName("result")]
public Entity.CraPartnerInsightsCompleteResult Result { get; init; } = default!;

}
22 changes: 22 additions & 0 deletions src/Plaid/Webhook/CraPartnerInsightsErrorWebhook.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace Going.Plaid.Webhook;

/// <summary>
/// <para>Fired when a partner insights report has failed to generate</para>
/// </summary>
public record CraPartnerInsightsErrorWebhook : WebhookBase
{
/// <inheritdoc />
[JsonPropertyName("webhook_type")]
public override WebhookType WebhookType => WebhookType.CraInsights;

/// <inheritdoc />
[JsonPropertyName("webhook_code")]
public override WebhookCode WebhookCode => WebhookCode.PartnerInsightsError;

/// <summary>
/// <para>The <c>user_id</c> corresponding to the user the webhook has fired for.</para>
/// </summary>
[JsonPropertyName("user_id")]
public string UserId { get; init; } = default!;

}

0 comments on commit daf16ff

Please sign in to comment.