portfoliomanager-rb 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.ruby-version +1 -0
- data/.travis.yml +6 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +15 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +42 -0
- data/LICENSE.txt +30 -0
- data/README.md +92 -0
- data/Rakefile +6 -0
- data/WARRANTY.txt +22 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/portfolio_manager/client.rb +199 -0
- data/lib/portfolio_manager/mapper.rb +14 -0
- data/lib/portfolio_manager/mapping_registry.rb +7326 -0
- data/lib/portfolio_manager/services/all.rb +30 -0
- data/lib/portfolio_manager/services/basic_account.rb +301 -0
- data/lib/portfolio_manager/services/building.rb +158 -0
- data/lib/portfolio_manager/services/connection.rb +386 -0
- data/lib/portfolio_manager/services/meter.rb +955 -0
- data/lib/portfolio_manager/services/property.rb +931 -0
- data/lib/portfolio_manager/services/property_use.rb +306 -0
- data/lib/portfolio_manager/services/reporting.rb +208 -0
- data/lib/portfolio_manager/services/target_finder.rb +76 -0
- data/lib/portfolio_manager/services.rb +21 -0
- data/lib/portfolio_manager/version.rb +3 -0
- data/lib/portfolio_manager/xml.rb +9221 -0
- data/lib/portfolio_manager.rb +15 -0
- data/portfoliomanager.gemspec +28 -0
- metadata +104 -0
@@ -0,0 +1,955 @@
|
|
1
|
+
require "net/http"
|
2
|
+
|
3
|
+
module PortfolioManager
|
4
|
+
module Services
|
5
|
+
# Meter Services
|
6
|
+
#
|
7
|
+
# The Meter Services allow you to manage meters within Portfolio Manager.
|
8
|
+
# These services support all meter categories: all fuels, water, Data Center
|
9
|
+
# IT energy meters, waste, and water and wastewater plant meters. The
|
10
|
+
# ability to define green power is also provided. You must be already
|
11
|
+
# connected to your customers to be able to manage their meters.
|
12
|
+
#
|
13
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter
|
14
|
+
module Meter
|
15
|
+
# Meter
|
16
|
+
module Meter
|
17
|
+
# Live Environment
|
18
|
+
module Live
|
19
|
+
# Add Meter
|
20
|
+
#
|
21
|
+
# This web service creates a meter for a specific property based on
|
22
|
+
# the information provided in the XML request and establishes all of
|
23
|
+
# the necessary meter sharing permissions between you and the
|
24
|
+
# Portfolio Manager user. It returns the unique identifier to the
|
25
|
+
# newly created meter and a link to the corresponding web service to
|
26
|
+
# retrieve it. The property must already be shared with you and you
|
27
|
+
# must have write access to the property.
|
28
|
+
#
|
29
|
+
# @param property_id [Integer]
|
30
|
+
# @param meter [PortfolioManager::Xml::MeterType, PortfolioManager::Xml::TypeOfWasteMeter]
|
31
|
+
# @param elename [nil, "meter", "wasteMeter"]
|
32
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
33
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
34
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
35
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/meter/post
|
36
|
+
def add_meter(property_id, meter, elename = nil)
|
37
|
+
request(Net::HTTP::Post, path_for("property", property_id, "meter"), {}, {}, meter, elename, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Delete Meter
|
41
|
+
#
|
42
|
+
# This web service deletes a specified meter. The meter must already
|
43
|
+
# be shared with you.
|
44
|
+
#
|
45
|
+
# @param meter_id [Integer]
|
46
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
47
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
48
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
49
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/meter/delete
|
50
|
+
def delete_meter(meter_id)
|
51
|
+
request(Net::HTTP::Delete, path_for("meter", meter_id), {}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
52
|
+
end
|
53
|
+
|
54
|
+
# Edit Meter
|
55
|
+
#
|
56
|
+
# This web service updates a specified meter based on the information
|
57
|
+
# provided in the XML request and establishes all of the necessary
|
58
|
+
# meter sharing permissions between you and the Portfolio Manager
|
59
|
+
# user. It returns the unique identifier to the meter and a link to
|
60
|
+
# the corresponding web service to retrieve it. The meter must already
|
61
|
+
# be shared with you and you must have write access to the meter.
|
62
|
+
#
|
63
|
+
# @param meter_id [Integer]
|
64
|
+
# @param meter [PortfolioManager::Xml::MeterType, PortfolioManager::Xml::TypeOfWasteMeter]
|
65
|
+
# @param elename [nil, "meter", "wasteMeter"]
|
66
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
67
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
68
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
69
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/meter/put
|
70
|
+
def edit_meter(meter_id, meter, elename = nil)
|
71
|
+
request(Net::HTTP::Put, path_for("meter", meter_id), {}, {}, meter, elename, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
72
|
+
end
|
73
|
+
|
74
|
+
# Get ID Hierarchy for Meter
|
75
|
+
#
|
76
|
+
# This web service returns the accountId and propertyId that
|
77
|
+
# corresponds to a specific meter. The accountId returned is the
|
78
|
+
# Property Data Administrator (PDA). If the specified meter refers to
|
79
|
+
# an IT meter or a plant flow meter, then the corresponding
|
80
|
+
# propertyUseId that is associated to the specified meter is also
|
81
|
+
# returned, otherwise it is omitted. The meter must already be shared
|
82
|
+
# with you or you must have pending share access.
|
83
|
+
#
|
84
|
+
# @param meter_id [Integer]
|
85
|
+
# @return [PortfolioManager::Xml::HierarchyType, PortfolioManager::Xml::ResponseType]
|
86
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
87
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
88
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/hierarchy/get
|
89
|
+
def get_id_hierarchy_for_meter(meter_id)
|
90
|
+
request(Net::HTTP::Get, path_for("idHierarchy", "meter", meter_id), {}, {}, nil, nil, PortfolioManager::Xml::HierarchyType, basic_auth: true)
|
91
|
+
end
|
92
|
+
|
93
|
+
# Get Meter
|
94
|
+
#
|
95
|
+
# This web service retrieves information for a specific meter. The
|
96
|
+
# meter must already be shared with you.
|
97
|
+
#
|
98
|
+
# @param meter_id [Integer]
|
99
|
+
# @return [PortfolioManager::Xml::MeterType, PortfolioManager::Xml::ResponseType]
|
100
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
101
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
102
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/meter/get
|
103
|
+
def get_meter(meter_id)
|
104
|
+
request(Net::HTTP::Get, path_for("meter", meter_id), {}, {}, nil, nil, PortfolioManager::Xml::MeterType, basic_auth: true)
|
105
|
+
end
|
106
|
+
|
107
|
+
# Get Meter List
|
108
|
+
#
|
109
|
+
# This web service retrieves a list of all the meters for a specific
|
110
|
+
# property or just the meters that you have access to. The property
|
111
|
+
# must already be shared with you.
|
112
|
+
#
|
113
|
+
# @param property_id [Integer]
|
114
|
+
# @param my_access_only [Boolean]
|
115
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
116
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
117
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
118
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/meterList/get
|
119
|
+
def get_meter_list(property_id, my_access_only = false)
|
120
|
+
request(Net::HTTP::Get, path_for("property", property_id, "meter", "list"), {
|
121
|
+
"myAccessOnly" => my_access_only,
|
122
|
+
}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
123
|
+
end
|
124
|
+
|
125
|
+
# Get What Changed Meter List
|
126
|
+
#
|
127
|
+
# This web service returns a list of meters that changed since a user
|
128
|
+
# specified date. The list of meters returned are account specific.
|
129
|
+
# The returned list only shows meters that you have permission to
|
130
|
+
# view. Results are returned in increments of 1,000 per set. Actions
|
131
|
+
# that trigger a meter to be included in the returned list may have
|
132
|
+
# been performed by any user with access to the meter. A list of user
|
133
|
+
# actions that trigger a meter to be included in the returned list can
|
134
|
+
# be found {https://energystar-mesa.force.com/PortfolioManager/s/article/Last-Modified-Metrics-What-types-of-edits-trigger-an-update-1600088554500 here}.
|
135
|
+
#
|
136
|
+
# @param customer_id [Integer]
|
137
|
+
# @param date [Date]
|
138
|
+
# @param next_page_key [nil, String]
|
139
|
+
# @param previous_page_key [nil, String]
|
140
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
141
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
142
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
143
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/getWhatChanged/get
|
144
|
+
def get_what_changed_meter_list(customer_id, date, next_page_key = nil, previous_page_key = nil)
|
145
|
+
request(Net::HTTP::Get, path_for("customer", customer_id, "meter", "whatChanged"), {
|
146
|
+
"date" => date.strftime("%Y-%m-%d"),
|
147
|
+
"nextPageKey" => next_page_key,
|
148
|
+
"previousPageKey" => previous_page_key,
|
149
|
+
}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
150
|
+
end
|
151
|
+
|
152
|
+
# Get What Changed Meter List for a Specific Property
|
153
|
+
#
|
154
|
+
# This web service returns a list of meters within a specified
|
155
|
+
# property that changed since a user specified date. The list of
|
156
|
+
# meters returned are property specific. The returned list only shows
|
157
|
+
# meters that you have permission to view. Results are returned in
|
158
|
+
# increments of 1,000 per set. Actions that trigger a meter to be
|
159
|
+
# included in the returned list may have been performed by any user
|
160
|
+
# with access to the meter. A list of user actions that trigger a
|
161
|
+
# meter to be included in the returned list can be found {https://energystar-mesa.force.com/PortfolioManager/s/article/Last-Modified-Metrics-What-types-of-edits-trigger-an-update-1600088554500 here}.
|
162
|
+
#
|
163
|
+
# @param property_id [Integer]
|
164
|
+
# @param date [Date]
|
165
|
+
# @param next_page_key [nil, String]
|
166
|
+
# @param previous_page_key [nil, String]
|
167
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
168
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
169
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
170
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/getWhatChangedPropertyMeter/get
|
171
|
+
def get_what_changed_meter_list_for_a_specific_property(property_id, date, next_page_key = nil, previous_page_key = nil)
|
172
|
+
request(Net::HTTP::Get, path_for("property", property_id, "meter", "whatChanged"), {
|
173
|
+
"date" => date.strftime("%Y-%m-%d"),
|
174
|
+
"nextPageKey" => next_page_key,
|
175
|
+
"previousPageKey" => previous_page_key,
|
176
|
+
}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
# Test Environment
|
181
|
+
module Test
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
# Property Meter Association
|
186
|
+
module PropertyMeterAssociation
|
187
|
+
# Live Environment
|
188
|
+
module Live
|
189
|
+
# Get Associated Property Meters
|
190
|
+
#
|
191
|
+
# This web service returns a list of meters that are associated to a
|
192
|
+
# specific property.
|
193
|
+
#
|
194
|
+
# @param property_id [Integer]
|
195
|
+
# @return [PortfolioManager::Xml::MeterPropertyAssociationListType, PortfolioManager::Xml::ResponseType]
|
196
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
197
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
198
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/propertyAssociation/get
|
199
|
+
def get_associated_property_meters(property_id)
|
200
|
+
request(Net::HTTP::Get, path_for("association", "property", property_id, "meter"), {}, {}, nil, nil, PortfolioManager::Xml::MeterPropertyAssociationListType, basic_auth: true)
|
201
|
+
end
|
202
|
+
|
203
|
+
# Associate Meter to a Property
|
204
|
+
#
|
205
|
+
# This web service associates a single meter to a property. You must
|
206
|
+
# have any of the following sharing permissions:
|
207
|
+
# - full access on the property and read only access on the meter
|
208
|
+
# - read only access on the property and full access on the meter
|
209
|
+
# - full access for both the property and meter
|
210
|
+
#
|
211
|
+
# Any other meters currently associated to the property are
|
212
|
+
# unaffected. Any property representation currently assigned to the
|
213
|
+
# property (if any) is unaffected.
|
214
|
+
#
|
215
|
+
# @param property_id [Integer]
|
216
|
+
# @param meter_id [Integer]
|
217
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
218
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
219
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
220
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/propertyAssociationSingle/post
|
221
|
+
def associate_meter_to_a_property(property_id, meter_id)
|
222
|
+
request(Net::HTTP::Post, path_for("association", "property", property_id, "meter", meter_id), {}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
223
|
+
end
|
224
|
+
|
225
|
+
# Associate Meters to a Property
|
226
|
+
#
|
227
|
+
# This web service associates a set of meters to a property based on
|
228
|
+
# the set of meters provided in the XML request. If a set of energy
|
229
|
+
# meters is only provided then the association is only performed using
|
230
|
+
# that set of energy meters and any existing water meter associations
|
231
|
+
# are not affected. Similarly, if a set of water meters is only
|
232
|
+
# provided then the association is only performed using that set of
|
233
|
+
# water meters and any existing energy meter associations are not
|
234
|
+
# affected. All submissions overwrite/replace previous settings.
|
235
|
+
#
|
236
|
+
# @param property_id [Integer]
|
237
|
+
# @param meter_property_association_list [PortfolioManager::Xml::MeterPropertyAssociationListType]
|
238
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
239
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
240
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
241
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/propertyAssociation/post
|
242
|
+
def associate_meters_to_a_property(property_id, meter_property_association_list)
|
243
|
+
request(Net::HTTP::Post, path_for("association", "property", property_id, "meter"), {}, {}, meter_property_association_list, "meterPropertyAssociationList", PortfolioManager::Xml::ResponseType, basic_auth: true)
|
244
|
+
end
|
245
|
+
|
246
|
+
# Disassociate Meter from a Property
|
247
|
+
#
|
248
|
+
# This web service disassociates a specific meter from a given
|
249
|
+
# property.
|
250
|
+
#
|
251
|
+
# @param property_id [Integer]
|
252
|
+
# @param meter_id [Integer]
|
253
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
254
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
255
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
256
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/propertyAssociation/delete
|
257
|
+
def disassociate_meter_from_a_property(property_id, meter_id)
|
258
|
+
request(Net::HTTP::Delete, path_for("association", "property", property_id, "meter", meter_id), {}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
262
|
+
# Test Environment
|
263
|
+
module Test
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
# Property Use Meter Assocation
|
268
|
+
module PropertyUseMeterAssociation
|
269
|
+
# Live Environment
|
270
|
+
module Live
|
271
|
+
# Get Associated Property Use Meters
|
272
|
+
#
|
273
|
+
# This web service returns a list of meters that are associated to a
|
274
|
+
# specific property use.
|
275
|
+
#
|
276
|
+
# @param property_use_id [Integer]
|
277
|
+
# @return [PortfolioManager::Xml::MeterListType, PortfolioManager::Xml::ResponseType]
|
278
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
279
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
280
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/propertyUseAssociation/get
|
281
|
+
def get_associated_property_use_meters(property_use_id)
|
282
|
+
request(Net::HTTP::Get, path_for("association", "propertyUse", property_use_id, "meter"), {}, {}, nil, nil, PortfolioManager::Xml::MeterListType, basic_auth: true)
|
283
|
+
end
|
284
|
+
|
285
|
+
# Associate Meter to a Property Use
|
286
|
+
#
|
287
|
+
# This web service associates a single meter to a property use. You
|
288
|
+
# must have any of the following sharing permissions:
|
289
|
+
# - full access on the property and read only access on the meter
|
290
|
+
# - read only access on the property and full access on the meter
|
291
|
+
# - full access for both the property and meter
|
292
|
+
#
|
293
|
+
# Any other meters currently associated to the property use are
|
294
|
+
# unaffected.
|
295
|
+
#
|
296
|
+
# @param property_use_id [Integer]
|
297
|
+
# @param meter_id [Integer]
|
298
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
299
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
300
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
301
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/propertyUseAssociationSingle/post
|
302
|
+
def associate_meter_to_a_property_use(property_use_id, meter_id)
|
303
|
+
request(Net::HTTP::Post, path_for("association", "propertyUse", property_use_id, "meter", meter_id), {}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
304
|
+
end
|
305
|
+
|
306
|
+
# Associate Meters to a Property Use
|
307
|
+
#
|
308
|
+
# This web service associates a set of meters to a property use based
|
309
|
+
# on the set of meters provided in the XML request. All submissions
|
310
|
+
# overwrite/replace previous settings.
|
311
|
+
#
|
312
|
+
# @param property_use_id [Integer]
|
313
|
+
# @param meter_property_use_association_list [PortfolioManager::Xml::MeterListType]
|
314
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
315
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
316
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
317
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/propertyUseAssociation/post
|
318
|
+
def associate_meters_to_a_property_use(property_use_id, meter_property_use_association_list)
|
319
|
+
request(Net::HTTP::Post, path_for("association", "propertyUse", property_use_id, "meter"), {}, {}, meter_property_use_association_list, "meterPropertyUseAssociationList", PortfolioManager::Xml::ResponseType, basic_auth: true)
|
320
|
+
end
|
321
|
+
|
322
|
+
# Disassociate Meter from a Property Use
|
323
|
+
#
|
324
|
+
# This web service disassociates a specific meter from a given
|
325
|
+
# property use.
|
326
|
+
#
|
327
|
+
# @param property_use_id [Integer]
|
328
|
+
# @param meter_id [Integer]
|
329
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
330
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
331
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
332
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/propertyUseAssociation/delete
|
333
|
+
def disassociate_meter_from_a_property_use(property_use_id, meter_id)
|
334
|
+
request(Net::HTTP::Delete, path_for("association", "propertyUse", property_use_id, "meter", meter_id), {}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
335
|
+
end
|
336
|
+
end
|
337
|
+
|
338
|
+
# Test Environment
|
339
|
+
module Test
|
340
|
+
end
|
341
|
+
end
|
342
|
+
|
343
|
+
# Consumption Data
|
344
|
+
module ConsumptionData
|
345
|
+
# Live Environment
|
346
|
+
module Live
|
347
|
+
# Add Meter Consumption Data
|
348
|
+
#
|
349
|
+
# This web service adds consumption data to a specific meter based on
|
350
|
+
# the information provided in the XML request. It returns the unique
|
351
|
+
# identifier to each consumption data entry and a link to the
|
352
|
+
# corresponding web service to retrieve it. The meter must already be
|
353
|
+
# shared with you and you must have write access to the meter. This
|
354
|
+
# web service supports all meter types (i.e., electric, natural gas,
|
355
|
+
# water, IT, etc.). Green power information can also be added for
|
356
|
+
# renewable energy meter types. Demand tracking is also available for
|
357
|
+
# electric grid-purchase meters. A maximum of 120 consumption records
|
358
|
+
# is allowed.
|
359
|
+
#
|
360
|
+
# @param meter_id [Integer]
|
361
|
+
# @param meter_data [PortfolioManager::Xml::MeterDataType]
|
362
|
+
# @return [PortfolioManager::Xml::MeterDataType, PortfolioManager::Xml::ResponseType]
|
363
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
364
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
365
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/consumptionData/post
|
366
|
+
def add_meter_consumption_data(meter_id, meter_data)
|
367
|
+
request(Net::HTTP::Post, path_for("meter", meter_id, "consumptionData"), {}, {}, meter_data, "meterData", PortfolioManager::Xml::MeterDataType, basic_auth: true)
|
368
|
+
end
|
369
|
+
|
370
|
+
# Delete Consumption Data
|
371
|
+
#
|
372
|
+
# This web service deletes a specific consumption data. The
|
373
|
+
# corresponding meter must already be shared with you and you must
|
374
|
+
# have write access.
|
375
|
+
#
|
376
|
+
# @param consumption_data_id [Integer]
|
377
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
378
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
379
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
380
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/consumptionData/delete
|
381
|
+
def delete_consumption_data(consumption_data_id)
|
382
|
+
request(Net::HTTP::Delete, path_for("consumptionData", consumption_data_id), {}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
383
|
+
end
|
384
|
+
|
385
|
+
# Delete Meter Consumption Data
|
386
|
+
#
|
387
|
+
# This web service deletes consumption data from a specific meter
|
388
|
+
# based on a specified optional date range. The meter must already be
|
389
|
+
# shared to you and you must have read write access. This web service
|
390
|
+
# supports the following meter types; energy, water, data center IT,
|
391
|
+
# drinking/waste water flow. Deleting the consumption data is
|
392
|
+
# permanent and cannot be undone.
|
393
|
+
#
|
394
|
+
# @note If you misspell the "startDate" or "endDate" parameter then
|
395
|
+
# the resulting behavior is equivalent to if the parameter was
|
396
|
+
# omitted. For example, if you run this web service and misspelled
|
397
|
+
# both date range parameters then all of the consumption data for
|
398
|
+
# that meter will be deleted which is the default behavior.
|
399
|
+
#
|
400
|
+
# @param meter_id [Integer]
|
401
|
+
# @param start_date [nil, Date]
|
402
|
+
# @param end_date [nil, Date]
|
403
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
404
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
405
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
406
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/consumptionData/delete
|
407
|
+
def delete_meter_consumption_data(meter_id, start_date = nil, end_date = nil)
|
408
|
+
request(Net::HTTP::Delete, path_for("meter", meter_id, "consumptionData"), {
|
409
|
+
"startDate" => start_date.nil? ? nil : start_date.strftime("%Y-%m-%d"),
|
410
|
+
"endDate" => end_date.nil? ? nil : end_date.strftime("%Y-%m-%d"),
|
411
|
+
}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
412
|
+
end
|
413
|
+
|
414
|
+
# Edit Consumption Data
|
415
|
+
#
|
416
|
+
# This web service updates a specific meter consumption data record
|
417
|
+
# based on the information provided in the XML request. The
|
418
|
+
# corresponding meter must already be shared with you and you must
|
419
|
+
# have write access to the meter.
|
420
|
+
#
|
421
|
+
# @param consumption_data_id [Integer]
|
422
|
+
# @param meter_consumption [PortfolioManager::Xml::MeterConsumptionType]
|
423
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
424
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
425
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
426
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/consumptionData/put
|
427
|
+
def edit_consumption_data(consumption_data_id, meter_consumption)
|
428
|
+
request(Net::HTTP::Put, path_for("consumptionData", consumption_data_id), {}, {}, meter_consumption, "meterConsumption", PortfolioManager::Xml::ResponseType, basic_auth: true)
|
429
|
+
end
|
430
|
+
|
431
|
+
# Get ID Hierarchy for Consumption Data
|
432
|
+
#
|
433
|
+
# This web service returns the accountId, propertyId, and meterId that
|
434
|
+
# correspond to a specific consumption data record. The accountId
|
435
|
+
# returned is the Property Data Administrator (PDA). If the specified
|
436
|
+
# consumption data record refers to an IT meter or a plant flow meter,
|
437
|
+
# then the corresponding propertyUseId that is associated to the meter
|
438
|
+
# is also returned, otherwise it is omitted. The corresponding meter
|
439
|
+
# must already be shared with you or you must have pending share
|
440
|
+
# access.
|
441
|
+
#
|
442
|
+
# @param consumption_data_id [Integer]
|
443
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
444
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
445
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
446
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/consumptionData/put
|
447
|
+
def get_id_hierarchy_for_consumption_data(consumption_data_id)
|
448
|
+
request(Net::HTTP::Get, path_for("idHierarchy", "consumptionData", consumption_data_id), {}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
449
|
+
end
|
450
|
+
|
451
|
+
# Get Meter Consumption Data
|
452
|
+
#
|
453
|
+
# This web service retrieves consumption data for a specific meter.
|
454
|
+
# The meter must already be shared with you. The consumption data is
|
455
|
+
# returned in sets of 120. An optional date range can specified to
|
456
|
+
# return a certain set of consumption records.
|
457
|
+
#
|
458
|
+
# @param meter_id [Integer]
|
459
|
+
# @param page [Integer]
|
460
|
+
# @param start_date [nil, Date]
|
461
|
+
# @param end_date [nil, Date]
|
462
|
+
# @return [PortfolioManager::Xml::MeterDataType, PortfolioManager::Xml::ResponseType]
|
463
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
464
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
465
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/consumptionData/get
|
466
|
+
def get_meter_consumption_data(meter_id, page = 1, start_date = nil, end_date = nil)
|
467
|
+
request(Net::HTTP::Get, path_for("meter", meter_id, "consumptionData"), {
|
468
|
+
"page" => page,
|
469
|
+
"startDate" => start_date.nil? ? nil : start_date.strftime("%Y-%m-%d"),
|
470
|
+
"endDate" => end_date.nil? ? nil : end_date.strftime("%Y-%m-%d"),
|
471
|
+
}, {}, nil, nil, PortfolioManager::Xml::MeterDataType, basic_auth: true)
|
472
|
+
end
|
473
|
+
|
474
|
+
# Get What Changed Consumption Data Meter List
|
475
|
+
#
|
476
|
+
# This web service returns a list of meters that have had their
|
477
|
+
# consumption data changed since a user specified date. The list of
|
478
|
+
# meters returned are account specific. The returned list only shows
|
479
|
+
# meters that you have permission to view. Results are returned in
|
480
|
+
# increments of 1,000 per set. Consumption data edits that trigger a
|
481
|
+
# meter to be included in the returned list may have been performed by
|
482
|
+
# any user with write access to the meter. The list returns links to
|
483
|
+
# each meter's consumption data.
|
484
|
+
#
|
485
|
+
# @param customer_id [Integer]
|
486
|
+
# @param date [Date]
|
487
|
+
# @param next_page_key [nil, String]
|
488
|
+
# @param previous_page_key [nil, String]
|
489
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
490
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
491
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
492
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/consumptionDataGetWhatChanged/get
|
493
|
+
def get_what_changed_consumption_data_meter_list(customer_id, date, next_page_key = nil, previous_page_key = nil)
|
494
|
+
request(Net::HTTP::Get, path_for("customer", customer_id, "meter", "consumptionData", "whatChanged"), {
|
495
|
+
"date" => date.strftime("%Y-%m-%d"),
|
496
|
+
"nextPageKey" => next_page_key,
|
497
|
+
"previousPageKey" => previous_page_key,
|
498
|
+
}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
499
|
+
end
|
500
|
+
end
|
501
|
+
|
502
|
+
# Test Environment
|
503
|
+
module Test
|
504
|
+
end
|
505
|
+
end
|
506
|
+
|
507
|
+
# Waste Data
|
508
|
+
module WasteData
|
509
|
+
# Live Environment
|
510
|
+
module Live
|
511
|
+
# Add Meter Waste Data
|
512
|
+
#
|
513
|
+
# This web service adds waste data to a specific meter based on the
|
514
|
+
# information provided in the XML request. It returns the unique
|
515
|
+
# identifier to each waste data entry. The meter must already be
|
516
|
+
# shared with you and you must have write access to the meter. A
|
517
|
+
# maximum of 120 waste data records is allowed.
|
518
|
+
#
|
519
|
+
# @param meter_id [Integer]
|
520
|
+
# @param waste_data_list [PortfolioManager::Xml::WasteMeterDataType]
|
521
|
+
# @return [PortfolioManager::Xml::WasteMeterDataType, PortfolioManager::Xml::ResponseType]
|
522
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
523
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
524
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/wasteData/post
|
525
|
+
def add_meter_waste_data(meter_id, waste_data_list)
|
526
|
+
request(Net::HTTP::Post, path_for("meter", meter_id, "wasteData"), {}, {}, waste_data_list, "wasteDataList", PortfolioManager::Xml::WasteMeterDataType, basic_auth: true)
|
527
|
+
end
|
528
|
+
|
529
|
+
# Delete Waste Data
|
530
|
+
#
|
531
|
+
# This web service deletes a specific waste data. The corresponding
|
532
|
+
# meter must already be shared with you and you must have write
|
533
|
+
# access.
|
534
|
+
#
|
535
|
+
# @param waste_data_id [Integer]
|
536
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
537
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
538
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
539
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/wasteData/delete
|
540
|
+
def delete_waste_data(waste_data_id)
|
541
|
+
request(Net::HTTP::Delete, path_for("wasteData", waste_data_id), {}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
542
|
+
end
|
543
|
+
|
544
|
+
# Delete Meter Waste Data
|
545
|
+
#
|
546
|
+
# This web service deletes waste data from a specified meter based on
|
547
|
+
# a specified optional date range. The meter must already be shared to
|
548
|
+
# you and you must have read write access. This web service only
|
549
|
+
# supports waste meters. Deleting the waste data is permanent and
|
550
|
+
# cannot be undone.
|
551
|
+
#
|
552
|
+
# @note If you misspell the "startDate" or "endDate" parameter then
|
553
|
+
# the resulting behavior is equivalent to if the parameter was
|
554
|
+
# omitted. For example, if you run this web service and misspelled
|
555
|
+
# both date range parameters then all of the waste data for that
|
556
|
+
# meter will be deleted which is the default behavior.
|
557
|
+
#
|
558
|
+
# @param meter_id [Integer]
|
559
|
+
# @param start_date [nil, Date]
|
560
|
+
# @param end_date [nil, Date]
|
561
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
562
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
563
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
564
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/allWasteData/delete
|
565
|
+
def delete_meter_waste_data(meter_id, start_date = nil, end_date = nil)
|
566
|
+
request(Net::HTTP::Delete, path_for("meter", meter_id, "wasteData"), {
|
567
|
+
"startDate" => start_date.nil? ? nil : start_date.strftime("%Y-%m-%d"),
|
568
|
+
"endDate" => end_date.nil? ? nil : end_date.strftime("%Y-%m-%d"),
|
569
|
+
}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
570
|
+
end
|
571
|
+
|
572
|
+
# Edit Waste Data
|
573
|
+
#
|
574
|
+
# This web service updates a specific waste meter data record based on
|
575
|
+
# the information provided in the XML request. The corresponding meter
|
576
|
+
# must already be shared with you and you must have write access to
|
577
|
+
# the meter.
|
578
|
+
#
|
579
|
+
# @param waste_data_id [Integer]
|
580
|
+
# @param waste_data [PortfolioManager::Xml::WasteMeterEntryType]
|
581
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
582
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
583
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
584
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/wasteData/put
|
585
|
+
def edit_waste_data(waste_data_id, waste_data)
|
586
|
+
request(Net::HTTP::Put, path_for("wasteData", waste_data_id), {}, {}, waste_data, "wasteData", PortfolioManager::Xml::ResponseType, basic_auth: true)
|
587
|
+
end
|
588
|
+
|
589
|
+
# Get ID Hierarchy for Waste Data
|
590
|
+
#
|
591
|
+
# This web service returns the accountId, propertyId, and meterId that
|
592
|
+
# correspond to a specific waste data record. The accountId returned
|
593
|
+
# is the Property Data Administrator (PDA). The corresponding meter
|
594
|
+
# must already be shared with you or you must have pending share
|
595
|
+
# access.
|
596
|
+
#
|
597
|
+
# @param waste_data_id [Integer]
|
598
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
599
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
600
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
601
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/wasteDataHierarchy/get
|
602
|
+
def get_id_hierarchy_for_waste_data(waste_data_id)
|
603
|
+
request(Net::HTTP::Get, path_for("idHierarchy", "wasteData", waste_data_id), {}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
604
|
+
end
|
605
|
+
|
606
|
+
# Get Meter Waste Data
|
607
|
+
#
|
608
|
+
# This web service retrieves waste data for a specific meter. The
|
609
|
+
# meter must already be shared with you. The waste data is returned in
|
610
|
+
# sets of 120. An optional date range can be specified to return a
|
611
|
+
# certain set of waste data records.
|
612
|
+
#
|
613
|
+
# @param meter_id [Integer]
|
614
|
+
# @param page [Integer]
|
615
|
+
# @param start_date [nil, Date]
|
616
|
+
# @param end_date [nil, Date]
|
617
|
+
# @return [PortfolioManager::Xml::WasteMeterDataType, PortfolioManager::Xml::ResponseType]
|
618
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
619
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
620
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/wasteData/get
|
621
|
+
def get_meter_waste_data(meter_id, page = 1, start_date = nil, end_date = nil)
|
622
|
+
request(Net::HTTP::Get, path_for("meter", meter_id, "wasteData"), {
|
623
|
+
"page" => page,
|
624
|
+
"startDate" => start_date.nil? ? nil : start_date.strftime("%Y-%m-%d"),
|
625
|
+
"endDate" => end_date.nil? ? nil : end_date.strftime("%Y-%m-%d"),
|
626
|
+
}, {}, nil, nil, PortfolioManager::Xml::WasteMeterDataType, basic_auth: true)
|
627
|
+
end
|
628
|
+
|
629
|
+
# Get What Changed Waste Data Meter List
|
630
|
+
#
|
631
|
+
# This web service returns a list of waste meters that have had their
|
632
|
+
# consumption data changed since a user specified date. The list of
|
633
|
+
# waste meters returned are account specific. The returned list only
|
634
|
+
# shows waste meters that you have permission to view. Results are
|
635
|
+
# returned in increments of 1,000 per set. Waste data edits that
|
636
|
+
# trigger a waste meter to be included in the returned list may have
|
637
|
+
# been performed by any user with write access to the meter. The list
|
638
|
+
# returns links to each meter's waste data.
|
639
|
+
#
|
640
|
+
# @param customer_id [Integer]
|
641
|
+
# @param date [Date]
|
642
|
+
# @param next_page_key [nil, String]
|
643
|
+
# @param previous_page_key [nil, String]
|
644
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
645
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
646
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
647
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/wasteDataGetWhatChanged/get
|
648
|
+
def get_what_changed_waste_data_meter_list(customer_id, date, next_page_key = nil, previous_page_key = nil)
|
649
|
+
request(Net::HTTP::Get, path_for("customer", customer_id, "meter", "wasteData", "whatChanged"), {
|
650
|
+
"date" => date.strftime("%Y-%m-%d"),
|
651
|
+
"nextPageKey" => next_page_key,
|
652
|
+
"previousPageKey" => previous_page_key,
|
653
|
+
}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
654
|
+
end
|
655
|
+
end
|
656
|
+
|
657
|
+
# Test Environment
|
658
|
+
module Test
|
659
|
+
end
|
660
|
+
end
|
661
|
+
|
662
|
+
# Unique Identifiers
|
663
|
+
module UniqueIdentifiers
|
664
|
+
# Live Environment
|
665
|
+
module Live
|
666
|
+
# Add Meter Identifier Value
|
667
|
+
#
|
668
|
+
# This web service adds a name and value to a specific additional
|
669
|
+
# meter identifier for a given meter based on the information provided
|
670
|
+
# in the XML request.
|
671
|
+
#
|
672
|
+
# @param meter_id [Integer]
|
673
|
+
# @param additional_identifier [PortfolioManager::Xml::AdditionalIdentifier]
|
674
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
675
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
676
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
677
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/identifier/post
|
678
|
+
def add_meter_identifier_value(meter_id, additional_identifier)
|
679
|
+
request(Net::HTTP::Post, path_for("meter", meter_id, "identifier"), {}, {}, additional_identifier, "additionalIdentifier", PortfolioManager::Xml::ResponseType, basic_auth: true)
|
680
|
+
end
|
681
|
+
|
682
|
+
# Delete Meter Identifier Value
|
683
|
+
#
|
684
|
+
# This web service deletes the meter identifier value for a specific
|
685
|
+
# meter and meter identifier.
|
686
|
+
#
|
687
|
+
# @param meter_id [Integer]
|
688
|
+
# @param identifier_id [Integer]
|
689
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
690
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
691
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
692
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/identifier/delete
|
693
|
+
def delete_meter_identifier_value(meter_id, identifier_id)
|
694
|
+
request(Net::HTTP::Delete, path_for("meter", meter_id, "identifier", identifier_id), {}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
695
|
+
end
|
696
|
+
|
697
|
+
# Edit Meter Identifier Value
|
698
|
+
#
|
699
|
+
# This web service updates the meter identifier value for a specific
|
700
|
+
# meter based on the information provided in the XML request.
|
701
|
+
#
|
702
|
+
# @param meter_id [Integer]
|
703
|
+
# @param identifier_id [Integer]
|
704
|
+
# @param additional_identifier [PortfolioManager::Xml::AdditionalIdentifier]
|
705
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
706
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
707
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
708
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/identifier/put
|
709
|
+
def edit_meter_identifier_value(meter_id, identifier_id, additional_identifier)
|
710
|
+
request(Net::HTTP::Put, path_for("meter", meter_id, "identifier", identifier_id), {}, {}, additional_identifier, "additionalIdentifier", PortfolioManager::Xml::ResponseType, basic_auth: true)
|
711
|
+
end
|
712
|
+
|
713
|
+
# Get All Meter Identifier List
|
714
|
+
#
|
715
|
+
# This web service retrieves a list of all of the unique identifiers
|
716
|
+
# for all meters in a specified property. These identifiers are used
|
717
|
+
# to provide additional information on a meter. You must have at least
|
718
|
+
# read only access on the meter to view the unique identifiers.
|
719
|
+
#
|
720
|
+
# @param property_id [Integer]
|
721
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
722
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
723
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
724
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/identifierList/get
|
725
|
+
def get_all_meter_identifier_list(property_id)
|
726
|
+
request(Net::HTTP::Get, path_for("property", property_id, "meter", "identifier", "list"), {}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
727
|
+
end
|
728
|
+
|
729
|
+
# Get Meter Identifier List
|
730
|
+
#
|
731
|
+
# This web service retrieves a list of all of the standard and unique
|
732
|
+
# identifiers that are currently approved for use by EPA. These
|
733
|
+
# identifiers are used to provide additional information on a meter.
|
734
|
+
#
|
735
|
+
# @return [PortfolioManager::Xml::AdditionalIdentifierTypes, PortfolioManager::Xml::ResponseType]
|
736
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
737
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
738
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/meterIdentifierList/get
|
739
|
+
def get_meter_identifier_list
|
740
|
+
request(Net::HTTP::Get, path_for("meter", "identifier", "list"), {}, {}, nil, nil, PortfolioManager::Xml::AdditionalIdentifierTypes, basic_auth: true)
|
741
|
+
end
|
742
|
+
|
743
|
+
# Get Meter Identifier Value
|
744
|
+
#
|
745
|
+
# This web service retrieves the meter identifier value for a specific
|
746
|
+
# meter and meter identifier.
|
747
|
+
#
|
748
|
+
# @param meter_id [Integer]
|
749
|
+
# @param identifier_id [Integer]
|
750
|
+
# @return [PortfolioManager::Xml::AdditionalIdentifier, PortfolioManager::Xml::ResponseType]
|
751
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
752
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
753
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/identifier/get
|
754
|
+
def get_meter_identifier_value(meter_id, identifier_id)
|
755
|
+
request(Net::HTTP::Get, path_for("meter", meter_id, "identifier", identifier_id), {}, {}, nil, nil, PortfolioManager::Xml::AdditionalIdentifier, basic_auth: true)
|
756
|
+
end
|
757
|
+
|
758
|
+
# Get Meter Identifier Value List
|
759
|
+
#
|
760
|
+
# This web service retrieves a list of meter identifier values for a
|
761
|
+
# specific meter specified in the URL.
|
762
|
+
#
|
763
|
+
# @param meter_id [Integer]
|
764
|
+
# @return [PortfolioManager::Xml::AdditionalIdentifiers, PortfolioManager::Xml::ResponseType]
|
765
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
766
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
767
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/identifierListForProperty/get
|
768
|
+
def get_meter_identifier_value_list(meter_id)
|
769
|
+
request(Net::HTTP::Get, path_for("meter", meter_id, "identifier", "list"), {}, {}, nil, nil, PortfolioManager::Xml::AdditionalIdentifiers, basic_auth: true)
|
770
|
+
end
|
771
|
+
end
|
772
|
+
|
773
|
+
# Test Environment
|
774
|
+
module Test
|
775
|
+
end
|
776
|
+
end
|
777
|
+
|
778
|
+
# Meter Aggregation
|
779
|
+
module MeterAggregation
|
780
|
+
# Live Environment
|
781
|
+
module Live
|
782
|
+
# Add Individual Meter to Aggregated Meter
|
783
|
+
#
|
784
|
+
# This web service adds an individual meter to be included in the
|
785
|
+
# total for the aggregate meter. The aggregate meter must already be
|
786
|
+
# shared with you and you must have write access.
|
787
|
+
#
|
788
|
+
# @param meter_id [Integer]
|
789
|
+
# @param individual_meter [PortfolioManager::Xml::IndividualMeter]
|
790
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
791
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
792
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
793
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/individual/post
|
794
|
+
def add_individual_meter_to_aggregated_meter(meter_id, individual_meter)
|
795
|
+
request(Net::HTTP::Post, path_for("meter", meter_id, "individual"), {}, {}, individual_meter, "individualMeter", PortfolioManager::Xml::ResponseType, basic_auth: true)
|
796
|
+
end
|
797
|
+
|
798
|
+
# Delete All Individual Meters of an Aggregate Meter
|
799
|
+
#
|
800
|
+
# This web service deletes all information of individual meters that
|
801
|
+
# are included in the total for the aggregate meter. The aggregate
|
802
|
+
# meter must already be shared with you and you must have write
|
803
|
+
# access.
|
804
|
+
#
|
805
|
+
# @param meter_id [Integer]
|
806
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
807
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
808
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
809
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/aggregationList/delete
|
810
|
+
def delete_all_individual_meters_of_an_aggregate_meter(meter_id)
|
811
|
+
request(Net::HTTP::Delete, path_for("meter", meter_id, "individual"), {}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
812
|
+
end
|
813
|
+
|
814
|
+
# Delete Individual Meter of an Aggregated Meter
|
815
|
+
#
|
816
|
+
# This web service deletes information for an individual meter that is
|
817
|
+
# included in the total for the aggregate meter. The aggregate meter
|
818
|
+
# must already be shared with you and you must have write access.
|
819
|
+
#
|
820
|
+
# @param individual_meter_id [Integer]
|
821
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
822
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
823
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
824
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/individual/delete
|
825
|
+
def delete_individual_meter_of_an_aggregated_meter(individual_meter_id)
|
826
|
+
request(Net::HTTP::Delete, path_for("meter", "individual", individual_meter_id), {}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
827
|
+
end
|
828
|
+
|
829
|
+
# Get Individual Meter of an Aggregated Meter
|
830
|
+
#
|
831
|
+
# This web service retrieves information for an individual meter that
|
832
|
+
# is included in the total for the aggregate meter. The aggregate
|
833
|
+
# meter must already be shared with you.
|
834
|
+
#
|
835
|
+
# @param individual_meter_id [Integer]
|
836
|
+
# @return [PortfolioManager::Xml::IndividualMeter, PortfolioManager::Xml::ResponseType]
|
837
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
838
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
839
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/individual/get
|
840
|
+
def get_individual_meter_of_an_aggregated_meter(individual_meter_id)
|
841
|
+
request(Net::HTTP::Get, path_for("meter", "individual", individual_meter_id), {}, {}, nil, nil, PortfolioManager::Xml::IndividualMeter, basic_auth: true)
|
842
|
+
end
|
843
|
+
|
844
|
+
# Get Meter Aggregation Indicator
|
845
|
+
#
|
846
|
+
# This web service retrieves information on whether the specified
|
847
|
+
# meter represents an aggregation of multiple meters or not. It will
|
848
|
+
# also include the information that the existing {PortfolioManager::Services::Meter::Meter::Live#get_meter Get Meter}
|
849
|
+
# web service returns. The meter must already be shared with you.
|
850
|
+
#
|
851
|
+
# @note This web service is available because the aggregateMeter
|
852
|
+
# element cannot be added to the existing {PortfolioManager::Services::Meter::Meter::Live#get_meter Get Meter}
|
853
|
+
# web service schema until the 17.0 release (summer 2021). Until
|
854
|
+
# then, this service allows for backwards compatibility and informs
|
855
|
+
# whether the meter is marked as an aggregate or not.
|
856
|
+
#
|
857
|
+
# @param meter_id [Integer]
|
858
|
+
# @return [PortfolioManager::Xml::MeterType, PortfolioManager::Xml::ResponseType]
|
859
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
860
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
861
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/aggregation/get
|
862
|
+
def get_meter_aggregation_indicator(meter_id)
|
863
|
+
request(Net::HTTP::Get, path_for("meter", meter_id, "aggregateMeter"), {}, {}, nil, nil, PortfolioManager::Xml::MeterType, basic_auth: true)
|
864
|
+
end
|
865
|
+
|
866
|
+
# Get Meter Aggregation List
|
867
|
+
#
|
868
|
+
# This web service retrieves a list of all individual meters that are
|
869
|
+
# aggregated into the specified meter. The meter must already be
|
870
|
+
# shared with you.
|
871
|
+
#
|
872
|
+
# @param meter_id [Integer]
|
873
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
874
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
875
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
876
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/aggregationList/get
|
877
|
+
def get_meter_aggregation_list(meter_id)
|
878
|
+
request(Net::HTTP::Get, path_for("meter", meter_id, "individual", "list"), {}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
879
|
+
end
|
880
|
+
|
881
|
+
# Update Individual Meter of an Aggregated Meter
|
882
|
+
#
|
883
|
+
# This web service updates information for an individual meter that is
|
884
|
+
# included in the total for the aggregate meter. The aggregate meter
|
885
|
+
# must already be shared with you and you must have write access.
|
886
|
+
#
|
887
|
+
# @param individual_meter_id [Integer]
|
888
|
+
# @param individual_meter [PortfolioManager::Xml::IndividualMeter]
|
889
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
890
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
891
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
892
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/individual/put
|
893
|
+
def update_individual_meter_of_aggregated_meter(individual_meter_id, individual_meter)
|
894
|
+
request(Net::HTTP::Put, path_for("meter", "individual", individual_meter_id), {}, {}, individual_meter, "individualMeter", PortfolioManager::Xml::ResponseType, basic_auth: true)
|
895
|
+
end
|
896
|
+
end
|
897
|
+
|
898
|
+
# Test Environment
|
899
|
+
module Test
|
900
|
+
end
|
901
|
+
end
|
902
|
+
|
903
|
+
# Miscellaneous
|
904
|
+
module Miscellaneous
|
905
|
+
# Live Environment
|
906
|
+
module Live
|
907
|
+
# Get Meter Custom Field Values
|
908
|
+
#
|
909
|
+
# This web service returns a list of custom fields and their values
|
910
|
+
# for a specific meter.
|
911
|
+
#
|
912
|
+
# @param meter_id [Integer]
|
913
|
+
# @return [PortfolioManager::Xml::CustomFieldList, PortfolioManager::Xml::ResponseType]
|
914
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
915
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
916
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/meter/customFieldValues/get
|
917
|
+
def get_meter_custom_field_values(meter_id)
|
918
|
+
request(Net::HTTP::Get, path_for("meter", meter_id, "customFieldList"), {}, {}, nil, nil, PortfolioManager::Xml::CustomFieldList, basic_auth: true)
|
919
|
+
end
|
920
|
+
end
|
921
|
+
|
922
|
+
# Test Environment
|
923
|
+
module Test
|
924
|
+
end
|
925
|
+
end
|
926
|
+
|
927
|
+
# All Services
|
928
|
+
module All
|
929
|
+
# Live Environment
|
930
|
+
module Live
|
931
|
+
include PortfolioManager::Services::Meter::Meter::Live
|
932
|
+
include PortfolioManager::Services::Meter::PropertyMeterAssociation::Live
|
933
|
+
include PortfolioManager::Services::Meter::PropertyUseMeterAssociation::Live
|
934
|
+
include PortfolioManager::Services::Meter::ConsumptionData::Live
|
935
|
+
include PortfolioManager::Services::Meter::WasteData::Live
|
936
|
+
include PortfolioManager::Services::Meter::UniqueIdentifiers::Live
|
937
|
+
include PortfolioManager::Services::Meter::MeterAggregation::Live
|
938
|
+
include PortfolioManager::Services::Meter::Miscellaneous::Live
|
939
|
+
end
|
940
|
+
|
941
|
+
# Test Environment
|
942
|
+
module Test
|
943
|
+
include PortfolioManager::Services::Meter::Meter::Test
|
944
|
+
include PortfolioManager::Services::Meter::PropertyMeterAssociation::Test
|
945
|
+
include PortfolioManager::Services::Meter::PropertyUseMeterAssociation::Test
|
946
|
+
include PortfolioManager::Services::Meter::ConsumptionData::Test
|
947
|
+
include PortfolioManager::Services::Meter::WasteData::Test
|
948
|
+
include PortfolioManager::Services::Meter::UniqueIdentifiers::Test
|
949
|
+
include PortfolioManager::Services::Meter::MeterAggregation::Test
|
950
|
+
include PortfolioManager::Services::Meter::Miscellaneous::Test
|
951
|
+
end
|
952
|
+
end
|
953
|
+
end
|
954
|
+
end
|
955
|
+
end
|