Skip to content

Commit

Permalink
Crankshaft[BU000005F0F23Z] .NET client @ 2018-04-26 09:37:29 UTC
Browse files Browse the repository at this point in the history
  • Loading branch information
Crankshaft Robot committed Apr 26, 2018
1 parent 150dedd commit d8cef2e
Show file tree
Hide file tree
Showing 5 changed files with 1,016 additions and 0 deletions.
10 changes: 10 additions & 0 deletions GoCardless/GoCardlessClient.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ public partial class GoCardlessClient
/// </summary>
public MandateService Mandates => new MandateService(this);

/// <summary>
///A service for working with mandate import resources.
/// </summary>
public MandateImportService MandateImports => new MandateImportService(this);

/// <summary>
///A service for working with mandate import entry resources.
/// </summary>
public MandateImportEntryService MandateImportEntries => new MandateImportEntryService(this);

/// <summary>
///A service for working with mandate pdf resources.
/// </summary>
Expand Down
141 changes: 141 additions & 0 deletions GoCardless/Resources/MandateImport.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace GoCardless.Resources
{

/// <summary>
/// Represents a mandate import resource.
///
/// Mandate Imports allow you to migrate existing mandates from other
/// providers into the
/// GoCardless platform.
///
/// The process is as follows:
///
/// 1. [Create a mandate
/// import](#mandate-imports-create-a-new-mandate-import)
/// 2. [Add entries](#mandate-import-entries-add-a-mandate-import-entry)
/// to the import
/// 3. [Submit](#mandate-imports-submit-a-mandate-import) the import
/// 4. Wait until a member of the GoCardless team approves the import, at
/// which point the mandates will be created
/// 5. [Link up the
/// mandates](#mandate-import-entries-list-all-mandate-import-entries) in
/// your system
///
/// When you add entries to your mandate import, they are not turned into
/// actual mandates
/// until the mandate import is submitted by you via the API, and then
/// processed by a member
/// of the GoCardless team. When that happens, a mandate will be created for
/// each entry in the import.
///
/// We will issue a `mandate_created` webhook for each entry, which will be
/// the same as the webhooks
/// triggered when [ creating a mandate ](#mandates-create-a-mandate) using
/// the mandates API. Once these
/// webhooks start arriving, any reconciliation can now be accomplished by
/// [checking the current status](#mandate-imports-get-a-mandate-import) of
/// the mandate import and
/// [linking up the mandates to your
/// system](#mandate-import-entries-list-all-mandate-import-entries).
///
/// <p class="notice">Note that all Mandate Imports have an upper limit of
/// 30,000 entries, so
/// we recommend you split your import into several smaller imports if
/// you're planning to
/// exceed this threshold.</p>
///
/// <p class="restricted-notice"><strong>Restricted</strong>: This API is
/// currently
/// only available for approved partners - please <a
/// href="mailto:[email protected]">get
/// in touch</a> if you would like to use this API.</p>
/// </summary>
public class MandateImport
{
/// <summary>
/// Fixed [timestamp](#api-usage-time-zones--dates), recording when this
/// resource was created.
/// </summary>
[JsonProperty("created_at")]
public DateTimeOffset? CreatedAt { get; set; }

/// <summary>
/// Unique identifier, beginning with "IM".
/// </summary>
[JsonProperty("id")]
public string Id { get; set; }

/// <summary>
/// The scheme of the mandates to be imported.<br>All mandates in a
/// single mandate
/// import must be for the same scheme.
/// </summary>
[JsonProperty("scheme")]
public string Scheme { get; set; }

/// <summary>
/// The status of the mandate import.
/// <ul>
/// <li>New mandate imports report the `created` status.</li>
/// <li>When the integrator has finished adding mandates and
/// <a href="#mandate-imports-submit-a-mandate-import">submitted</a> the
/// import, the status will report as `submitted`.</li>
/// <li>If the integrator decided to
/// <a href="#mandate-imports-cancel-a-mandate-import">cancel</a> the
/// mandate import,
/// the status will report `cancelled`.</li>
/// <li>Once a mandate import has been approved by a GoCardless team
/// member, the status will
/// initially report as `processing` (whilst the mandates are being
/// imported).</li>
/// <li>When the mandates have all been imported successfully, the
/// status will report as `processed`.</li>
/// </ul>
/// </summary>
[JsonProperty("status")]
public MandateImportStatus? Status { get; set; }
}

/// <summary>
/// The status of the mandate import.
/// <ul>
/// <li>New mandate imports report the `created` status.</li>
/// <li>When the integrator has finished adding mandates and
/// <a href="#mandate-imports-submit-a-mandate-import">submitted</a> the
/// import, the status will report as `submitted`.</li>
/// <li>If the integrator decided to
/// <a href="#mandate-imports-cancel-a-mandate-import">cancel</a> the mandate import,
/// the status will report `cancelled`.</li>
/// <li>Once a mandate import has been approved by a GoCardless team member, the status will
/// initially report as `processing` (whilst the mandates are being imported).</li>
/// <li>When the mandates have all been imported successfully, the status will report as
/// `processed`.</li>
/// </ul>
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum MandateImportStatus {

/// <summary>`status` with a value of "created"</summary>
[EnumMember(Value = "created")]
Created,
/// <summary>`status` with a value of "submitted"</summary>
[EnumMember(Value = "submitted")]
Submitted,
/// <summary>`status` with a value of "cancelled"</summary>
[EnumMember(Value = "cancelled")]
Cancelled,
/// <summary>`status` with a value of "processing"</summary>
[EnumMember(Value = "processing")]
Processing,
/// <summary>`status` with a value of "processed"</summary>
[EnumMember(Value = "processed")]
Processed,
}

}
111 changes: 111 additions & 0 deletions GoCardless/Resources/MandateImportEntry.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace GoCardless.Resources
{

/// <summary>
/// Represents a mandate import entry resource.
///
/// Mandate Import Entries are added to a [Mandate
/// Import](#core-endpoints-mandate-imports).
/// Each entry corresponds to one mandate to be imported into GoCardless.
///
/// To import a mandate you will need:
/// <ol>
/// <li>Identifying information about the customer (name/company and
/// address)</li>
/// <li>Bank account details, consisting of an account holder name and
/// either an IBAN or <a href="#appendix-local-bank-details">local bank
/// details</a></li>
/// <li>Amendment details (SEPA only)</li>
/// </ol>
///
/// We suggest you provide a `record_identifier` (which is unique within the
/// context of a
/// single mandate import) to help you to identify mandates that have been
/// created once the
/// import has been processed by GoCardless. You can
/// [list the mandate import
/// entries](#mandate-import-entries-list-all-mandate-import-entries),
/// match them up in your system using the `record_identifier`, and look at
/// the `links`
/// fields to find the mandate, customer and customer bank account that have
/// been imported.
///
/// <p class="restricted-notice"><strong>Restricted</strong>: This API is
/// currently
/// only available for approved partners - please <a
/// href="mailto:[email protected]">get
/// in touch</a> if you would like to use this API.</p>
///
/// </summary>
public class MandateImportEntry
{
/// <summary>
/// Fixed [timestamp](#api-usage-time-zones--dates), recording when this
/// resource was created.
/// </summary>
[JsonProperty("created_at")]
public DateTimeOffset? CreatedAt { get; set; }

/// <summary>
/// Resources linked to this MandateImportEntry.
/// </summary>
[JsonProperty("links")]
public MandateImportEntryLinks Links { get; set; }

/// <summary>
/// A unique identifier for this entry, which you can use (once the
/// import has been
/// processed by GoCardless) to identify the records that have been
/// created.
///
/// </summary>
[JsonProperty("record_identifier")]
public string RecordIdentifier { get; set; }
}

/// <summary>
/// Represents a mandate import entry link resource.
///
/// Related resources
/// </summary>
public class MandateImportEntryLinks
{
/// <summary>
/// The ID of the customer which was created when the mandate import was
/// processed.
/// </summary>
[JsonProperty("customer")]
public string Customer { get; set; }

/// <summary>
/// The ID of the customer bank account which was created when the
/// mandate import
/// was processed.
/// </summary>
[JsonProperty("customer_bank_account")]
public string CustomerBankAccount { get; set; }

/// <summary>
/// The ID of the mandate which was created when the mandate import was
/// processed.
/// </summary>
[JsonProperty("mandate")]
public string Mandate { get; set; }

/// <summary>
/// The ID of the mandate import. This is returned when you
/// [create a Mandate
/// Import](#mandate-imports-create-a-new-mandate-import).
///
/// </summary>
[JsonProperty("mandate_import")]
public string MandateImport { get; set; }
}

}
Loading

0 comments on commit d8cef2e

Please sign in to comment.