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

stripe / stripe-java / #16380

30 Aug 2024 07:54PM UTC coverage: 12.882% (-0.004%) from 12.886%
#16380

push

github

web-flow
Merge from master after the changes to not pass api_mode from individual methods (#1857)

* Generate SDK for OpenAPI spec version 1230 (#1856)

* Bump version to 26.9.0

* No need for APIMode to be passed around from individual API methods (#1855)

* Generated code

* Update the code around raw request

* Update the v2 tests to use v2 path

16 of 23 new or added lines in 7 files covered. (69.57%)

706 existing lines in 213 files now uncovered.

18468 of 143365 relevant lines covered (12.88%)

0.13 hits per line

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

83.33
/src/main/java/com/stripe/model/reporting/ReportRun.java
1
// File generated from our OpenAPI spec
2
package com.stripe.model.reporting;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.model.File;
7
import com.stripe.model.HasId;
8
import com.stripe.model.StripeObject;
9
import com.stripe.net.ApiRequest;
10
import com.stripe.net.ApiRequestParams;
11
import com.stripe.net.ApiResource;
12
import com.stripe.net.BaseAddress;
13
import com.stripe.net.RequestOptions;
14
import com.stripe.net.StripeResponseGetter;
15
import com.stripe.param.reporting.ReportRunCreateParams;
16
import com.stripe.param.reporting.ReportRunListParams;
17
import com.stripe.param.reporting.ReportRunRetrieveParams;
18
import java.util.List;
19
import java.util.Map;
20
import lombok.EqualsAndHashCode;
21
import lombok.Getter;
22
import lombok.Setter;
23

24
/**
25
 * The Report Run object represents an instance of a report type generated with specific run
26
 * parameters. Once the object is created, Stripe begins processing the report. When the report has
27
 * finished running, it will give you a reference to a file where you can retrieve your results. For
28
 * an overview, see <a href="https://stripe.com/docs/reporting/statements/api">API Access to
29
 * Reports</a>.
30
 *
31
 * <p>Note that certain report types can only be run based on your live-mode data (not test-mode
32
 * data), and will error when queried without a <a
33
 * href="https://stripe.com/docs/keys#test-live-modes">live-mode API key</a>.
34
 */
35
@Getter
36
@Setter
37
@EqualsAndHashCode(callSuper = false)
38
public class ReportRun extends ApiResource implements HasId {
1✔
39
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
40
  @SerializedName("created")
41
  Long created;
42

43
  /**
44
   * If something should go wrong during the run, a message about the failure (populated when {@code
45
   * status=failed}).
46
   */
47
  @SerializedName("error")
48
  String error;
49

50
  /** Unique identifier for the object. */
51
  @Getter(onMethod_ = {@Override})
52
  @SerializedName("id")
53
  String id;
54

55
  /**
56
   * {@code true} if the report is run on live mode data and {@code false} if it is run on test mode
57
   * data.
58
   */
59
  @SerializedName("livemode")
60
  Boolean livemode;
61

62
  /**
63
   * String representing the object's type. Objects of the same type share the same value.
64
   *
65
   * <p>Equal to {@code reporting.report_run}.
66
   */
67
  @SerializedName("object")
68
  String object;
69

70
  @SerializedName("parameters")
71
  Parameters parameters;
72

73
  /**
74
   * The ID of the <a href="https://stripe.com/docs/reports/report-types">report type</a> to run,
75
   * such as {@code "balance.summary.1"}.
76
   */
77
  @SerializedName("report_type")
78
  String reportType;
79

80
  /**
81
   * The file object representing the result of the report run (populated when {@code
82
   * status=succeeded}).
83
   */
84
  @SerializedName("result")
85
  File result;
86

87
  /**
88
   * Status of this report run. This will be {@code pending} when the run is initially created. When
89
   * the run finishes, this will be set to {@code succeeded} and the {@code result} field will be
90
   * populated. Rarely, we may encounter an error, at which point this will be set to {@code failed}
91
   * and the {@code error} field will be populated.
92
   */
93
  @SerializedName("status")
94
  String status;
95

96
  /**
97
   * Timestamp at which this run successfully finished (populated when {@code status=succeeded}).
98
   * Measured in seconds since the Unix epoch.
99
   */
100
  @SerializedName("succeeded_at")
101
  Long succeededAt;
102

103
  /**
104
   * Creates a new object and begin running the report. (Certain report types require a <a
105
   * href="https://stripe.com/docs/keys#test-live-modes">live-mode API key</a>.)
106
   */
107
  public static ReportRun create(Map<String, Object> params) throws StripeException {
108
    return create(params, (RequestOptions) null);
1✔
109
  }
110

111
  /**
112
   * Creates a new object and begin running the report. (Certain report types require a <a
113
   * href="https://stripe.com/docs/keys#test-live-modes">live-mode API key</a>.)
114
   */
115
  public static ReportRun create(Map<String, Object> params, RequestOptions options)
116
      throws StripeException {
117
    String path = "/v1/reporting/report_runs";
1✔
118
    ApiRequest request =
1✔
119
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
120
    return getGlobalResponseGetter().request(request, ReportRun.class);
1✔
121
  }
122

123
  /**
124
   * Creates a new object and begin running the report. (Certain report types require a <a
125
   * href="https://stripe.com/docs/keys#test-live-modes">live-mode API key</a>.)
126
   */
127
  public static ReportRun create(ReportRunCreateParams params) throws StripeException {
128
    return create(params, (RequestOptions) null);
1✔
129
  }
130

131
  /**
132
   * Creates a new object and begin running the report. (Certain report types require a <a
133
   * href="https://stripe.com/docs/keys#test-live-modes">live-mode API key</a>.)
134
   */
135
  public static ReportRun create(ReportRunCreateParams params, RequestOptions options)
136
      throws StripeException {
137
    String path = "/v1/reporting/report_runs";
1✔
138
    ApiResource.checkNullTypedParams(path, params);
1✔
139
    ApiRequest request =
1✔
140
        new ApiRequest(
141
            BaseAddress.API,
142
            ApiResource.RequestMethod.POST,
143
            path,
144
            ApiRequestParams.paramsToMap(params),
1✔
145
            options);
146
    return getGlobalResponseGetter().request(request, ReportRun.class);
1✔
147
  }
148

149
  /** Returns a list of Report Runs, with the most recent appearing first. */
150
  public static ReportRunCollection list(Map<String, Object> params) throws StripeException {
151
    return list(params, (RequestOptions) null);
1✔
152
  }
153

154
  /** Returns a list of Report Runs, with the most recent appearing first. */
155
  public static ReportRunCollection list(Map<String, Object> params, RequestOptions options)
156
      throws StripeException {
157
    String path = "/v1/reporting/report_runs";
1✔
158
    ApiRequest request =
1✔
159
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
160
    return getGlobalResponseGetter().request(request, ReportRunCollection.class);
1✔
161
  }
162

163
  /** Returns a list of Report Runs, with the most recent appearing first. */
164
  public static ReportRunCollection list(ReportRunListParams params) throws StripeException {
165
    return list(params, (RequestOptions) null);
1✔
166
  }
167

168
  /** Returns a list of Report Runs, with the most recent appearing first. */
169
  public static ReportRunCollection list(ReportRunListParams params, RequestOptions options)
170
      throws StripeException {
171
    String path = "/v1/reporting/report_runs";
1✔
172
    ApiResource.checkNullTypedParams(path, params);
1✔
173
    ApiRequest request =
1✔
174
        new ApiRequest(
175
            BaseAddress.API,
176
            ApiResource.RequestMethod.GET,
177
            path,
178
            ApiRequestParams.paramsToMap(params),
1✔
179
            options);
180
    return getGlobalResponseGetter().request(request, ReportRunCollection.class);
1✔
181
  }
182

183
  /** Retrieves the details of an existing Report Run. */
184
  public static ReportRun retrieve(String reportRun) throws StripeException {
185
    return retrieve(reportRun, (Map<String, Object>) null, (RequestOptions) null);
1✔
186
  }
187

188
  /** Retrieves the details of an existing Report Run. */
189
  public static ReportRun retrieve(String reportRun, RequestOptions options)
190
      throws StripeException {
191
    return retrieve(reportRun, (Map<String, Object>) null, options);
×
192
  }
193

194
  /** Retrieves the details of an existing Report Run. */
195
  public static ReportRun retrieve(
196
      String reportRun, Map<String, Object> params, RequestOptions options) throws StripeException {
197
    String path = String.format("/v1/reporting/report_runs/%s", ApiResource.urlEncodeId(reportRun));
1✔
198
    ApiRequest request =
1✔
199
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
200
    return getGlobalResponseGetter().request(request, ReportRun.class);
1✔
201
  }
202

203
  /** Retrieves the details of an existing Report Run. */
204
  public static ReportRun retrieve(
205
      String reportRun, ReportRunRetrieveParams params, RequestOptions options)
206
      throws StripeException {
207
    String path = String.format("/v1/reporting/report_runs/%s", ApiResource.urlEncodeId(reportRun));
×
208
    ApiResource.checkNullTypedParams(path, params);
×
209
    ApiRequest request =
×
210
        new ApiRequest(
211
            BaseAddress.API,
212
            ApiResource.RequestMethod.GET,
213
            path,
214
            ApiRequestParams.paramsToMap(params),
×
215
            options);
UNCOV
216
    return getGlobalResponseGetter().request(request, ReportRun.class);
×
217
  }
218

219
  @Getter
220
  @Setter
221
  @EqualsAndHashCode(callSuper = false)
222
  public static class Parameters extends StripeObject {
1✔
223
    /** The set of output columns requested for inclusion in the report run. */
224
    @SerializedName("columns")
225
    List<String> columns;
226

227
    /** Connected account ID by which to filter the report run. */
228
    @SerializedName("connected_account")
229
    String connectedAccount;
230

231
    /** Currency of objects to be included in the report run. */
232
    @SerializedName("currency")
233
    String currency;
234

235
    /**
236
     * Ending timestamp of data to be included in the report run. Can be any UTC timestamp between 1
237
     * second after the user specified {@code interval_start} and 1 second before this report's last
238
     * {@code data_available_end} value.
239
     */
240
    @SerializedName("interval_end")
241
    Long intervalEnd;
242

243
    /**
244
     * Starting timestamp of data to be included in the report run. Can be any UTC timestamp between
245
     * 1 second after this report's {@code data_available_start} and 1 second before the user
246
     * specified {@code interval_end} value.
247
     */
248
    @SerializedName("interval_start")
249
    Long intervalStart;
250

251
    /** Payout ID by which to filter the report run. */
252
    @SerializedName("payout")
253
    String payout;
254

255
    /** Category of balance transactions to be included in the report run. */
256
    @SerializedName("reporting_category")
257
    String reportingCategory;
258

259
    /**
260
     * Defaults to {@code Etc/UTC}. The output timezone for all timestamps in the report. A list of
261
     * possible time zone values is maintained at the <a href="http://www.iana.org/time-zones">IANA
262
     * Time Zone Database</a>. Has no effect on {@code interval_start} or {@code interval_end}.
263
     */
264
    @SerializedName("timezone")
265
    String timezone;
266
  }
267

268
  @Override
269
  public void setResponseGetter(StripeResponseGetter responseGetter) {
270
    super.setResponseGetter(responseGetter);
1✔
271
    trySetResponseGetter(parameters, responseGetter);
1✔
272
    trySetResponseGetter(result, responseGetter);
1✔
273
  }
1✔
274
}
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