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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
use chrono::{NaiveDate, NaiveDateTime};
use serde::Serialize;
use super::enums::{AccountSortBy, FilterSiteStatus, MeterType, SiteSortBy, SortOrder, SystemUnits, TimeUnit};
use super::{DateSerde, DateTimeSerde, serialize_comma_slice_opt};
#[derive(Debug, Default, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SitesList<'r> {
/// The maximum number of sites returned by this call.
///
/// The maximum number of sites that can be returned by this call
/// is 100. If you have more than 100 sites, just request another 100 sites with startIndex=100.This will fetch sites
/// 100-199.
///
/// Default value: `100`
pub size: Option<u32>,
/// The first site index to be returned in the results.
///
/// Default value: `0`
pub start_index: Option<u32>,
/// Search text for this site.
///
/// Searchable site properties:
/// * Name
/// * Notes
/// * Address
/// * City
/// * Zip code
/// * Full address
/// * Country
pub search_text: Option<&'r str>,
/// A sorting option for this site list, based on one of its properties.
pub sort_property: Option<SiteSortBy>,
/// Sort order for the sort property.
///
/// Default value: `ASC`
pub sort_order: Option<SortOrder>,
/// Select the sites to be included in the list by their status.
///
/// Default value: `Active,Pending`
#[serde(serialize_with = "serialize_comma_slice_opt")]
pub status: Option<&'r [FilterSiteStatus]>,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SiteEnergy {
/// The start date to return energy measurement
#[serde(with = "DateSerde")]
pub start_date: NaiveDate,
/// The end date return energy measurement
#[serde(with = "DateSerde")]
pub end_date: NaiveDate,
/// Aggregation granularity.
///
/// Default value: `DAY`
pub time_unit: Option<TimeUnit>,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SiteTotalEnergy {
/// The start date to calculate energy generation
#[serde(with = "DateSerde")]
pub start_date: NaiveDate,
/// The end date to calculate energy generation
#[serde(with = "DateSerde")]
pub end_date: NaiveDate,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DateTimeRange {
/// The start (date + time) to get power measurements
#[serde(with = "DateTimeSerde")]
pub start_time: NaiveDateTime,
/// The end (date + time) to get power measurements
#[serde(with = "DateTimeSerde")]
pub end_time: NaiveDateTime,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SitePowerDetails<'r> {
/// The power measured start time
#[serde(with = "DateTimeSerde")]
pub start_time: NaiveDateTime,
/// The power measured end time
#[serde(with = "DateTimeSerde")]
pub end_time: NaiveDateTime,
/// Select specific meters only. If this value is omitted, all meter readings are returned.
#[serde(serialize_with = "serialize_comma_slice_opt")]
pub meters: Option<&'r [MeterType]>,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct MetersDateTimeRange<'r> {
/// The energy measured start time
#[serde(with = "DateTimeSerde")]
pub start_time: NaiveDateTime,
/// The energy measured end time
#[serde(with = "DateTimeSerde")]
pub end_time: NaiveDateTime,
/// Aggregation granularity.
///
/// Default value: `DAY`
pub time_unit: Option<TimeUnit>,
/// Select specific meters only. If this value is omitted, all meter readings are returned.
#[serde(serialize_with = "serialize_comma_slice_opt")]
pub meters: Option<&'r [MeterType]>,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SensorsDateTimeRange {
/// The start (date + time) to get sensor data
#[serde(with = "DateTimeSerde")]
pub start_date: NaiveDateTime,
/// The end (date + time) to get sensor data
#[serde(with = "DateTimeSerde")]
pub end_date: NaiveDateTime,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SiteStorageData<'r> {
/// Storage power measured start time
#[serde(with = "DateTimeSerde")]
pub start_time: NaiveDateTime,
/// Storage power measured end time
#[serde(with = "DateTimeSerde")]
pub end_time: NaiveDateTime,
/// Return data only for specific battery serial numbers. If omitted, the response includes all the batteries in
/// the site.
#[serde(serialize_with = "serialize_comma_slice_opt")]
pub serials: Option<&'r [String]>,
}
#[derive(Debug, Default, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SiteImage {
/// The maximum width to scale this image
pub max_width: Option<u16>,
/// The maximum height to scale this image
pub max_height: Option<u16>,
/// The image hash
pub hash: Option<u32>,
}
#[derive(Debug, Default, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SiteEnvBenefits {
/// The system units used when returning gas emission savings.
///
/// If systemUnits are not specified, the logged in user system units are used.
pub system_units: Option<SystemUnits>,
}
#[derive(Debug, Default, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct AccountsList<'r> {
/// The maximum number of accounts returned by this call. If you have more than 100 sites, just request another 100 sites with
/// startIndex=100. This will fetch sites 100-199.
///
/// Default value: `100`
pub size: Option<u8>,
/// The first account index to be returned in the results
///
/// Default value: `0`
pub start_index: Option<u8>,
/// Search text for this account. Searchable properties:
/// * Name – the account name
/// * Notes
/// * Email – contact person email
/// * Country
/// * State
/// * City
/// * Zip
/// * Full address
pub search_text: Option<&'r str>,
/// A sorting option for this account list, based on one of its properties.
pub sort_property: Option<AccountSortBy>,
/// Sort order for the sort property.
pub sort_order: Option<SortOrder>,
}