Skip to contents

This is a wrapper R6::R6Class() that provides a high-level interface for interacting with the Entrata API.

It handles authentication, request parameter validation and construction, and response parsing, making it easy for developers to work with the API.

Details

This class ...

Public fields

config

A list containing the Entrata API configuration, including the username, password, and API base URL.

user_agent

The user agent string to use for API requests.

Methods


Method new()

Initializes the Entrata API manager with the provided configuration. If no configuration is provided, the default configuration will be used.

Usage

EntrataAPI$new(config = config::get("entrata"))

Arguments

config

A list containing the Entrata API configuration.

Returns

The initialized Entrata API manager.


Method send_request()

Sends a request to the Entrata API.

Usage

EntrataAPI$send_request(
  endpoint,
  method,
  method_version = "r1",
  method_params = list(),
  enable_retry = FALSE,
  timeout = NULL,
  progress = FALSE,
  ...
)

Arguments

endpoint

The Entrata API endpoint to call.

method

The Entrata API method to use.

method_version

The version of the API method to use.

method_params

A named list of parameters to include in the API request.

enable_retry

Logical, should the request be retried on failure?

timeout

Numeric, the request timeout in seconds.

progress

Logical, should progress be shown for the request?

...

Additional arguments to pass to the underlying httr2::req_perform() call.

Returns

The response object from the API request.


Method get_reports_list()

Retrieves the list of available Entrata reports.

Usage

EntrataAPI$get_reports_list(latest_only = TRUE)

Arguments

latest_only

Logical, should only the latest version of each report be returned?

Returns

A tibble containing the report information.


Method get_report_info()

Retrieves detailed information for a specific Entrata report.

Usage

EntrataAPI$get_report_info(report_name, report_version = "latest")

Arguments

report_name

The name of the report to retrieve information for.

report_version

The version of the report to retrieve information for.

Returns

A list containing the report name, description, and filters.


Method get_latest_report_version()

Retrieves the latest version of a specific Entrata report.

Usage

EntrataAPI$get_latest_report_version(report_name)

Arguments

report_name

The name of the report to retrieve the latest version for.

Returns

The latest version of the report as a character string.


Method generate_pre_lease_report()

Generates a pre-lease report in Entrata.

Usage

EntrataAPI$generate_pre_lease_report(
  property_ids,
  period_start = "2024-09-01",
  ...
)

Arguments

property_ids

A vector of property IDs to include in the report.

period_start

The start date of the reporting period.

...

Additional parameters to pass to the report generation.

Returns

A list containing the summary and details of the pre-lease report.


Method get_property_ids()

Retrieves the list of property IDs from the Entrata API.

Usage

EntrataAPI$get_property_ids()

Returns

A vector of property IDs.


Method clone()

The objects of this class are cloneable with this method.

Usage

EntrataAPI$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.