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

stripe / stripe-java / #16418

13 Sep 2024 05:53PM UTC coverage: 12.856% (-0.02%) from 12.874%
#16418

push

github

web-flow
Merge pull request #1862 from stripe/latest-codegen-beta

Update generated code for beta

9 of 344 new or added lines in 28 files covered. (2.62%)

10 existing lines in 8 files now uncovered.

18470 of 143664 relevant lines covered (12.86%)

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/model/InvoiceRenderingTemplate.java
1
// File generated from our OpenAPI spec
2
package com.stripe.model;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.net.ApiRequest;
7
import com.stripe.net.ApiRequestParams;
8
import com.stripe.net.ApiResource;
9
import com.stripe.net.BaseAddress;
10
import com.stripe.net.RequestOptions;
11
import com.stripe.param.InvoiceRenderingTemplateArchiveParams;
12
import com.stripe.param.InvoiceRenderingTemplateListParams;
13
import com.stripe.param.InvoiceRenderingTemplateRetrieveParams;
14
import com.stripe.param.InvoiceRenderingTemplateUnarchiveParams;
15
import java.util.Map;
16
import lombok.EqualsAndHashCode;
17
import lombok.Getter;
18
import lombok.Setter;
19

20
@Getter
21
@Setter
22
@EqualsAndHashCode(callSuper = false)
NEW
23
public class InvoiceRenderingTemplate extends ApiResource implements HasId {
×
24
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
25
  @SerializedName("created")
26
  Long created;
27

28
  /** Unique identifier for the object. */
29
  @Getter(onMethod_ = {@Override})
30
  @SerializedName("id")
31
  String id;
32

33
  /**
34
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
35
   * object exists in test mode.
36
   */
37
  @SerializedName("livemode")
38
  Boolean livemode;
39

40
  /**
41
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
42
   * to an object. This can be useful for storing additional information about the object in a
43
   * structured format.
44
   */
45
  @SerializedName("metadata")
46
  Map<String, String> metadata;
47

48
  /** A brief description of the template, hidden from customers. */
49
  @SerializedName("nickname")
50
  String nickname;
51

52
  /**
53
   * String representing the object's type. Objects of the same type share the same value.
54
   *
55
   * <p>Equal to {@code invoice_rendering_template}.
56
   */
57
  @SerializedName("object")
58
  String object;
59

60
  /** The status of the template, one of {@code active} or {@code archived}. */
61
  @SerializedName("status")
62
  String status;
63

64
  /**
65
   * Version of this template; version increases by one when an update on the template changes any
66
   * field that controls invoice rendering.
67
   */
68
  @SerializedName("version")
69
  Long version;
70

71
  /**
72
   * Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects
73
   * (customers, invoices, etc.) can reference it. The template can also no longer be updated.
74
   * However, if the template is already set on a Stripe object, it will continue to be applied on
75
   * invoices generated by it.
76
   */
77
  public InvoiceRenderingTemplate archive() throws StripeException {
NEW
78
    return archive((Map<String, Object>) null, (RequestOptions) null);
×
79
  }
80

81
  /**
82
   * Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects
83
   * (customers, invoices, etc.) can reference it. The template can also no longer be updated.
84
   * However, if the template is already set on a Stripe object, it will continue to be applied on
85
   * invoices generated by it.
86
   */
87
  public InvoiceRenderingTemplate archive(RequestOptions options) throws StripeException {
NEW
88
    return archive((Map<String, Object>) null, options);
×
89
  }
90

91
  /**
92
   * Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects
93
   * (customers, invoices, etc.) can reference it. The template can also no longer be updated.
94
   * However, if the template is already set on a Stripe object, it will continue to be applied on
95
   * invoices generated by it.
96
   */
97
  public InvoiceRenderingTemplate archive(Map<String, Object> params) throws StripeException {
NEW
98
    return archive(params, (RequestOptions) null);
×
99
  }
100

101
  /**
102
   * Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects
103
   * (customers, invoices, etc.) can reference it. The template can also no longer be updated.
104
   * However, if the template is already set on a Stripe object, it will continue to be applied on
105
   * invoices generated by it.
106
   */
107
  public InvoiceRenderingTemplate archive(Map<String, Object> params, RequestOptions options)
108
      throws StripeException {
NEW
109
    String path =
×
NEW
110
        String.format(
×
NEW
111
            "/v1/invoice_rendering_templates/%s/archive", ApiResource.urlEncodeId(this.getId()));
×
NEW
112
    ApiRequest request =
×
113
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
NEW
114
    return getResponseGetter().request(request, InvoiceRenderingTemplate.class);
×
115
  }
116

117
  /**
118
   * Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects
119
   * (customers, invoices, etc.) can reference it. The template can also no longer be updated.
120
   * However, if the template is already set on a Stripe object, it will continue to be applied on
121
   * invoices generated by it.
122
   */
123
  public InvoiceRenderingTemplate archive(InvoiceRenderingTemplateArchiveParams params)
124
      throws StripeException {
NEW
125
    return archive(params, (RequestOptions) null);
×
126
  }
127

128
  /**
129
   * Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects
130
   * (customers, invoices, etc.) can reference it. The template can also no longer be updated.
131
   * However, if the template is already set on a Stripe object, it will continue to be applied on
132
   * invoices generated by it.
133
   */
134
  public InvoiceRenderingTemplate archive(
135
      InvoiceRenderingTemplateArchiveParams params, RequestOptions options) throws StripeException {
NEW
136
    String path =
×
NEW
137
        String.format(
×
NEW
138
            "/v1/invoice_rendering_templates/%s/archive", ApiResource.urlEncodeId(this.getId()));
×
NEW
139
    ApiResource.checkNullTypedParams(path, params);
×
NEW
140
    ApiRequest request =
×
141
        new ApiRequest(
142
            BaseAddress.API,
143
            ApiResource.RequestMethod.POST,
144
            path,
NEW
145
            ApiRequestParams.paramsToMap(params),
×
146
            options);
NEW
147
    return getResponseGetter().request(request, InvoiceRenderingTemplate.class);
×
148
  }
149

150
  /**
151
   * List all templates, ordered by creation date, with the most recently created template appearing
152
   * first.
153
   */
154
  public static InvoiceRenderingTemplateCollection list(Map<String, Object> params)
155
      throws StripeException {
NEW
156
    return list(params, (RequestOptions) null);
×
157
  }
158

159
  /**
160
   * List all templates, ordered by creation date, with the most recently created template appearing
161
   * first.
162
   */
163
  public static InvoiceRenderingTemplateCollection list(
164
      Map<String, Object> params, RequestOptions options) throws StripeException {
NEW
165
    String path = "/v1/invoice_rendering_templates";
×
NEW
166
    ApiRequest request =
×
167
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
NEW
168
    return getGlobalResponseGetter().request(request, InvoiceRenderingTemplateCollection.class);
×
169
  }
170

171
  /**
172
   * List all templates, ordered by creation date, with the most recently created template appearing
173
   * first.
174
   */
175
  public static InvoiceRenderingTemplateCollection list(InvoiceRenderingTemplateListParams params)
176
      throws StripeException {
NEW
177
    return list(params, (RequestOptions) null);
×
178
  }
179

180
  /**
181
   * List all templates, ordered by creation date, with the most recently created template appearing
182
   * first.
183
   */
184
  public static InvoiceRenderingTemplateCollection list(
185
      InvoiceRenderingTemplateListParams params, RequestOptions options) throws StripeException {
NEW
186
    String path = "/v1/invoice_rendering_templates";
×
NEW
187
    ApiResource.checkNullTypedParams(path, params);
×
NEW
188
    ApiRequest request =
×
189
        new ApiRequest(
190
            BaseAddress.API,
191
            ApiResource.RequestMethod.GET,
192
            path,
NEW
193
            ApiRequestParams.paramsToMap(params),
×
194
            options);
NEW
195
    return getGlobalResponseGetter().request(request, InvoiceRenderingTemplateCollection.class);
×
196
  }
197

198
  /**
199
   * Retrieves an invoice rendering template with the given ID. It by default returns the latest
200
   * version of the template. Optionally, specify a version to see previous versions.
201
   */
202
  public static InvoiceRenderingTemplate retrieve(String template) throws StripeException {
NEW
203
    return retrieve(template, (Map<String, Object>) null, (RequestOptions) null);
×
204
  }
205

206
  /**
207
   * Retrieves an invoice rendering template with the given ID. It by default returns the latest
208
   * version of the template. Optionally, specify a version to see previous versions.
209
   */
210
  public static InvoiceRenderingTemplate retrieve(String template, RequestOptions options)
211
      throws StripeException {
NEW
212
    return retrieve(template, (Map<String, Object>) null, options);
×
213
  }
214

215
  /**
216
   * Retrieves an invoice rendering template with the given ID. It by default returns the latest
217
   * version of the template. Optionally, specify a version to see previous versions.
218
   */
219
  public static InvoiceRenderingTemplate retrieve(
220
      String template, Map<String, Object> params, RequestOptions options) throws StripeException {
NEW
221
    String path =
×
NEW
222
        String.format("/v1/invoice_rendering_templates/%s", ApiResource.urlEncodeId(template));
×
NEW
223
    ApiRequest request =
×
224
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
NEW
225
    return getGlobalResponseGetter().request(request, InvoiceRenderingTemplate.class);
×
226
  }
227

228
  /**
229
   * Retrieves an invoice rendering template with the given ID. It by default returns the latest
230
   * version of the template. Optionally, specify a version to see previous versions.
231
   */
232
  public static InvoiceRenderingTemplate retrieve(
233
      String template, InvoiceRenderingTemplateRetrieveParams params, RequestOptions options)
234
      throws StripeException {
NEW
235
    String path =
×
NEW
236
        String.format("/v1/invoice_rendering_templates/%s", ApiResource.urlEncodeId(template));
×
NEW
237
    ApiResource.checkNullTypedParams(path, params);
×
NEW
238
    ApiRequest request =
×
239
        new ApiRequest(
240
            BaseAddress.API,
241
            ApiResource.RequestMethod.GET,
242
            path,
NEW
243
            ApiRequestParams.paramsToMap(params),
×
244
            options);
NEW
245
    return getGlobalResponseGetter().request(request, InvoiceRenderingTemplate.class);
×
246
  }
247

248
  /** Unarchive an invoice rendering template so it can be used on new Stripe objects again. */
249
  public InvoiceRenderingTemplate unarchive() throws StripeException {
NEW
250
    return unarchive((Map<String, Object>) null, (RequestOptions) null);
×
251
  }
252

253
  /** Unarchive an invoice rendering template so it can be used on new Stripe objects again. */
254
  public InvoiceRenderingTemplate unarchive(RequestOptions options) throws StripeException {
NEW
255
    return unarchive((Map<String, Object>) null, options);
×
256
  }
257

258
  /** Unarchive an invoice rendering template so it can be used on new Stripe objects again. */
259
  public InvoiceRenderingTemplate unarchive(Map<String, Object> params) throws StripeException {
NEW
260
    return unarchive(params, (RequestOptions) null);
×
261
  }
262

263
  /** Unarchive an invoice rendering template so it can be used on new Stripe objects again. */
264
  public InvoiceRenderingTemplate unarchive(Map<String, Object> params, RequestOptions options)
265
      throws StripeException {
NEW
266
    String path =
×
NEW
267
        String.format(
×
NEW
268
            "/v1/invoice_rendering_templates/%s/unarchive", ApiResource.urlEncodeId(this.getId()));
×
NEW
269
    ApiRequest request =
×
270
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
NEW
271
    return getResponseGetter().request(request, InvoiceRenderingTemplate.class);
×
272
  }
273

274
  /** Unarchive an invoice rendering template so it can be used on new Stripe objects again. */
275
  public InvoiceRenderingTemplate unarchive(InvoiceRenderingTemplateUnarchiveParams params)
276
      throws StripeException {
NEW
277
    return unarchive(params, (RequestOptions) null);
×
278
  }
279

280
  /** Unarchive an invoice rendering template so it can be used on new Stripe objects again. */
281
  public InvoiceRenderingTemplate unarchive(
282
      InvoiceRenderingTemplateUnarchiveParams params, RequestOptions options)
283
      throws StripeException {
NEW
284
    String path =
×
NEW
285
        String.format(
×
NEW
286
            "/v1/invoice_rendering_templates/%s/unarchive", ApiResource.urlEncodeId(this.getId()));
×
NEW
287
    ApiResource.checkNullTypedParams(path, params);
×
NEW
288
    ApiRequest request =
×
289
        new ApiRequest(
290
            BaseAddress.API,
291
            ApiResource.RequestMethod.POST,
292
            path,
NEW
293
            ApiRequestParams.paramsToMap(params),
×
294
            options);
NEW
295
    return getResponseGetter().request(request, InvoiceRenderingTemplate.class);
×
296
  }
297
}
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