• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-java / #14624

pending completion
#14624

Pull #1596

github-actions

web-flow
Merge aa276e476 into 0adfd1352
Pull Request #1596: Add StripeClient

10149 of 10149 new or added lines in 282 files covered. (100.0%)

14798 of 78436 relevant lines covered (18.87%)

0.19 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

25.71
/src/main/java/com/stripe/param/FeeRefundCreateParams.java
1
// File generated from our OpenAPI spec
2
package com.stripe.param;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.net.ApiRequestParams;
6
import java.util.ArrayList;
7
import java.util.HashMap;
8
import java.util.List;
9
import java.util.Map;
10
import lombok.Getter;
11

12
@Getter
13
public class FeeRefundCreateParams extends ApiRequestParams {
14
  /**
15
   * A positive integer, in <em>cents (or local equivalent)</em>, representing how much of this fee
16
   * to refund. Can refund only up to the remaining unrefunded amount of the fee.
17
   */
18
  @SerializedName("amount")
19
  Long amount;
20

21
  /** Specifies which fields in the response should be expanded. */
22
  @SerializedName("expand")
23
  List<String> expand;
24

25
  /**
26
   * Map of extra parameters for custom features not available in this client library. The content
27
   * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
28
   * key/value pair is serialized as if the key is a root-level field (serialized) name in this
29
   * param object. Effectively, this map is flattened to its parent instance.
30
   */
31
  @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
32
  Map<String, Object> extraParams;
33

34
  /**
35
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
36
   * to an object. This can be useful for storing additional information about the object in a
37
   * structured format. Individual keys can be unset by posting an empty value to them. All keys can
38
   * be unset by posting an empty value to {@code metadata}.
39
   */
40
  @SerializedName("metadata")
41
  Map<String, String> metadata;
42

43
  private FeeRefundCreateParams(
44
      Long amount,
45
      List<String> expand,
46
      Map<String, Object> extraParams,
47
      Map<String, String> metadata) {
1✔
48
    this.amount = amount;
1✔
49
    this.expand = expand;
1✔
50
    this.extraParams = extraParams;
1✔
51
    this.metadata = metadata;
1✔
52
  }
1✔
53

54
  public static Builder builder() {
55
    return new Builder();
1✔
56
  }
57

58
  public static class Builder {
1✔
59
    private Long amount;
60

61
    private List<String> expand;
62

63
    private Map<String, Object> extraParams;
64

65
    private Map<String, String> metadata;
66

67
    /** Finalize and obtain parameter instance from this builder. */
68
    public FeeRefundCreateParams build() {
69
      return new FeeRefundCreateParams(this.amount, this.expand, this.extraParams, this.metadata);
1✔
70
    }
71

72
    /**
73
     * A positive integer, in <em>cents (or local equivalent)</em>, representing how much of this
74
     * fee to refund. Can refund only up to the remaining unrefunded amount of the fee.
75
     */
76
    public Builder setAmount(Long amount) {
77
      this.amount = amount;
×
78
      return this;
×
79
    }
80

81
    /**
82
     * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
83
     * subsequent calls adds additional elements to the original list. See {@link
84
     * FeeRefundCreateParams#expand} for the field documentation.
85
     */
86
    public Builder addExpand(String element) {
87
      if (this.expand == null) {
×
88
        this.expand = new ArrayList<>();
×
89
      }
90
      this.expand.add(element);
×
91
      return this;
×
92
    }
93

94
    /**
95
     * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
96
     * subsequent calls adds additional elements to the original list. See {@link
97
     * FeeRefundCreateParams#expand} for the field documentation.
98
     */
99
    public Builder addAllExpand(List<String> elements) {
100
      if (this.expand == null) {
×
101
        this.expand = new ArrayList<>();
×
102
      }
103
      this.expand.addAll(elements);
×
104
      return this;
×
105
    }
106

107
    /**
108
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
109
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
110
     * FeeRefundCreateParams#extraParams} for the field documentation.
111
     */
112
    public Builder putExtraParam(String key, Object value) {
113
      if (this.extraParams == null) {
×
114
        this.extraParams = new HashMap<>();
×
115
      }
116
      this.extraParams.put(key, value);
×
117
      return this;
×
118
    }
119

120
    /**
121
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
122
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
123
     * See {@link FeeRefundCreateParams#extraParams} for the field documentation.
124
     */
125
    public Builder putAllExtraParam(Map<String, Object> map) {
126
      if (this.extraParams == null) {
×
127
        this.extraParams = new HashMap<>();
×
128
      }
129
      this.extraParams.putAll(map);
×
130
      return this;
×
131
    }
132

133
    /**
134
     * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call,
135
     * and subsequent calls add additional key/value pairs to the original map. See {@link
136
     * FeeRefundCreateParams#metadata} for the field documentation.
137
     */
138
    public Builder putMetadata(String key, String value) {
139
      if (this.metadata == null) {
×
140
        this.metadata = new HashMap<>();
×
141
      }
142
      this.metadata.put(key, value);
×
143
      return this;
×
144
    }
145

146
    /**
147
     * Add all map key/value pairs to `metadata` map. A map is initialized for the first
148
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
149
     * See {@link FeeRefundCreateParams#metadata} for the field documentation.
150
     */
151
    public Builder putAllMetadata(Map<String, String> map) {
152
      if (this.metadata == null) {
×
153
        this.metadata = new HashMap<>();
×
154
      }
155
      this.metadata.putAll(map);
×
156
      return this;
×
157
    }
158
  }
159
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc