portfoliomanager-rb 0.0.6 → 0.0.7
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 +4 -4
- data/CHANGELOG.md +20 -0
- data/Gemfile.lock +1 -1
- data/lib/portfolio_manager/client.rb +2 -1
- data/lib/portfolio_manager/services/basic_account.rb +5 -5
- data/lib/portfolio_manager/services/home_energy_yardstick.rb +1 -1
- data/lib/portfolio_manager/services/property.rb +127 -0
- data/lib/portfolio_manager/services/property_use.rb +5 -5
- data/lib/portfolio_manager/services/reporting.rb +13 -11
- data/lib/portfolio_manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96b9ef75d20a06c5b4b2f044194edd2f4acdf7fdb2da8c722bbc1f1d44813141
|
4
|
+
data.tar.gz: 2fa42c27c5070a90c39c44124dca00efa75bcfb8c4a61685a80b072350f641a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f16514cf4ed04d006e73ddc249ac9cbaa213b9eaf68679aa6a687a4f50400459c009efe43f8d483bbe5eb44c5aa0b33aca343f3c924f583bb8c405f1b2e2dd9
|
7
|
+
data.tar.gz: 0ca1376fb8a2cefc90ed1057d5f22ac1de50d887094344e8b561191dc1c53972ad7346efa978254cf47fa343d7eb93251a1665d35f242e507de84462015d8857
|
data/CHANGELOG.md
CHANGED
@@ -8,25 +8,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
10
|
## [0.0.1] - 2022-02-23
|
11
|
+
|
11
12
|
### Added
|
12
13
|
- Initial commit.
|
13
14
|
|
14
15
|
## [0.0.2] - 2023-11-17
|
16
|
+
|
15
17
|
### Changed
|
16
18
|
- Update from v18 to v21.
|
17
19
|
|
18
20
|
## [0.0.3] - 2024-05-13
|
21
|
+
|
22
|
+
### Changed
|
19
23
|
- Update from v21 to v22.
|
20
24
|
|
21
25
|
## [0.0.4] - 2024-05-14
|
26
|
+
|
27
|
+
### Changed
|
22
28
|
- Fix return value classes for `PortfolioManager::Services::Connection::ConnectionShare::Live#accept_reject_pending_connection_requests`, `PortfolioManager::Services::Connection::ConnectionShare::Live#accept_reject_pending_meter_share_requests`, and `PortfolioManager::Services::Connection::ConnectionShare::Live#accept_reject_pending_property_share_requests` methods.
|
23
29
|
|
24
30
|
## [0.0.5] - 2024-05-15
|
31
|
+
|
32
|
+
### Changed
|
25
33
|
- Force encoding of HTTP response body to be UTF-8.
|
26
34
|
|
27
35
|
## [0.0.6] - 2024-05-16
|
36
|
+
|
37
|
+
### Added
|
28
38
|
- Add support for proxy servers.
|
29
39
|
|
40
|
+
## [0.0.7] - 2024-05-31
|
41
|
+
|
42
|
+
### Added
|
43
|
+
- Add "Custom Metrics" web services to "Property Services" (added in v22).
|
44
|
+
|
45
|
+
### Changed
|
46
|
+
- Fix error handling in `PortfolioManager::Client::Base#request`.
|
47
|
+
- Fix return value classes for `PortfolioManager::Xml::ResponseType`.
|
48
|
+
|
30
49
|
[Unreleased]: https://github.com/pnnl/portfoliomanager-rb/compare/v0.0.1...HEAD
|
31
50
|
[0.0.1]: https://github.com/pnnl/portfoliomanager-rb/releases/tag/v0.0.1
|
32
51
|
[0.0.2]: https://github.com/pnnl/portfoliomanager-rb/releases/tag/v0.0.2
|
@@ -34,3 +53,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
34
53
|
[0.0.4]: https://github.com/pnnl/portfoliomanager-rb/releases/tag/v0.0.4
|
35
54
|
[0.0.5]: https://github.com/pnnl/portfoliomanager-rb/releases/tag/v0.0.5
|
36
55
|
[0.0.6]: https://github.com/pnnl/portfoliomanager-rb/releases/tag/v0.0.6
|
56
|
+
[0.0.7]: https://github.com/pnnl/portfoliomanager-rb/releases/tag/v0.0.7
|
data/Gemfile.lock
CHANGED
@@ -85,6 +85,7 @@ module PortfolioManager
|
|
85
85
|
# @return [Object]
|
86
86
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
87
87
|
# @raise [PortfolioManager::HTTPResponseError]
|
88
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/errors
|
88
89
|
def request(verb = Net::HTTP::Get, path = "/", params = {}, initheader = {}, obj = nil, elename = nil, klass = nil, **options)
|
89
90
|
uri = url_for(path, params)
|
90
91
|
|
@@ -138,7 +139,7 @@ module PortfolioManager
|
|
138
139
|
}.join("\n")) if @debug
|
139
140
|
|
140
141
|
if response_body_utf8.start_with?("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>")
|
141
|
-
PortfolioManager::Mapper.instance.xml2obj(response_body_utf8, klass)
|
142
|
+
PortfolioManager::Mapper.instance.xml2obj(response_body_utf8, response.code.start_with?("2") ? klass : PortfolioManager::Xml::ResponseType)
|
142
143
|
else
|
143
144
|
raise PortfolioManager::HTTPResponseError.new(response)
|
144
145
|
end
|
@@ -85,7 +85,7 @@ module PortfolioManager
|
|
85
85
|
# This web service retrieves your account information that includes
|
86
86
|
# your username, password, and contact information.
|
87
87
|
#
|
88
|
-
# @return [PortfolioManager::Xml::AccountType]
|
88
|
+
# @return [PortfolioManager::Xml::AccountType, PortfolioManager::Xml::ResponseType]
|
89
89
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
90
90
|
# @raise [PortfolioManager::HTTPResponseError]
|
91
91
|
# @see https://portfoliomanager.energystar.gov/webservices/home/api/account/account/get
|
@@ -100,7 +100,7 @@ module PortfolioManager
|
|
100
100
|
# billboard display, see the "Account" and "Property" documentation
|
101
101
|
# sections.
|
102
102
|
#
|
103
|
-
# @return [PortfolioManager::Xml::BillboardMetricsType]
|
103
|
+
# @return [PortfolioManager::Xml::BillboardMetricsType, PortfolioManager::Xml::ResponseType]
|
104
104
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
105
105
|
# @raise [PortfolioManager::HTTPResponseError]
|
106
106
|
# @see https://portfoliomanager.energystar.gov/webservices/home/api/account/billboardMetricList/get
|
@@ -160,7 +160,7 @@ module PortfolioManager
|
|
160
160
|
# identifier to the newly created account and a link to the
|
161
161
|
# corresponding web service to retrieve it.
|
162
162
|
#
|
163
|
-
# @param account [PortfolioManager::Xml::AccountType
|
163
|
+
# @param account [PortfolioManager::Xml::AccountType]
|
164
164
|
# @return [PortfolioManager::Xml::ResponseType]
|
165
165
|
# @raise [PortfolioManager::HTTPResponseError]
|
166
166
|
# @see https://portfoliomanager.energystar.gov/webservices/home/test/api/account/account/post
|
@@ -181,7 +181,7 @@ module PortfolioManager
|
|
181
181
|
# Note that there is no validation performed on the specified display
|
182
182
|
# order.
|
183
183
|
#
|
184
|
-
# @param custom_field [PortfolioManager::Xml::CustomField
|
184
|
+
# @param custom_field [PortfolioManager::Xml::CustomField]
|
185
185
|
# @return [PortfolioManager::Xml::ResponseType]
|
186
186
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
187
187
|
# @raise [PortfolioManager::HTTPResponseError]
|
@@ -268,7 +268,7 @@ module PortfolioManager
|
|
268
268
|
# data exchange service offerings such as terms and conditions,
|
269
269
|
# supported fuel types, etc.
|
270
270
|
#
|
271
|
-
# @return [PortfolioManager::Xml::DataExchangeSettings]
|
271
|
+
# @return [PortfolioManager::Xml::DataExchangeSettings, PortfolioManager::Xml::ResponseType]
|
272
272
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
273
273
|
# @raise [PortfolioManager::HTTPResponseError]
|
274
274
|
# @see https://portfoliomanager.energystar.gov/webservices/home/api/account/settings/get
|
@@ -38,7 +38,7 @@ module PortfolioManager
|
|
38
38
|
# - Wood
|
39
39
|
#
|
40
40
|
# @param hey [PortfolioManager::Xml::HeyType]
|
41
|
-
# @return [PortfolioManager::Xml::PropertyMetricsType]
|
41
|
+
# @return [PortfolioManager::Xml::PropertyMetricsType, PortfolioManager::Xml::ResponseType]
|
42
42
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
43
43
|
# @raise [PortfolioManager::HTTPResponseError]
|
44
44
|
# @see https://portfoliomanager.energystar.gov/webservices/home/api/hey/hey/post
|
@@ -169,6 +169,131 @@ module PortfolioManager
|
|
169
169
|
end
|
170
170
|
end
|
171
171
|
|
172
|
+
# Custom Metrics
|
173
|
+
module CustomMetrics
|
174
|
+
# Live Environment
|
175
|
+
module Live
|
176
|
+
# Get Custom Metrics
|
177
|
+
#
|
178
|
+
# This web service returns a list of custom metrics for a specific
|
179
|
+
# property. A maximum of 3 custom metrics per property can be defined.
|
180
|
+
# The property must already be shared with you.
|
181
|
+
#
|
182
|
+
# @param property_id [Integer]
|
183
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
184
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
185
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
186
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/property/customMetrics/get
|
187
|
+
def get_custom_metrics(property_id)
|
188
|
+
request(Net::HTTP::Get, path_for("property", property_id, "customMetrics"), {}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
189
|
+
end
|
190
|
+
|
191
|
+
# Get Custom Metric
|
192
|
+
#
|
193
|
+
# This web service returns information for a specific custom metric
|
194
|
+
# for a given property. The property must already be shared with you.
|
195
|
+
#
|
196
|
+
# @param property_id [Integer]
|
197
|
+
# @param custom_metric_slot [Integer]
|
198
|
+
# @return [PortfolioManager::Xml::CustomMetric, PortfolioManager::Xml::ResponseType]
|
199
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
200
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
201
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/property/customMetric/get
|
202
|
+
def get_custom_metric(property_id, custom_metric_slot)
|
203
|
+
request(Net::HTTP::Get, path_for("property", property_id, "customMetrics", custom_metric_slot), {}, {}, nil, nil, PortfolioManager::Xml::CustomMetric, basic_auth: true)
|
204
|
+
end
|
205
|
+
|
206
|
+
# Add Custom Metric
|
207
|
+
#
|
208
|
+
# This web service adds a new custom metric based on the information
|
209
|
+
# provided in the XML request for a specified property. The property
|
210
|
+
# must already be shared with you. A maximum of 3 custom metrics per
|
211
|
+
# property can be defined.
|
212
|
+
#
|
213
|
+
# @param property_id [Integer]
|
214
|
+
# @param custom_metric_slot [Integer]
|
215
|
+
# @param custom_metric [PortfolioManager::Xml::CustomMetric]
|
216
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
217
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
218
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
219
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/property/customMetric/post
|
220
|
+
def add_custom_metric(property_id, custom_metric_slot, custom_metric)
|
221
|
+
request(Net::HTTP::Post, path_for("property", property_id, "customMetrics", custom_metric_slot), {}, {}, custom_metric, "customMetric", PortfolioManager::Xml::ResponseType, basic_auth: true)
|
222
|
+
end
|
223
|
+
|
224
|
+
# Edit Custom Metric
|
225
|
+
#
|
226
|
+
# This web service updates a specific custom metric based on the
|
227
|
+
# information provided in the XML request for a given property. The
|
228
|
+
# property must already be shared with you.
|
229
|
+
#
|
230
|
+
# @param property_id [Integer]
|
231
|
+
# @param custom_metric_slot [Integer]
|
232
|
+
# @param custom_metric [PortfolioManager::Xml::CustomMetric]
|
233
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
234
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
235
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
236
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/property/customMetric/put
|
237
|
+
def edit_custom_metric(property_id, custom_metric_slot, custom_metric)
|
238
|
+
request(Net::HTTP::Put, path_for("property", property_id, "customMetrics", custom_metric_slot), {}, {}, custom_metric, "customMetric", PortfolioManager::Xml::ResponseType, basic_auth: true)
|
239
|
+
end
|
240
|
+
|
241
|
+
# Delete Custom Metric
|
242
|
+
#
|
243
|
+
# This web service deletes a specific custom metric for a given
|
244
|
+
# property. The property must already be shared with you.
|
245
|
+
#
|
246
|
+
# @param property_id [Integer]
|
247
|
+
# @param custom_metric_slot [Integer]
|
248
|
+
# @return [PortfolioManager::Xml::ResponseType]
|
249
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
250
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
251
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/property/customMetric/delete
|
252
|
+
def delete_custom_metric(property_id, custom_metric_slot)
|
253
|
+
request(Net::HTTP::Delete, path_for("property", property_id, "customMetrics", custom_metric_slot), {}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
|
254
|
+
end
|
255
|
+
|
256
|
+
# Get Available Property Use Details (for Custom Metrics)
|
257
|
+
#
|
258
|
+
# This web service returns a list of all the property use details of a
|
259
|
+
# given property that can be used to define in a custom metric (the
|
260
|
+
# denominator of a custom metric). The property must already be shared
|
261
|
+
# with you.
|
262
|
+
#
|
263
|
+
# @param property_id [Integer]
|
264
|
+
# @return [PortfolioManager::Xml::DetailsTypes, PortfolioManager::Xml::ResponseType]
|
265
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
266
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
267
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/property/availablePropertyUseDetails/get
|
268
|
+
def get_available_property_use_details_for_custom_metrics(property_id)
|
269
|
+
request(Net::HTTP::Get, path_for("property", property_id, "customMetrics", "availablePropertyUseDetails"), {}, {}, nil, nil, PortfolioManager::Xml::DetailsTypes, basic_auth: true)
|
270
|
+
end
|
271
|
+
|
272
|
+
# Get Available Metrics List
|
273
|
+
#
|
274
|
+
# This web service returns a list of all available metrics that can be
|
275
|
+
# used to define in a custom metric (the numerator of a custom
|
276
|
+
# metric).
|
277
|
+
#
|
278
|
+
# @param group_ids [nil, Array<Integer>]
|
279
|
+
# @param available_to_custom_metrics [nil, Boolean]
|
280
|
+
# @return [PortfolioManager::Xml::ReportMetrics, PortfolioManager::Xml::ResponseType]
|
281
|
+
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
282
|
+
# @raise [PortfolioManager::HTTPResponseError]
|
283
|
+
# @see https://portfoliomanager.energystar.gov/webservices/home/api/property/availableMetricsList/get
|
284
|
+
def get_available_metrics_list(group_ids = nil, available_to_custom_metrics = nil)
|
285
|
+
request(Net::HTTP::Get, path_for("reports", "metrics"), {
|
286
|
+
"groupIds" => (group_ids.nil? || group_ids.empty?) ? nil : group_ids.collect(&:to_s).join(","),
|
287
|
+
"availableToCustomMetrics" => available_to_custom_metrics,
|
288
|
+
}, {}, nil, nil, PortfolioManager::Xml::ReportMetrics, basic_auth: true)
|
289
|
+
end
|
290
|
+
end
|
291
|
+
|
292
|
+
# Test Environment
|
293
|
+
module Test
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
172
297
|
# Design
|
173
298
|
module Design
|
174
299
|
# Live Environment
|
@@ -929,6 +1054,7 @@ module PortfolioManager
|
|
929
1054
|
module Live
|
930
1055
|
include PortfolioManager::Services::Property::Property::Live
|
931
1056
|
include PortfolioManager::Services::Property::Design::Live
|
1057
|
+
include PortfolioManager::Services::Property::CustomMetrics::Live
|
932
1058
|
include PortfolioManager::Services::Property::ElectricDistributionUtility::Live
|
933
1059
|
include PortfolioManager::Services::Property::PowerGenerationPlant::Live
|
934
1060
|
include PortfolioManager::Services::Property::InternationalWeatherStation::Live
|
@@ -941,6 +1067,7 @@ module PortfolioManager
|
|
941
1067
|
module Test
|
942
1068
|
include PortfolioManager::Services::Property::Property::Test
|
943
1069
|
include PortfolioManager::Services::Property::Design::Test
|
1070
|
+
include PortfolioManager::Services::Property::CustomMetrics::Test
|
944
1071
|
include PortfolioManager::Services::Property::ElectricDistributionUtility::Test
|
945
1072
|
include PortfolioManager::Services::Property::PowerGenerationPlant::Test
|
946
1073
|
include PortfolioManager::Services::Property::InternationalWeatherStation::Test
|
@@ -26,7 +26,7 @@ module PortfolioManager
|
|
26
26
|
# request altogether.
|
27
27
|
#
|
28
28
|
# @param property_id [Integer]
|
29
|
-
# @param property_use [PortfolioManager::Xml::BankBranchType, PortfolioManager::Xml::BarracksType, PortfolioManager::Xml::CollegeUniversityType, PortfolioManager::Xml::ConvenienceStoreWithGasStationType, PortfolioManager::Xml::ConvenienceStoreWithoutGasStationType, PortfolioManager::Xml::CourthouseType, PortfolioManager::Xml::DataCenterType, PortfolioManager::Xml::DistributionCenterType, PortfolioManager::Xml::DrinkingWaterTreatmentAndDistributionType, PortfolioManager::Xml::EvChargingStationType, PortfolioManager::Xml::FinancialOfficeType, PortfolioManager::Xml::FoodSalesType, PortfolioManager::Xml::HospitalType, PortfolioManager::Xml::HotelType, PortfolioManager::Xml::IceCurlingRinkType, PortfolioManager::Xml::IndoorArenaType, PortfolioManager::Xml::K12SchoolType, PortfolioManager::Xml::MailingCenterPostOfficeType, PortfolioManager::Xml::MedicalOfficeType, PortfolioManager::Xml::MultifamilyHousingType, PortfolioManager::Xml::NonRefrigeratedWarehouseType, PortfolioManager::Xml::OfficeType, PortfolioManager::Xml::OtherStadiumType, PortfolioManager::Xml::OtherType, PortfolioManager::Xml::ParkingType, PortfolioManager::Xml::RefrigeratedWarehouseType, PortfolioManager::Xml::ResidenceHallDormitoryType, PortfolioManager::Xml::ResidentialCareFacilityType, PortfolioManager::Xml::RetailType, PortfolioManager::Xml::SelfStorageFacilityType, PortfolioManager::Xml::SeniorLivingCommunityType, PortfolioManager::Xml::SingleFamilyHomeType, PortfolioManager::Xml::StadiumClosedType, PortfolioManager::Xml::StadiumOpenType, PortfolioManager::Xml::SupermarketType, PortfolioManager::Xml::SwimmingPoolType, PortfolioManager::Xml::VehicleDealershipType, PortfolioManager::Xml::WastewaterTreatmentPlantType, PortfolioManager::Xml::WholesaleClubSupercenterType, PortfolioManager::Xml::WorshipFacilityType]
|
29
|
+
# @param property_use [PortfolioManager::Xml::BankBranchType, PortfolioManager::Xml::BarracksType, PortfolioManager::Xml::CollegeUniversityType, PortfolioManager::Xml::ConvenienceStoreWithGasStationType, PortfolioManager::Xml::ConvenienceStoreWithoutGasStationType, PortfolioManager::Xml::CourthouseType, PortfolioManager::Xml::DataCenterType, PortfolioManager::Xml::DistributionCenterType, PortfolioManager::Xml::DrinkingWaterTreatmentAndDistributionType, PortfolioManager::Xml::EvChargingStationType, PortfolioManager::Xml::FinancialOfficeType, PortfolioManager::Xml::FoodSalesType, PortfolioManager::Xml::HospitalType, PortfolioManager::Xml::HotelType, PortfolioManager::Xml::IceCurlingRinkType, PortfolioManager::Xml::IndoorArenaType, PortfolioManager::Xml::K12SchoolType, PortfolioManager::Xml::LibraryType, PortfolioManager::Xml::MailingCenterPostOfficeType, PortfolioManager::Xml::MedicalOfficeType, PortfolioManager::Xml::MultifamilyHousingType, PortfolioManager::Xml::MuseumType, PortfolioManager::Xml::NonRefrigeratedWarehouseType, PortfolioManager::Xml::OfficeType, PortfolioManager::Xml::OtherStadiumType, PortfolioManager::Xml::OtherType, PortfolioManager::Xml::ParkingType, PortfolioManager::Xml::RefrigeratedWarehouseType, PortfolioManager::Xml::ResidenceHallDormitoryType, PortfolioManager::Xml::ResidentialCareFacilityType, PortfolioManager::Xml::RetailType, PortfolioManager::Xml::SelfStorageFacilityType, PortfolioManager::Xml::SeniorLivingCommunityType, PortfolioManager::Xml::SingleFamilyHomeType, PortfolioManager::Xml::StadiumClosedType, PortfolioManager::Xml::StadiumOpenType, PortfolioManager::Xml::SupermarketType, PortfolioManager::Xml::SwimmingPoolType, PortfolioManager::Xml::VehicleDealershipType, PortfolioManager::Xml::WastewaterTreatmentPlantType, PortfolioManager::Xml::WholesaleClubSupercenterType, PortfolioManager::Xml::WorshipFacilityType]
|
30
30
|
# @param elename [nil, String]
|
31
31
|
# @return [PortfolioManager::Xml::ResponseType]
|
32
32
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
@@ -97,7 +97,7 @@ module PortfolioManager
|
|
97
97
|
#
|
98
98
|
# @param property_use_id [Integer]
|
99
99
|
# @param klass [nil, Class]
|
100
|
-
# @return [PortfolioManager::Xml::BankBranchType, PortfolioManager::Xml::BarracksType, PortfolioManager::Xml::CollegeUniversityType, PortfolioManager::Xml::ConvenienceStoreWithGasStationType, PortfolioManager::Xml::ConvenienceStoreWithoutGasStationType, PortfolioManager::Xml::CourthouseType, PortfolioManager::Xml::DataCenterType, PortfolioManager::Xml::DistributionCenterType, PortfolioManager::Xml::DrinkingWaterTreatmentAndDistributionType, PortfolioManager::Xml::EvChargingStationType, PortfolioManager::Xml::FinancialOfficeType, PortfolioManager::Xml::FoodSalesType, PortfolioManager::Xml::HospitalType, PortfolioManager::Xml::HotelType, PortfolioManager::Xml::IceCurlingRinkType, PortfolioManager::Xml::IndoorArenaType, PortfolioManager::Xml::K12SchoolType, PortfolioManager::Xml::MailingCenterPostOfficeType, PortfolioManager::Xml::MedicalOfficeType, PortfolioManager::Xml::MultifamilyHousingType, PortfolioManager::Xml::NonRefrigeratedWarehouseType, PortfolioManager::Xml::OfficeType, PortfolioManager::Xml::OtherStadiumType, PortfolioManager::Xml::OtherType, PortfolioManager::Xml::ParkingType, PortfolioManager::Xml::RefrigeratedWarehouseType, PortfolioManager::Xml::ResidenceHallDormitoryType, PortfolioManager::Xml::ResidentialCareFacilityType, PortfolioManager::Xml::RetailType, PortfolioManager::Xml::SelfStorageFacilityType, PortfolioManager::Xml::SeniorLivingCommunityType, PortfolioManager::Xml::SingleFamilyHomeType, PortfolioManager::Xml::StadiumClosedType, PortfolioManager::Xml::StadiumOpenType, PortfolioManager::Xml::SupermarketType, PortfolioManager::Xml::SwimmingPoolType, PortfolioManager::Xml::VehicleDealershipType, PortfolioManager::Xml::WastewaterTreatmentPlantType, PortfolioManager::Xml::WholesaleClubSupercenterType, PortfolioManager::Xml::WorshipFacilityType, PortfolioManager::Xml::ResponseType]
|
100
|
+
# @return [PortfolioManager::Xml::BankBranchType, PortfolioManager::Xml::BarracksType, PortfolioManager::Xml::CollegeUniversityType, PortfolioManager::Xml::ConvenienceStoreWithGasStationType, PortfolioManager::Xml::ConvenienceStoreWithoutGasStationType, PortfolioManager::Xml::CourthouseType, PortfolioManager::Xml::DataCenterType, PortfolioManager::Xml::DistributionCenterType, PortfolioManager::Xml::DrinkingWaterTreatmentAndDistributionType, PortfolioManager::Xml::EvChargingStationType, PortfolioManager::Xml::FinancialOfficeType, PortfolioManager::Xml::FoodSalesType, PortfolioManager::Xml::HospitalType, PortfolioManager::Xml::HotelType, PortfolioManager::Xml::IceCurlingRinkType, PortfolioManager::Xml::IndoorArenaType, PortfolioManager::Xml::K12SchoolType, PortfolioManager::Xml::LibraryType, PortfolioManager::Xml::MailingCenterPostOfficeType, PortfolioManager::Xml::MedicalOfficeType, PortfolioManager::Xml::MultifamilyHousingType, PortfolioManager::Xml::MuseumType, PortfolioManager::Xml::NonRefrigeratedWarehouseType, PortfolioManager::Xml::OfficeType, PortfolioManager::Xml::OtherStadiumType, PortfolioManager::Xml::OtherType, PortfolioManager::Xml::ParkingType, PortfolioManager::Xml::RefrigeratedWarehouseType, PortfolioManager::Xml::ResidenceHallDormitoryType, PortfolioManager::Xml::ResidentialCareFacilityType, PortfolioManager::Xml::RetailType, PortfolioManager::Xml::SelfStorageFacilityType, PortfolioManager::Xml::SeniorLivingCommunityType, PortfolioManager::Xml::SingleFamilyHomeType, PortfolioManager::Xml::StadiumClosedType, PortfolioManager::Xml::StadiumOpenType, PortfolioManager::Xml::SupermarketType, PortfolioManager::Xml::SwimmingPoolType, PortfolioManager::Xml::VehicleDealershipType, PortfolioManager::Xml::WastewaterTreatmentPlantType, PortfolioManager::Xml::WholesaleClubSupercenterType, PortfolioManager::Xml::WorshipFacilityType, PortfolioManager::Xml::ResponseType]
|
101
101
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
102
102
|
# @raise [PortfolioManager::HTTPResponseError]
|
103
103
|
# @see https://portfoliomanager.energystar.gov/webservices/home/api/propertyUse/propertyUse/get
|
@@ -302,7 +302,7 @@ module PortfolioManager
|
|
302
302
|
# you.
|
303
303
|
#
|
304
304
|
# @param property_id [Integer]
|
305
|
-
# @return [PortfolioManager::Xml::CustomUseType]
|
305
|
+
# @return [PortfolioManager::Xml::CustomUseType, PortfolioManager::Xml::ResponseType]
|
306
306
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
307
307
|
# @raise [PortfolioManager::HTTPResponseError]
|
308
308
|
# @see https://portfoliomanager.energystar.gov/webservices/home/api/propertyUse/customUse/get
|
@@ -319,7 +319,7 @@ module PortfolioManager
|
|
319
319
|
# @param property_id [Integer]
|
320
320
|
# @param current_as_of_start [Date]
|
321
321
|
# @param current_as_of_end [Date]
|
322
|
-
# @return [PortfolioManager::Xml::UseDetails]
|
322
|
+
# @return [PortfolioManager::Xml::UseDetails, PortfolioManager::Xml::ResponseType]
|
323
323
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
324
324
|
# @raise [PortfolioManager::HTTPResponseError]
|
325
325
|
# @see https://portfoliomanager.energystar.gov/webservices/home/api/propertyUse/customUseDetailsRevisions/get
|
@@ -360,7 +360,7 @@ module PortfolioManager
|
|
360
360
|
# shared with you.
|
361
361
|
#
|
362
362
|
# @param details_id [Integer]
|
363
|
-
# @return [PortfolioManager::Xml::CustomUseDetailsType]
|
363
|
+
# @return [PortfolioManager::Xml::CustomUseDetailsType, PortfolioManager::Xml::ResponseType]
|
364
364
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
365
365
|
# @raise [PortfolioManager::HTTPResponseError]
|
366
366
|
# @see https://portfoliomanager.energystar.gov/webservices/home/api/propertyUse/customUseDetails/get
|
@@ -18,13 +18,15 @@ module PortfolioManager
|
|
18
18
|
# used in a report template.
|
19
19
|
#
|
20
20
|
# @param group_ids [nil, Array<Integer>]
|
21
|
-
# @
|
21
|
+
# @param available_to_custom_metrics [nil, Boolean]
|
22
|
+
# @return [PortfolioManager::Xml::ReportMetrics, PortfolioManager::Xml::ResponseType]
|
22
23
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
23
24
|
# @raise [PortfolioManager::HTTPResponseError]
|
24
25
|
# @see https://portfoliomanager.energystar.gov/webservices/home/api/reporting/availableMetricsList/get
|
25
|
-
def get_available_metrics_list(group_ids = nil)
|
26
|
+
def get_available_metrics_list(group_ids = nil, available_to_custom_metrics = nil)
|
26
27
|
request(Net::HTTP::Get, path_for("reports", "metrics"), {
|
27
28
|
"groupIds" => (group_ids.nil? || group_ids.empty?) ? nil : group_ids.collect(&:to_s).join(","),
|
29
|
+
"availableToCustomMetrics" => available_to_custom_metrics,
|
28
30
|
}, {}, nil, nil, PortfolioManager::Xml::ReportMetrics, basic_auth: true)
|
29
31
|
end
|
30
32
|
|
@@ -71,7 +73,7 @@ module PortfolioManager
|
|
71
73
|
# template must be owned by you.
|
72
74
|
#
|
73
75
|
# @param template_id [Integer]
|
74
|
-
# @return [PortfolioManager::Xml::ReportTemplateType]
|
76
|
+
# @return [PortfolioManager::Xml::ReportTemplateType, PortfolioManager::Xml::ResponseType]
|
75
77
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
76
78
|
# @raise [PortfolioManager::HTTPResponseError]
|
77
79
|
# @see https://portfoliomanager.energystar.gov/webservices/home/api/reporting/template/get
|
@@ -163,7 +165,7 @@ module PortfolioManager
|
|
163
165
|
# template for a specific report. The report must be owned by you.
|
164
166
|
#
|
165
167
|
# @param report_id [Integer]
|
166
|
-
# @return [PortfolioManager::Xml::Report]
|
168
|
+
# @return [PortfolioManager::Xml::Report, PortfolioManager::Xml::ResponseType]
|
167
169
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
168
170
|
# @raise [PortfolioManager::HTTPResponseError]
|
169
171
|
# @see https://portfoliomanager.energystar.gov/webservices/home/api/reporting/report/get
|
@@ -205,12 +207,12 @@ module PortfolioManager
|
|
205
207
|
#
|
206
208
|
# @param report_id [Integer]
|
207
209
|
# @param type ["EXCEL", "XML"]
|
208
|
-
# @return [PortfolioManager::Xml::Report]
|
210
|
+
# @return [PortfolioManager::Xml::Report, PortfolioManager::Xml::ResponseType]
|
209
211
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
210
212
|
# @raise [PortfolioManager::HTTPResponseError]
|
211
213
|
# @see https://portfoliomanager.energystar.gov/webservices/home/api/reporting/reportResults/get
|
212
214
|
def get_report_results(report_id, type = "XML")
|
213
|
-
request(Net::HTTP::Get, path_for("reports", report_id), {
|
215
|
+
request(Net::HTTP::Get, path_for("reports", report_id, "download"), {
|
214
216
|
"type" => type,
|
215
217
|
}, {}, nil, nil, PortfolioManager::Xml::Report, basic_auth: true)
|
216
218
|
end
|
@@ -257,7 +259,7 @@ module PortfolioManager
|
|
257
259
|
# available for download.
|
258
260
|
#
|
259
261
|
# @param report_id [Integer]
|
260
|
-
# @return [PortfolioManager::Xml::ReportStatusDef]
|
262
|
+
# @return [PortfolioManager::Xml::ReportStatusDef, PortfolioManager::Xml::ResponseType]
|
261
263
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
262
264
|
# @raise [PortfolioManager::HTTPResponseError]
|
263
265
|
# @see https://portfoliomanager.energystar.gov/webservices/home/api/reporting/reportStatus/get
|
@@ -298,7 +300,7 @@ module PortfolioManager
|
|
298
300
|
#
|
299
301
|
# @param customer_id [Integer]
|
300
302
|
# @param data_request_id [Integer]
|
301
|
-
# @return [PortfolioManager::Xml::DataRequest]
|
303
|
+
# @return [PortfolioManager::Xml::DataRequest, PortfolioManager::Xml::ResponseType]
|
302
304
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
303
305
|
# @raise [PortfolioManager::HTTPResponseError]
|
304
306
|
# @see https://portfoliomanager.energystar.gov/webservices/home/api/reporting/customerDataRequest/get
|
@@ -358,7 +360,7 @@ module PortfolioManager
|
|
358
360
|
#
|
359
361
|
# @param customer_id [Integer]
|
360
362
|
# @param data_response_id [Integer]
|
361
|
-
# @return [PortfolioManager::Xml::DataResponse]
|
363
|
+
# @return [PortfolioManager::Xml::DataResponse, PortfolioManager::Xml::ResponseType]
|
362
364
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
363
365
|
# @raise [PortfolioManager::HTTPResponseError]
|
364
366
|
# @see https://portfoliomanager.energystar.gov/webservices/home/api/reporting/dataResponse/get
|
@@ -418,7 +420,7 @@ module PortfolioManager
|
|
418
420
|
# @param customer_id [Integer]
|
419
421
|
# @param data_response_id [Integer]
|
420
422
|
# @param type ["EXCEL", "XML"]
|
421
|
-
# @return [PortfolioManager::Xml::ResponseStatus]
|
423
|
+
# @return [PortfolioManager::Xml::ResponseStatus, PortfolioManager::Xml::ResponseType]
|
422
424
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
423
425
|
# @raise [PortfolioManager::HTTPResponseError]
|
424
426
|
# @see https://portfoliomanager.energystar.gov/webservices/home/api/reporting/downloadErrorsDataResponse/get
|
@@ -512,7 +514,7 @@ module PortfolioManager
|
|
512
514
|
#
|
513
515
|
# @param customer_id [Integer]
|
514
516
|
# @param data_response_id [Integer]
|
515
|
-
# @return [PortfolioManager::Xml::ResponseStatus]
|
517
|
+
# @return [PortfolioManager::Xml::ResponseStatus, PortfolioManager::Xml::ResponseType]
|
516
518
|
# @raise [PortfolioManager::HTTPBasicCredentialsNotFoundError]
|
517
519
|
# @raise [PortfolioManager::HTTPResponseError]
|
518
520
|
# @see https://portfoliomanager.energystar.gov/webservices/home/api/reporting/statusDataResponse/get
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: portfoliomanager-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Borkum
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logger-application
|