-
Notifications
You must be signed in to change notification settings - Fork 356
/
AccountLink.java
83 lines (74 loc) · 2.96 KB
/
AccountLink.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// File generated from our OpenAPI spec
package com.stripe.model;
import com.google.gson.annotations.SerializedName;
import com.stripe.Stripe;
import com.stripe.exception.StripeException;
import com.stripe.net.ApiResource;
import com.stripe.net.RequestOptions;
import com.stripe.param.AccountLinkCreateParams;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
/**
* Account Links are the means by which a Connect platform grants a connected account permission to
* access Stripe-hosted applications, such as Connect Onboarding.
*
* <p>Related guide: <a href="https://stripe.com/docs/connect/connect-onboarding">Connect
* Onboarding</a>.
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class AccountLink extends ApiResource {
/** Time at which the object was created. Measured in seconds since the Unix epoch. */
@SerializedName("created")
Long created;
/** The timestamp at which this account link will expire. */
@SerializedName("expires_at")
Long expiresAt;
/**
* String representing the object's type. Objects of the same type share the same value.
*
* <p>Equal to {@code account_link}.
*/
@SerializedName("object")
String object;
/** The URL for the account link. */
@SerializedName("url")
String url;
/**
* Creates an AccountLink object that includes a single-use Stripe URL that the platform can
* redirect their user to in order to take them through the Connect Onboarding flow.
*/
public static AccountLink create(Map<String, Object> params) throws StripeException {
return create(params, (RequestOptions) null);
}
/**
* Creates an AccountLink object that includes a single-use Stripe URL that the platform can
* redirect their user to in order to take them through the Connect Onboarding flow.
*/
public static AccountLink create(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/account_links");
return ApiResource.request(
ApiResource.RequestMethod.POST, url, params, AccountLink.class, options);
}
/**
* Creates an AccountLink object that includes a single-use Stripe URL that the platform can
* redirect their user to in order to take them through the Connect Onboarding flow.
*/
public static AccountLink create(AccountLinkCreateParams params) throws StripeException {
return create(params, (RequestOptions) null);
}
/**
* Creates an AccountLink object that includes a single-use Stripe URL that the platform can
* redirect their user to in order to take them through the Connect Onboarding flow.
*/
public static AccountLink create(AccountLinkCreateParams params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/account_links");
return ApiResource.request(
ApiResource.RequestMethod.POST, url, params, AccountLink.class, options);
}
}