Module: PortfolioManager::Services::Property::CustomMetrics::Live

Included in:
All::Live
Defined in:
lib/portfolio_manager/services/property.rb

Overview

Live Environment

Instance Method Summary collapse

Instance Method Details

#add_custom_metric(property_id, custom_metric_slot, custom_metric) ⇒ PortfolioManager::Xml::ResponseType

Add Custom Metric

This web service adds a new custom metric based on the information provided in the XML request for a specified property. The property must already be shared with you. A maximum of 3 custom metrics per property can be defined.



220
221
222
# File 'lib/portfolio_manager/services/property.rb', line 220

def add_custom_metric(property_id, custom_metric_slot, custom_metric)
  request(Net::HTTP::Post, path_for("property", property_id, "customMetrics", custom_metric_slot), {}, {}, custom_metric, "customMetric", PortfolioManager::Xml::ResponseType, basic_auth: true)
end

#delete_custom_metric(property_id, custom_metric_slot) ⇒ PortfolioManager::Xml::ResponseType

Delete Custom Metric

This web service deletes a specific custom metric for a given property. The property must already be shared with you.



252
253
254
# File 'lib/portfolio_manager/services/property.rb', line 252

def delete_custom_metric(property_id, custom_metric_slot)
  request(Net::HTTP::Delete, path_for("property", property_id, "customMetrics", custom_metric_slot), {}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
end

#edit_custom_metric(property_id, custom_metric_slot, custom_metric) ⇒ PortfolioManager::Xml::ResponseType

Edit Custom Metric

This web service updates a specific custom metric based on the information provided in the XML request for a given property. The property must already be shared with you.



237
238
239
# File 'lib/portfolio_manager/services/property.rb', line 237

def edit_custom_metric(property_id, custom_metric_slot, custom_metric)
  request(Net::HTTP::Put, path_for("property", property_id, "customMetrics", custom_metric_slot), {}, {}, custom_metric, "customMetric", PortfolioManager::Xml::ResponseType, basic_auth: true)
end

#get_available_metrics_list(group_ids = nil, available_to_custom_metrics = nil) ⇒ PortfolioManager::Xml::ReportMetrics, PortfolioManager::Xml::ResponseType

Get Available Metrics List

This web service returns a list of all available metrics that can be used to define in a custom metric (the numerator of a custom metric).



284
285
286
287
288
289
# File 'lib/portfolio_manager/services/property.rb', line 284

def get_available_metrics_list(group_ids = nil, available_to_custom_metrics = nil)
  request(Net::HTTP::Get, path_for("reports", "metrics"), {
    "groupIds" => (group_ids.nil? || group_ids.empty?) ? nil : group_ids.collect(&:to_s).join(","),
    "availableToCustomMetrics" => available_to_custom_metrics,
  }, {}, nil, nil, PortfolioManager::Xml::ReportMetrics, basic_auth: true)
end

#get_available_property_use_details_for_custom_metrics(property_id) ⇒ PortfolioManager::Xml::DetailsTypes, PortfolioManager::Xml::ResponseType

Get Available Property Use Details (for Custom Metrics)

This web service returns a list of all the property use details of a given property that can be used to define in a custom metric (the denominator of a custom metric). The property must already be shared with you.



268
269
270
# File 'lib/portfolio_manager/services/property.rb', line 268

def get_available_property_use_details_for_custom_metrics(property_id)
  request(Net::HTTP::Get, path_for("property", property_id, "customMetrics", "availablePropertyUseDetails"), {}, {}, nil, nil, PortfolioManager::Xml::DetailsTypes, basic_auth: true)
end

#get_custom_metric(property_id, custom_metric_slot) ⇒ PortfolioManager::Xml::CustomMetric, PortfolioManager::Xml::ResponseType

Get Custom Metric

This web service returns information for a specific custom metric for a given property. The property must already be shared with you.



202
203
204
# File 'lib/portfolio_manager/services/property.rb', line 202

def get_custom_metric(property_id, custom_metric_slot)
  request(Net::HTTP::Get, path_for("property", property_id, "customMetrics", custom_metric_slot), {}, {}, nil, nil, PortfolioManager::Xml::CustomMetric, basic_auth: true)
end

#get_custom_metrics(property_id) ⇒ PortfolioManager::Xml::ResponseType

Get Custom Metrics

This web service returns a list of custom metrics for a specific property. A maximum of 3 custom metrics per property can be defined. The property must already be shared with you.



187
188
189
# File 'lib/portfolio_manager/services/property.rb', line 187

def get_custom_metrics(property_id)
  request(Net::HTTP::Get, path_for("property", property_id, "customMetrics"), {}, {}, nil, nil, PortfolioManager::Xml::ResponseType, basic_auth: true)
end