Complete System Example

Overview

This example demonstrates a complete RCAMS API integration, including a class-based architecture for managing authentication, resources, and controlling lights. The code is organized into a cohesive client library that you can adapt for your specific integration needs.

Note: This example combines all the concepts from the previous examples into a comprehensive client library. It provides a foundation that you can extend and customize for your specific use case.

Complete RCAMS API Client

The following code implements a complete client library for the RCAMS API, organized into specialized manager classes for different aspects of the system. Click the "View Full Code" button to see the entire implementation, or click on individual class cards below to view and copy specific classes.

Click on any class card below to view and copy that specific class implementation.

Individual Classes

The RCAMS API client is composed of the following specialized classes that you can use individually or together:

RcamsApiClient

Main client class that orchestrates all managers and handles API requests.

AuthManager

Handles authentication operations including login, and logout.

DistrictManager

Manages district operations including listing, creating, updating, and deleting districts.

SchoolManager

Manages school operations including listing, creating, updating, and deleting schools.

GroupManager

Manages group operations including listing, creating, updating, and deleting groups.

UserManager

Manages user operations including listing, creating, updating, and deleting users.

WifiManager

Manages WiFi settings including listing, creating, updating, and deleting WiFi configurations.

LightManager

Manages light operations including listing, retrieving, updating, and deleting lights.

CommandManager

Handles sending commands to lights, groups, schools, and districts.

Light Command Constants

Constants for light commands (e.g., lockdown, evacuate, etc.)

Usage Example

Example demonstrating how to use the RCAMS API Client.

Note: This example provides a comprehensive framework that you can adapt to your specific needs. You may want to extend it with additional features such as error handling, logging, and retry mechanisms for production use.