-
Notifications
You must be signed in to change notification settings - Fork 2
/
simulation_run_events.go
81 lines (66 loc) · 3.38 KB
/
simulation_run_events.go
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
// Code generated by the Paddle SDK Generator; DO NOT EDIT.
package paddle
import "context"
// SimulationRunEventsClient is a client for the Simulation run events resource.
type SimulationRunEventsClient struct {
doer Doer
}
// ListSimulationsEventsRequest is given as an input to ListSimulationsEvents.
type ListSimulationsEventsRequest struct {
// URL path parameters.
SimulationID string `in:"path=simulation_id" json:"-"`
SimulationRunID string `in:"path=simulation_run_id" json:"-"`
// After is a query parameter.
// Return entities after the specified Paddle ID when working with paginated endpoints. Used in the `meta.pagination.next` URL in responses for list operations.
After *string `in:"query=after;omitempty" json:"-"`
// OrderBy is a query parameter.
/*
Order returned entities by the specified field and direction (`[ASC]` or `[DESC]`). For example, `?order_by=id[ASC]`.
Valid fields for ordering: `id`.
*/
OrderBy *string `in:"query=order_by;omitempty" json:"-"`
// PerPage is a query parameter.
/*
Set how many entities are returned per page. Paddle returns the maximum number of results if a number greater than the maximum is requested. Check `meta.pagination.per_page` in the response to see how many were returned.
Default: `50`; Maximum: `200`.
*/
PerPage *int `in:"query=per_page;omitempty" json:"-"`
// ID is a query parameter.
// Return only the IDs specified. Use a comma-separated list to get multiple entities.
ID []string `in:"query=id;omitempty" json:"-"`
}
// ListSimulationsEvents performs the GET operation on a Simulation run events resource.
func (c *SimulationRunEventsClient) ListSimulationsEvents(ctx context.Context, req *ListSimulationsEventsRequest) (res *Collection[*SimulationEvent], err error) {
if err := c.doer.Do(ctx, "GET", "/simulations/{simulation_id}/runs/{simulation_run_id}/events", req, &res); err != nil {
return nil, err
}
return res, nil
}
// GetSimulationEventRequest is given as an input to GetSimulationEvent.
type GetSimulationEventRequest struct {
// URL path parameters.
SimulationID string `in:"path=simulation_id" json:"-"`
SimulationRunID string `in:"path=simulation_run_id" json:"-"`
SimulationEventID string `in:"path=simulation_event_id" json:"-"`
}
// GetSimulationEvent performs the GET operation on a Simulation run events resource.
func (c *SimulationRunEventsClient) GetSimulationEvent(ctx context.Context, req *GetSimulationEventRequest) (res *SimulationEvent, err error) {
if err := c.doer.Do(ctx, "GET", "/simulations/{simulation_id}/runs/{simulation_run_id}/events/{simulation_event_id}", req, &res); err != nil {
return nil, err
}
return res, nil
}
// ReplaySimulationRunEventRequest is given as an input to ReplaySimulationRunEvent.
type ReplaySimulationRunEventRequest struct {
// URL path parameters.
SimulationID string `in:"path=simulation_id" json:"-"`
SimulationRunID string `in:"path=simulation_run_id" json:"-"`
SimulationEventID string `in:"path=simulation_event_id" json:"-"`
}
// ReplaySimulationRunEvent performs the POST operation on a Simulation run events resource.
func (c *SimulationRunEventsClient) ReplaySimulationRunEvent(ctx context.Context, req *ReplaySimulationRunEventRequest) (err error) {
if err := c.doer.Do(ctx, "POST", "/simulations/{simulation_id}/runs/{simulation_run_id}/events/{simulation_event_id}/replay", req, nil); err != nil {
return err
}
return nil
}