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

stripe / stripe-java / #16493

03 Oct 2024 07:15PM UTC coverage: 12.942% (+0.08%) from 12.864%
#16493

push

github

web-flow
Merge Stripe-java v27.0.0 to beta branch (#1888)

409 of 1651 new or added lines in 88 files covered. (24.77%)

31 existing lines in 7 files now uncovered.

18773 of 145050 relevant lines covered (12.94%)

0.13 hits per line

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

0.0
/src/main/java/com/stripe/param/billing/CreditGrantUpdateParams.java
1
// File generated from our OpenAPI spec
2
package com.stripe.param.billing;
3

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

13
@Getter
14
public class CreditGrantUpdateParams extends ApiRequestParams {
15
  /** Specifies which fields in the response should be expanded. */
16
  @SerializedName("expand")
17
  List<String> expand;
18

19
  /**
20
   * The time when the credit created by this credit grant will expire. If set to empty, the credit
21
   * will never expire.
22
   */
23
  @SerializedName("expires_at")
24
  Object expiresAt;
25

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

35
  /**
36
   * Set of key-value pairs that you can attach to an object. This can be useful for storing
37
   * additional information about the object (ex: cost basis) in a structured format.
38
   */
39
  @SerializedName("metadata")
40
  Map<String, String> metadata;
41

42
  private CreditGrantUpdateParams(
43
      List<String> expand,
44
      Object expiresAt,
45
      Map<String, Object> extraParams,
NEW
46
      Map<String, String> metadata) {
×
NEW
47
    this.expand = expand;
×
NEW
48
    this.expiresAt = expiresAt;
×
NEW
49
    this.extraParams = extraParams;
×
NEW
50
    this.metadata = metadata;
×
NEW
51
  }
×
52

53
  public static Builder builder() {
NEW
54
    return new Builder();
×
55
  }
56

NEW
57
  public static class Builder {
×
58
    private List<String> expand;
59

60
    private Object expiresAt;
61

62
    private Map<String, Object> extraParams;
63

64
    private Map<String, String> metadata;
65

66
    /** Finalize and obtain parameter instance from this builder. */
67
    public CreditGrantUpdateParams build() {
NEW
68
      return new CreditGrantUpdateParams(
×
69
          this.expand, this.expiresAt, this.extraParams, this.metadata);
70
    }
71

72
    /**
73
     * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
74
     * subsequent calls adds additional elements to the original list. See {@link
75
     * CreditGrantUpdateParams#expand} for the field documentation.
76
     */
77
    public Builder addExpand(String element) {
NEW
78
      if (this.expand == null) {
×
NEW
79
        this.expand = new ArrayList<>();
×
80
      }
NEW
81
      this.expand.add(element);
×
NEW
82
      return this;
×
83
    }
84

85
    /**
86
     * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
87
     * subsequent calls adds additional elements to the original list. See {@link
88
     * CreditGrantUpdateParams#expand} for the field documentation.
89
     */
90
    public Builder addAllExpand(List<String> elements) {
NEW
91
      if (this.expand == null) {
×
NEW
92
        this.expand = new ArrayList<>();
×
93
      }
NEW
94
      this.expand.addAll(elements);
×
NEW
95
      return this;
×
96
    }
97

98
    /**
99
     * The time when the credit created by this credit grant will expire. If set to empty, the
100
     * credit will never expire.
101
     */
102
    public Builder setExpiresAt(Long expiresAt) {
NEW
103
      this.expiresAt = expiresAt;
×
NEW
104
      return this;
×
105
    }
106

107
    /**
108
     * The time when the credit created by this credit grant will expire. If set to empty, the
109
     * credit will never expire.
110
     */
111
    public Builder setExpiresAt(EmptyParam expiresAt) {
NEW
112
      this.expiresAt = expiresAt;
×
NEW
113
      return this;
×
114
    }
115

116
    /**
117
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
118
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
119
     * CreditGrantUpdateParams#extraParams} for the field documentation.
120
     */
121
    public Builder putExtraParam(String key, Object value) {
NEW
122
      if (this.extraParams == null) {
×
NEW
123
        this.extraParams = new HashMap<>();
×
124
      }
NEW
125
      this.extraParams.put(key, value);
×
NEW
126
      return this;
×
127
    }
128

129
    /**
130
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
131
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
132
     * See {@link CreditGrantUpdateParams#extraParams} for the field documentation.
133
     */
134
    public Builder putAllExtraParam(Map<String, Object> map) {
NEW
135
      if (this.extraParams == null) {
×
NEW
136
        this.extraParams = new HashMap<>();
×
137
      }
NEW
138
      this.extraParams.putAll(map);
×
NEW
139
      return this;
×
140
    }
141

142
    /**
143
     * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call,
144
     * and subsequent calls add additional key/value pairs to the original map. See {@link
145
     * CreditGrantUpdateParams#metadata} for the field documentation.
146
     */
147
    public Builder putMetadata(String key, String value) {
NEW
148
      if (this.metadata == null) {
×
NEW
149
        this.metadata = new HashMap<>();
×
150
      }
NEW
151
      this.metadata.put(key, value);
×
NEW
152
      return this;
×
153
    }
154

155
    /**
156
     * Add all map key/value pairs to `metadata` map. A map is initialized for the first
157
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
158
     * See {@link CreditGrantUpdateParams#metadata} for the field documentation.
159
     */
160
    public Builder putAllMetadata(Map<String, String> map) {
NEW
161
      if (this.metadata == null) {
×
NEW
162
        this.metadata = new HashMap<>();
×
163
      }
NEW
164
      this.metadata.putAll(map);
×
NEW
165
      return this;
×
166
    }
167
  }
168
}
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

© 2026 Coveralls, Inc