Skip to content

Commit

Permalink
Update to Plaid v1.406.1
Browse files Browse the repository at this point in the history
  • Loading branch information
viceroypenguin committed Aug 11, 2023
1 parent 4a69dde commit f11ed4d
Show file tree
Hide file tree
Showing 104 changed files with 2,100 additions and 101 deletions.
2 changes: 1 addition & 1 deletion plaid-openapi
Submodule plaid-openapi updated 3 files
+1,979 −75 2020-09-14.yml
+57 −2 CHANGELOG.md
+7 −1 README.md
32 changes: 32 additions & 0 deletions src/Plaid/Beacon/BeaconReportCreateRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
namespace Going.Plaid.Beacon;

/// <summary>
/// <para>Request input for creating a Beacon Report</para>
/// </summary>
public partial class BeaconReportCreateRequest : RequestBase
{
/// <summary>
/// <para>ID of the associated Beacon User.</para>
/// </summary>
[JsonPropertyName("beacon_user_id")]
public string BeaconUserId { get; set; } = default!;

/// <summary>
/// <para>The type of Beacon Report.</para>
/// </summary>
[JsonPropertyName("type")]
public Entity.BeaconReportType Type { get; set; } = default!;

/// <summary>
/// <para>A date in the format YYYY-MM-DD (RFC 3339 Section 5.6).</para>
/// </summary>
[JsonPropertyName("fraud_date")]
public DateOnly FraudDate { get; set; } = default!;

/// <summary>
/// <para>The amount and currency of the fraud or attempted fraud.</para>
/// <para><c>fraud_amount</c> should be omitted to indicate an unknown fraud amount.</para>
/// </summary>
[JsonPropertyName("fraud_amount")]
public Entity.FraudAmount? FraudAmount { get; set; } = default!;
}
53 changes: 53 additions & 0 deletions src/Plaid/Beacon/BeaconReportCreateResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
namespace Going.Plaid.Beacon;

/// <summary>
/// <para>A Beacon Report describes the type of fraud committed by a user as well as the date the fraud was committed and the total amount of money lost due to the fraud incident.</para>
/// <para>This information is used to block similar fraud attempts on your platform as well as alert other companies who screen a user with matching identity information.</para>
/// <para>Other companies will not receive any new identity information, just what matched, plus information such as industry, type of fraud, and date of fraud.</para>
/// <para>You can manage your fraud reports by adding, deleting, or editing reports as you get additional information on fraudulent users.</para>
/// </summary>
public record BeaconReportCreateResponse : ResponseBase
{
/// <summary>
/// <para>ID of the associated Beacon Report.</para>
/// </summary>
[JsonPropertyName("id")]
public string Id { get; init; } = default!;

/// <summary>
/// <para>ID of the associated Beacon User.</para>
/// </summary>
[JsonPropertyName("beacon_user_id")]
public string BeaconUserId { get; init; } = default!;

/// <summary>
/// <para>An ISO8601 formatted timestamp.</para>
/// </summary>
[JsonPropertyName("created_at")]
public DateTimeOffset CreatedAt { get; init; } = default!;

/// <summary>
/// <para>The type of Beacon Report.</para>
/// </summary>
[JsonPropertyName("type")]
public Entity.BeaconReportType Type { get; init; } = default!;

/// <summary>
/// <para>A date in the format YYYY-MM-DD (RFC 3339 Section 5.6).</para>
/// </summary>
[JsonPropertyName("fraud_date")]
public DateOnly FraudDate { get; init; } = default!;

/// <summary>
/// <para>The amount and currency of the fraud or attempted fraud.</para>
/// <para><c>fraud_amount</c> should be omitted to indicate an unknown fraud amount.</para>
/// </summary>
[JsonPropertyName("fraud_amount")]
public Entity.FraudAmount FraudAmount { get; init; } = default!;

/// <summary>
/// <para>Information about the last change made to the parent object specifying what caused the change as well as when it occurred.</para>
/// </summary>
[JsonPropertyName("audit_trail")]
public Entity.BeaconAuditTrail AuditTrail { get; init; } = default!;
}
35 changes: 35 additions & 0 deletions src/Plaid/Beacon/BeaconUserCreateRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
namespace Going.Plaid.Beacon;

/// <summary>
/// <para>Request input for creating a Beacon User.</para>
/// <para>The primary use for this endpoint is to add a new end user to Beacon for fraud and duplicate scanning.</para>
/// <para>This endpoint can also be used to import historical fraud cases into the Beacon Network without being charged</para>
/// <para>for creating a Beacon User. To import historical fraud cases, embed the fraud report in the optional <c>report</c></para>
/// <para>section of the request payload.</para>
/// </summary>
public partial class BeaconUserCreateRequest : RequestBase
{
/// <summary>
/// <para>ID of the associated Beacon Program.</para>
/// </summary>
[JsonPropertyName("program_id")]
public string ProgramId { get; set; } = default!;

/// <summary>
/// <para>A unique ID that identifies the end user in your system. This ID can also be used to associate user-specific data from other Plaid products. Financial Account Matching requires this field and the <c>/link/token/create</c> <c>client_user_id</c> to be consistent. Personally identifiable information, such as an email address or phone number, should not be used in the <c>client_user_id</c>.</para>
/// </summary>
[JsonPropertyName("client_user_id")]
public string ClientUserId { get; set; } = default!;

/// <summary>
/// <para>A Beacon User's data which is used to check against duplicate records and the Beacon Fraud Network.</para>
/// </summary>
[JsonPropertyName("user")]
public Entity.BeaconUserRequestData User { get; set; } = default!;

/// <summary>
/// <para>Data for creating a Beacon Report as part of an initial Beacon User creation. Providing a fraud report as part of an initial Beacon User creation will omit the Beacon User from any billing charges.</para>
/// </summary>
[JsonPropertyName("report")]
public Entity.BeaconUserCreateEmbeddedReport? Report { get; set; } = default!;
}
55 changes: 55 additions & 0 deletions src/Plaid/Beacon/BeaconUserCreateResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
namespace Going.Plaid.Beacon;

/// <summary>
/// <para>A Beacon User represents an end user that has been scanned against the Beacon Network.</para>
/// </summary>
public record BeaconUserCreateResponse : ResponseBase
{
/// <summary>
/// <para>ID of the associated Beacon User.</para>
/// </summary>
[JsonPropertyName("id")]
public string Id { get; init; } = default!;

/// <summary>
/// <para>An ISO8601 formatted timestamp.</para>
/// </summary>
[JsonPropertyName("created_at")]
public DateTimeOffset CreatedAt { get; init; } = default!;

/// <summary>
/// <para>An ISO8601 formatted timestamp. This field indicates the last time the resource was modified.</para>
/// </summary>
[JsonPropertyName("updated_at")]
public DateTimeOffset UpdatedAt { get; init; } = default!;

/// <summary>
/// <para>A status of a Beacon User.</para>
/// </summary>
[JsonPropertyName("status")]
public Entity.BeaconUserStatus Status { get; init; } = default!;

/// <summary>
/// <para>ID of the associated Beacon Program.</para>
/// </summary>
[JsonPropertyName("program_id")]
public string ProgramId { get; init; } = default!;

/// <summary>
/// <para>A unique ID that identifies the end user in your system. This ID can also be used to associate user-specific data from other Plaid products. Financial Account Matching requires this field and the <c>/link/token/create</c> <c>client_user_id</c> to be consistent. Personally identifiable information, such as an email address or phone number, should not be used in the <c>client_user_id</c>.</para>
/// </summary>
[JsonPropertyName("client_user_id")]
public string ClientUserId { get; init; } = default!;

/// <summary>
/// <para>A Beacon User's data and resulting analysis when checked against duplicate records and the Beacon Fraud Network.</para>
/// </summary>
[JsonPropertyName("user")]
public Entity.BeaconUserData User { get; init; } = default!;

/// <summary>
/// <para>Information about the last change made to the parent object specifying what caused the change as well as when it occurred.</para>
/// </summary>
[JsonPropertyName("audit_trail")]
public Entity.BeaconAuditTrail AuditTrail { get; init; } = default!;
}
13 changes: 13 additions & 0 deletions src/Plaid/Beacon/BeaconUserGetRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Going.Plaid.Beacon;

/// <summary>
/// <para>Request input for fetching a Beacon User</para>
/// </summary>
public partial class BeaconUserGetRequest : RequestBase
{
/// <summary>
/// <para>ID of the associated Beacon User.</para>
/// </summary>
[JsonPropertyName("beacon_user_id")]
public string BeaconUserId { get; set; } = default!;
}
55 changes: 55 additions & 0 deletions src/Plaid/Beacon/BeaconUserGetResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
namespace Going.Plaid.Beacon;

/// <summary>
/// <para>A Beacon User represents an end user that has been scanned against the Beacon Network.</para>
/// </summary>
public record BeaconUserGetResponse : ResponseBase
{
/// <summary>
/// <para>ID of the associated Beacon User.</para>
/// </summary>
[JsonPropertyName("id")]
public string Id { get; init; } = default!;

/// <summary>
/// <para>An ISO8601 formatted timestamp.</para>
/// </summary>
[JsonPropertyName("created_at")]
public DateTimeOffset CreatedAt { get; init; } = default!;

/// <summary>
/// <para>An ISO8601 formatted timestamp. This field indicates the last time the resource was modified.</para>
/// </summary>
[JsonPropertyName("updated_at")]
public DateTimeOffset UpdatedAt { get; init; } = default!;

/// <summary>
/// <para>A status of a Beacon User.</para>
/// </summary>
[JsonPropertyName("status")]
public Entity.BeaconUserStatus Status { get; init; } = default!;

/// <summary>
/// <para>ID of the associated Beacon Program.</para>
/// </summary>
[JsonPropertyName("program_id")]
public string ProgramId { get; init; } = default!;

/// <summary>
/// <para>A unique ID that identifies the end user in your system. This ID can also be used to associate user-specific data from other Plaid products. Financial Account Matching requires this field and the <c>/link/token/create</c> <c>client_user_id</c> to be consistent. Personally identifiable information, such as an email address or phone number, should not be used in the <c>client_user_id</c>.</para>
/// </summary>
[JsonPropertyName("client_user_id")]
public string ClientUserId { get; init; } = default!;

/// <summary>
/// <para>A Beacon User's data and resulting analysis when checked against duplicate records and the Beacon Fraud Network.</para>
/// </summary>
[JsonPropertyName("user")]
public Entity.BeaconUserData User { get; init; } = default!;

/// <summary>
/// <para>Information about the last change made to the parent object specifying what caused the change as well as when it occurred.</para>
/// </summary>
[JsonPropertyName("audit_trail")]
public Entity.BeaconAuditTrail AuditTrail { get; init; } = default!;
}
34 changes: 34 additions & 0 deletions src/Plaid/Beacon/PlaidClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
namespace Going.Plaid;

public sealed partial class PlaidClient
{
/// <summary>
/// <para>Create and scan a Beacon User against your Beacon Program, according to your program's settings.</para>
/// <para>When you submit a new user to <c>/beacon/user/create</c>, several checks are performed immediately:</para>
/// <para> - The user's PII (provided within the <c>user</c> object) is searched against all other users within the Beacon Program you specified. If a match is found that violates your program's "Duplicate Information Filtering" settings, the user will be returned with a status of <c>pending_review</c>.</para>
/// <para> - The user's PII is also searched against all fraud reports created by your organization across all of your Beacon Programs. If the user's data matches a fraud report that your team created, the user will be returned with a status of <c>rejected</c>.</para>
/// <para> - Finally, the user's PII is searched against all fraud report shared with the Beacon Network by other companies. If a matching fraud report is found, the user will be returned with a <c>pending_review</c> status if your program has enabled automatic flagging based on network fraud.</para>
/// </summary>
/// <remarks><see href="https://plaid.com/docs/api/products/beacon/#beaconusercreate" /></remarks>
public Task<Beacon.BeaconUserCreateResponse> BeaconUserCreateAsync(Beacon.BeaconUserCreateRequest request) =>
PostAsync("/beacon/user/create", request)
.ParseResponseAsync<Beacon.BeaconUserCreateResponse>();

/// <summary>
/// <para>Fetch a Beacon User.</para>
/// <para>The Beacon User is returned with all of their associated information and a <c>status</c> based on the Beacon Network duplicate record and fraud checks.</para>
/// </summary>
/// <remarks><see href="https://plaid.com/docs/api/products/beacon/#beaconuserget" /></remarks>
public Task<Beacon.BeaconUserGetResponse> BeaconUserGetAsync(Beacon.BeaconUserGetRequest request) =>
PostAsync("/beacon/user/get", request)
.ParseResponseAsync<Beacon.BeaconUserGetResponse>();

/// <summary>
/// <para>Create a fraud report for a given Beacon User.</para>
/// <para>Note: If you are creating users with the express purpose of providing historical fraud data, you should use the <c>/beacon/user/create</c> endpoint instead and embed the fraud report in the request. This will ensure that the Beacon User you create will not be subject to any billing costs.</para>
/// </summary>
/// <remarks><see href="https://plaid.com/docs/api/products/beacon/#beaconreportcreate" /></remarks>
public Task<Beacon.BeaconReportCreateResponse> BeaconReportCreateAsync(Beacon.BeaconReportCreateRequest request) =>
PostAsync("/beacon/report/create", request)
.ParseResponseAsync<Beacon.BeaconReportCreateResponse>();
}
2 changes: 2 additions & 0 deletions src/Plaid/Converters/WebhookBaseConverter.Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,7 @@ public partial class WebhookBaseConverter : JsonConverter<WebhookBase>
[(WebhookType.Link, WebhookCode.Events)] = typeof(LinkEventsWebhook),
[(WebhookType.Assets, WebhookCode.ProductReady)] = typeof(AssetsProductReadyWebhook),
[(WebhookType.Assets, WebhookCode.Error)] = typeof(AssetsErrorWebhook),
[(WebhookType.BaseReport, WebhookCode.ProductReady)] = typeof(BaseReportsProductReadyWebhook),
[(WebhookType.BaseReport, WebhookCode.Error)] = typeof(BaseReportsErrorWebhook),
};
}
13 changes: 13 additions & 0 deletions src/Plaid/Cra/BaseReportGetRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Going.Plaid.Cra;

/// <summary>
/// <para>BaseReportGetRequest defines the request schema for <c>/cra/base_report/get</c></para>
/// </summary>
public partial class BaseReportGetRequest : 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!;
}
13 changes: 13 additions & 0 deletions src/Plaid/Cra/BaseReportGetResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Going.Plaid.Cra;

/// <summary>
/// <para>BaseReportGetResponse defines the response schema for <c>/cra/base_report/get</c></para>
/// </summary>
public record BaseReportGetResponse : ResponseBase
{
/// <summary>
/// <para>An object representing a Base Report</para>
/// </summary>
[JsonPropertyName("report")]
public Entity.BaseReport Report { get; init; } = default!;
}
13 changes: 13 additions & 0 deletions src/Plaid/Cra/CraBankIncomeGetRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Going.Plaid.Cra;

/// <summary>
/// <para>CraBankIncomeGetRequest defines the request schema for <c>/cra/bank_income/get</c>.</para>
/// </summary>
public partial class CraBankIncomeGetRequest : 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!;
}
13 changes: 13 additions & 0 deletions src/Plaid/Cra/CraBankIncomeGetResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Going.Plaid.Cra;

/// <summary>
/// <para>CraBankIncomeGetResponse defines the response schema for <c>/cra/bank_income/get</c>.</para>
/// </summary>
public record CraBankIncomeGetResponse : ResponseBase
{
/// <summary>
///
/// </summary>
[JsonPropertyName("bank_income")]
public IReadOnlyList<Entity.CraBankIncome>? BankIncome { get; init; } = default!;
}
20 changes: 20 additions & 0 deletions src/Plaid/Cra/PlaidClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace Going.Plaid;

public sealed partial class PlaidClient
{
/// <summary>
/// <para>This endpoint allows the customer to retrieve a Base Report. Customers should pass in the <c>user_token</c> created in <c>/link/token/create</c>.</para>
/// </summary>
/// <remarks><see href="https://plaid.com/docs/none/" /></remarks>
public Task<Cra.BaseReportGetResponse> CraBaseReportGetAsync(Cra.BaseReportGetRequest request) =>
PostAsync("/cra/base_report/get", request)
.ParseResponseAsync<Cra.BaseReportGetResponse>();

/// <summary>
/// <para><c>/cra/bank_income/get</c> returns the bank income report(s) for a specified user.</para>
/// </summary>
/// <remarks><see href="https://plaid.com/docs/api/products/income/#crabank_incomeget" /></remarks>
public Task<Cra.CraBankIncomeGetResponse> CraBankIncomeGetAsync(Cra.CraBankIncomeGetRequest request) =>
PostAsync("/cra/bank_income/get", request)
.ParseResponseAsync<Cra.CraBankIncomeGetResponse>();
}
Loading

0 comments on commit f11ed4d

Please sign in to comment.