API
The object/class GuardPoint represents the GuardPoint Server.
- class pyGuardPoint.GuardPoint(**kwargs)
Bases:
GuardPointConnection,CardsAPI,CardholdersAPI,AreasAPI,SecurityGroupsAPI,CustomizedFieldsAPI,PersonalDetailsAPI,ScheduledMagsAPI,CardholderTypesAPI,OutputsAPI,DiagnosticAPI,ReadersAPI,ControllersAPI,AlarmStatesAPI,EventsAPI,DepartmentsAPI,SitesAPI,AccessGroupsAPI,GenericInfoAPI,AlarmZonesAPI,InputsAPI,ManualEventsAPI,WeeklyProgramsAPIA class to interface with the GuardPoint system, providing various APIs for managing cards, cardholders, areas, security groups, customized fields, personal details, scheduled mags, cardholder types, outputs, diagnostics, readers, controllers, alarms, and events.
This class inherits from multiple API classes to provide a comprehensive interface for interacting with the GuardPoint system.
Methods
- __init__(kwargs)
Initializes the GuardPoint instance with the provided configuration.
- get_cardholder_count()
Retrieves the total number of cardholders.
- get_signal_client()
Creates and returns a SignalR client for event listening.
- start_listening(client: SignalRClient)
Starts the SignalR client for listening to events.
- __init__(**kwargs)
Initialize the connection with the given parameters.
- Parameters:
kwargs –
See below
- Keyword Arguments:
host (str): The hostname or IP address of the server. Defaults to “localhost”.
port (int): The port number to connect to. Defaults to None.
auth (GuardPointAuthType): The authentication type. Defaults to GuardPointAuthType.BEARER_TOKEN.
username (str): The username for authentication. Defaults to “admin”.
pwd (str): The password for authentication. Defaults to “admin”.
key (str): The key for authentication. Defaults to “00000000-0000-0000-0000-000000000000”.
token (str): The token for authentication. Defaults to None.
cert_file (str): Path to the certificate file. Defaults to None.
key_file (str): Path to the key file. Defaults to None.
ca_file (str): Path to the CA file. Defaults to None.
timeout (int): The timeout duration in seconds. Defaults to 5.
p12_file (str): Path to the PKCS#12 file. Defaults to None.
p12_pwd (str): Password for the PKCS#12 file. Defaults to an empty string.
site_uid (str): The UID of the site. Defaults to None.
- Raises:
ValueError – If the host is not provided or is invalid.
- get_cardholder_count()
Retrieve the total count of cardholders from the GuardPoint system.
This method sends a GET request to the GuardPoint API to fetch the total number of cardholders. It handles various error scenarios, including unauthorized access and improperly formatted responses.
- Raises:
GuardPointUnauthorized – If the API response indicates unauthorized access (HTTP 401).
GuardPointError – If the API response is not properly formatted or if there is no response body.
- Returns:
The total number of cardholders.
- Return type:
- get_signal_client()
Creates and configures a SignalR client for connecting to the EventsHub.
This method initializes a SignalRClient instance with the appropriate URL and sets up the necessary headers for authentication based on the specified authentication type. It also configures a custom WebSocket transport for the client with various parameters.
- Returns:
Configured SignalRClient instance ready for use.
- Return type:
SignalRClient
- Raises:
ValueError – If the authentication type is not supported.
Example usage:
client = self.get_signal_client() client.start()
- start_listening(client: SignalRClient)
Start listening to the SignalR client by running it in an asynchronous task.
This method creates and runs an asynchronous task to execute the run method of the provided SignalRClient instance. The task is named “sigR_task” for identification purposes. If the task is cancelled, a message indicating the cancellation is printed.
- Parameters:
client (SignalRClient) – An instance of SignalRClient that will be run in an asynchronous task.
- Raises:
asyncio.CancelledError – If the asynchronous task is cancelled.
- stop_listening(client: SignalRClient)
- activate_manual_event(manual_event)
- activate_manual_event_by_api_key(api_key)
- add_scheduled_mag(scheduled_mag: ScheduledMag)
- arm_alarm_zone(alarm_zone: AlarmZone, option=AlarmZoneOption.ReturnAlarmZoneToWeeklyProgram)
- delete_card(card: Card)
Delete a card from the system using its unique identifier (UID).
This method sends a DELETE request to the GuardPoint API to remove a card identified by its UID. It validates the UID format before making the request and handles various HTTP response codes to provide appropriate error messages.
- Parameters:
card (Card) – The card object to be deleted.
- Raises:
ValueError – If the card UID is malformed.
GuardPointUnauthorized – If the request is unauthorized (HTTP 401).
GuardPointError – If the card is not found (HTTP 404) or any other error occurs.
- Returns:
True if the card was successfully deleted.
- Return type:
- delete_card_holder(cardholder: Cardholder)
Delete a cardholder from the system.
This method deletes a cardholder identified by their UID from the system. It performs a validation check on the UID to ensure it is a valid UUID. If the UID is malformed, a ValueError is raised. The method then sends a DELETE request to the API endpoint to remove the cardholder.
- Parameters:
cardholder (Cardholder) – The cardholder object to be deleted.
- Raises:
ValueError – If the cardholder UID is malformed.
GuardPointUnauthorized – If the request is unauthorized (HTTP 401).
GuardPointError – If the cardholder is not found (HTTP 404) or if another error occurs.
- Returns:
True if the cardholder was successfully deleted.
- Return type:
- disarm_alarm_zone(alarm_zone: AlarmZone)
- get_access_events(limit=None, offset=None, count=False, orderby=EventOrder.DATETIME_DESC, min_log_id=None)
Retrieve access event logs from the API with optional filtering, ordering, and pagination.
- Parameters:
limit (int, optional) – Optional; the maximum number of access events to retrieve. If not specified, all available events are retrieved.
offset (int, optional) – Optional; the number of access events to skip before starting to collect the result set.
count (bool, optional) – Optional; if True, only the count of access events is returned without the actual event data.
orderby (EventOrder, optional) – Optional; the order in which to sort the access events. Defaults to descending order by date and time.
min_log_id (int, optional) – Optional; the minimum log ID to filter access events. Only events with a log ID greater than this value are retrieved.
- Returns:
A list of AccessEvent objects representing the access events retrieved from the API.
- Return type:
list of AccessEvent
- Raises:
GuardPointUnauthorized – If the API request is unauthorized (HTTP status code 401).
GuardPointError – If the access events are not found (HTTP status code 404) or if there is any other error in the response.
GuardPointError – If the response body is not formatted as expected.
- get_access_events_count()
- get_access_groups()
- get_alarm_events(limit=None, offset=None, count=False, orderby=EventOrder.DATETIME_DESC)
Retrieve a list of alarm events from the API with optional filtering, ordering, and pagination.
- Parameters:
limit (int, optional) – Optional; the maximum number of alarm events to return. If not specified, all available events are returned.
offset (int, optional) – Optional; the number of alarm events to skip before starting to collect the result set.
count (bool, optional) – Optional; if True, only the count of alarm events is returned. Defaults to False.
orderby (EventOrder, optional) – Optional; the order in which to sort the alarm events. Defaults to descending order by date and time. Possible values are EventOrder.DATETIME_ASC, EventOrder.DATETIME_DESC, EventOrder.LOG_ID_ASC, and EventOrder.LOG_ID_DESC.
min_log_id (int, optional) – Optional; the minimum log ID to filter the alarm events. Only events with a log ID greater than this value will be returned.
- Raises:
GuardPointUnauthorized – If the API response indicates an unauthorized request (HTTP 401).
GuardPointError – If the API response indicates an error or if the response is badly formatted.
- Returns:
A list of AlarmEvent objects representing the alarm events retrieved from the API.
- Return type:
list of AlarmEvent
- get_alarm_events_count()
Retrieve the count of alarm events.
This method returns the total number of alarm events by utilizing the get_access_events method with specific parameters to ensure that only the count is returned. The events are ordered by date and time in descending order.
- Returns:
The total count of alarm events.
- Return type:
- get_alarm_state(alarm_uid)
- get_alarm_states()
- get_alarm_zone(zone_uid)
- get_alarm_zones()
- get_areas()
Retrieve a list of areas from the GuardPoint API.
This method sends a GET request to the GuardPoint API to fetch a list of areas. It processes the response and returns a list of Area objects.
- Raises:
GuardPointUnauthorized – If the API response status code is 401 (Unauthorized).
GuardPointError – If the API response status code is 404 (Not Found) or any other error occurs.
GuardPointError – If the response is not properly formatted.
- Returns:
A list of Area objects.
- Return type:
- get_audit_events(limit=None, offset=None, count=False, orderby=EventOrder.DATETIME_DESC, min_log_id=None)
- get_audit_events_count()
- get_card(card_uid: str)
Retrieve a card’s details from the GuardPoint system using its unique identifier.
This method sends a GET request to the GuardPoint API to fetch the details of a card identified by the provided card_uid. If the request is successful and the response is properly formatted, it returns a Card object containing the card’s details. Otherwise, it raises a GuardPointError.
- Parameters:
card_uid (str) – The unique identifier of the card to be retrieved.
- Raises:
GuardPointError – If the request fails or the response is improperly formatted.
- Returns:
A Card object containing the details of the requested card.
- Return type:
- get_card_holder(uid: str | None = None, card_code: str | None = None)
Retrieve cardholder information based on either a unique identifier (UID) or a card code.
This method allows you to fetch cardholder details by providing either a uid or a card_code. If a card_code is provided, it will use the get_cardholder_by_card_code method to retrieve the information. Otherwise, it will use the _get_card_holder method with the provided uid.
- Parameters:
- Returns:
Instance of Cardholder.
- Return type:
- Raises:
ValueError – If neither uid nor card_code is provided.
- get_card_holder_photo(uid)
Retrieve the photo of a cardholder given their unique identifier (UID).
This method sends a GET request to the GuardPoint API to fetch the photo of a cardholder. The UID must be a valid UUID. If the UID is malformed, a ValueError is raised. If the request is unauthorized, a GuardPointUnauthorized exception is raised. If the cardholder photo is not found, a GuardPointError is raised.
- Parameters:
uid (str) – The unique identifier of the cardholder.
- Raises:
ValueError – If the UID is not a valid UUID.
GuardPointUnauthorized – If the request is unauthorized.
GuardPointError – If the cardholder photo is not found or another error occurs.
- Returns:
The photo of the cardholder.
- Return type:
- get_card_holders(offset: int = 0, limit: int = 10, search_terms: str | None = None, areas: list | None = None, filter_expired: bool = False, cardholder_type_name: str | None = None, sort_algorithm: SortAlgorithm = SortAlgorithm.SERVER_DEFAULT, threshold: int = 15, count: bool = False, earliest_last_pass: datetime | None = None, select_ignore_list: list | None = None, select_include_list: list | None = None, cardholder_orderby: CardholderOrderBy = CardholderOrderBy.fromDateValid_DESC, **cardholder_kwargs)
Retrieve a list of cardholders from the system with various filtering and sorting options.
- Parameters:
offset (int) – The starting point within the collection of cardholders. Default is 0.
limit (int) – The maximum number of cardholders to return. Default is 10.
search_terms (str, optional) – Search terms to filter cardholders by name or other attributes. Default is None.
areas (list, optional) – List of areas to filter cardholders by. Default is None.
filter_expired (bool) – Whether to filter out expired cardholders. Default is False.
cardholder_type_name (str, optional) – Filter cardholders by type name. Default is None.
sort_algorithm (SortAlgorithm) – Algorithm to sort the cardholders. Default is SortAlgorithm.SERVER_DEFAULT.
threshold (int) – Threshold for fuzzy matching. Default is 75.
count (bool) – Whether to return the count of cardholders instead of the list. Default is False.
earliest_last_pass (datetime, optional) – Filter cardholders by the earliest last pass date. Default is None.
select_ignore_list (list, optional) – List of fields to ignore in the select query. Default is None.
select_include_list (list, optional) – List of fields to include in the select query. Default is None.
cardholder_kwargs (dict) – Additional keyword arguments for exact match filtering.
- Returns:
A list of cardholders or the count of cardholders based on the count parameter.
- Return type:
list[Cardholder] or int
- Raises:
GuardPointUnauthorized – If the request is unauthorized.
GuardPointError – If there is an error in retrieving cardholders or if cardholders are not found.
- get_cardholder_by_card_code(card_code)
Retrieve the cardholder information associated with a specific card code.
This method queries the GuardPoint API to fetch details of the cardholder whose card has the specified card code and is marked as ‘Used’. The response includes expanded details about the cardholder, such as security group, cardholder type, personal details, customized fields, and inside area.
- Parameters:
card_code (str) – The code of the card to search for.
- Returns:
The cardholder associated with the given card code.
- Return type:
- Raises:
GuardPointError – If the API response is malformed or if no cardholder is found.
- get_cardholder_types()
- get_cards(count=False, **card_kwargs)
Retrieve a list of cards or the count of cards based on the provided filters.
This method interacts with the GuardPoint API to fetch card data. It can either return a list of Card objects that match the given criteria or the count of such cards.
- Parameters:
count (bool) – If True, the method returns the count of cards that match the criteria. If False, it returns a list of Card objects. Default is False.
card_kwargs (dict) – Keyword arguments corresponding to the attributes of the Card class that will be used to filter the cards. Only exact matches are considered.
- Returns:
A list of Card objects if count is False, or an integer count of cards if count is True.
- Return type:
- Raises:
GuardPointUnauthorized – If the API response indicates an unauthorized request (HTTP 401).
GuardPointError – If the API response indicates an error or is badly formatted.
- get_controller(controller_uid: str)
Retrieve a controller object by its unique identifier (UID).
This method sends a GET request to the GuardPoint API to fetch details of a controller specified by the controller_uid. If the UID is not a valid UUID, a ValueError is raised. If the API response indicates an error or is not properly formatted, a GuardPointError is raised.
- Parameters:
controller_uid (str) – The unique identifier of the controller to retrieve.
- Raises:
ValueError – If the controller_uid is not a valid UUID.
GuardPointError – If the API response indicates an error or is not properly formatted.
- Returns:
A Controller object if the controller is found, otherwise None.
- Return type:
Controller or None
- get_controllers()
Retrieve a list of controllers from the GuardPoint API.
This method sends a GET request to the GuardPoint API to fetch a list of controllers. It processes the response and returns a list of Controller objects.
- Raises:
GuardPointUnauthorized – If the API response status code is 401 (Unauthorized).
GuardPointError – If the API response status code is 404 (Not Found) or if the response is badly formatted.
- Returns:
A list of Controller objects.
- Return type:
Example usage:
controllers = guardpoint_instance.get_controllers() for controller in controllers: print(controller)
- get_custom_fields()
- get_department(department_uid)
- get_departments()
- get_info(info_uid)
- get_infos()
- get_input(relay_uid)
- get_inputs()
- get_manual_events()
- get_reader(reader_uid: str)
Retrieve a reader’s information from the API using the provided reader UID.
This method sends a GET request to the /odata/API_Readers endpoint with the specified reader_uid to fetch the reader’s details. It validates the reader_uid to ensure it is a properly formatted UUID and handles various error conditions that may arise during the request.
- Parameters:
reader_uid (str) – The unique identifier of the reader to be retrieved.
- Raises:
ValueError – If the reader_uid is not a valid UUID.
GuardPointError – If the API response indicates an error or is improperly formatted.
- Returns:
An instance of the Reader class containing the reader’s details.
- Return type:
- get_readers(offset: int = 0, limit: int = 500, **reader_kwargs)
Retrieve a list of readers from the GuardPoint API.
This method sends a GET request to the GuardPoint API to fetch a list of readers. It processes the response and returns a list of Reader objects.
- Raises:
GuardPointUnauthorized – If the API response status code is 401 (Unauthorized).
GuardPointError – If the API response status code is 404 (Not Found) or any other error occurs.
GuardPointError – If the response is not properly formatted.
- Returns:
A list of Reader objects.
- Return type:
- get_relay(relay_uid)
- get_relays()
- get_scheduled_mags(cardholder: Cardholder | None = None)
- get_security_groups()
Retrieve a list of security groups from the GuardPoint API.
This method sends a GET request to the GuardPoint API to fetch security groups. It handles various HTTP response codes and raises appropriate exceptions for unauthorized access, not found errors, and other errors. The response is expected to be a JSON object containing a list of security groups.
- Raises:
GuardPointUnauthorized – If the API response code is 401 (Unauthorized).
GuardPointError – If the API response code is 404 (Not Found) or any other error occurs.
GuardPointError – If the response body is not formatted as expected.
- Returns:
A list of SecurityGroup objects.
- Return type:
- get_site(site_uid)
Retrieve a site by its unique identifier (UID).
This method fetches the details of a site from the GuardPoint API using the provided site UID. It validates the UID, constructs the appropriate API request, and handles the response.
- Parameters:
site_uid (str) – The unique identifier of the site to retrieve.
- Raises:
ValueError – If the provided site_uid is not a valid UUID.
GuardPointUnauthorized – If the API response indicates an unauthorized request (HTTP 401).
GuardPointError – If the site is not found (HTTP 404) or if there is any other error in the response.
- Returns:
An instance of the Site class if the site is found, otherwise None.
- Return type:
Site or None
- get_sites()
Retrieve a list of sites from the GuardPoint API.
This method sends a GET request to the GuardPoint API to fetch a list of sites. It handles various HTTP response codes and raises appropriate exceptions for error conditions.
- Raises:
GuardPointUnauthorized – If the API response code is 401 (Unauthorized).
GuardPointError – If the API response code is 404 (Not Found) or any other error occurs.
GuardPointError – If the response is not properly formatted.
- Returns:
A list of Site objects representing the sites retrieved from the API.
- Return type:
- get_ssl_context()
- get_token(renewal_minutes=30)
- get_weekly_program(weekly_program_uid)
- get_weekly_programs()
- gp_version()
- is_sigr_enabled()
- new_card(card: Card)
Create a new card in the system.
This method sends a POST request to the API to create a new card with the provided details. If the card is successfully created, it returns a Card object representing the newly created card. If the creation fails, it raises a GuardPointError with an appropriate error message.
- Parameters:
card (Card) – The Card object containing the details of the card to be created.
- Raises:
GuardPointError – If the card creation fails, an error is raised with the relevant error message.
- Returns:
A Card object representing the newly created card.
- Return type:
- new_card_holder(cardholder: Cardholder, changed_only=False, enroll_face_from_photo=False)
Create a new cardholder in the system.
This method sends a POST request to the GuardPoint API to create a new cardholder. Depending on the changed_only flag, it can either send only the changed fields or all editable and non-empty fields of the cardholder.
- Parameters:
cardholder (Cardholder) – The cardholder object to be created.
changed_only (bool, optional) – If True, only the changed fields of the cardholder will be sent. Otherwise, all editable and non-empty fields will be sent.
enroll_face_from_photo (bool, optional) – If True, enroll the cardholder’s face from a photo.
- Returns:
The newly created cardholder object.
- Return type:
- Raises:
GuardPointError – If there is an error in the request or response.
GuardPointUnauthorized – If the request is unauthorized.
- renew_token()
- set_token(gp_token)
- simulate_access_event(controller_uid: str, reader_num: int, card_code: str)
Simulates an access event by sending a command to the specified controller.
This method sends a command to the controller identified by controller_uid to simulate an access event using the specified reader_num and card_code. It performs validation on the inputs and handles the response from the server.
- Parameters:
- Raises:
ValueError – If controller_uid is not a valid UUID, card_code is too short, or reader_num is greater than 255.
GuardPointUnauthorized – If the server responds with a 401 Unauthorized status.
GuardPointError – If the server responds with an error or the response is badly formatted.
- Returns:
True if the access event simulation was successful, False otherwise.
- Return type:
- update_card(card: Card)
Update the details of an existing card in the system.
This method sends a PATCH request to the API to update the card details. It validates the card UID before making the request and handles various HTTP response codes to ensure the update was successful.
- Parameters:
card (Card) – The card object containing updated details.
- Raises:
ValueError – If the card UID is malformed.
GuardPointUnauthorized – If the request is unauthorized (HTTP 401).
GuardPointError – If there is an error in the request or response.
- Returns:
True if the card was successfully updated.
- Return type:
- update_card_holder(cardholder: Cardholder, enroll_face_from_photo=False)
Update the details of a cardholder in the system.
This method updates various attributes of a cardholder, including custom fields, personal details, and associated cards. It performs validation on the cardholder’s UID and the UIDs of associated cards. If any attributes have changed, it sends a PATCH request to update the cardholder’s information in the system.
- Parameters:
cardholder (Cardholder) – The cardholder object containing updated information.
enroll_face_from_photo (bool, optional) – Flag indicating whether to enroll the cardholder’s face from a photo, defaults to False.
- Raises:
ValueError – If the cardholder UID is malformed.
GuardPointUnauthorized – If the request is unauthorized.
GuardPointError – If the cardholder is not found or another error occurs.
- Returns:
True if the update is successful, otherwise raises an exception.
- Return type:
- update_card_holder_area(cardholder_uid: str, area: Area)
Update the area associated with a cardholder.
This method updates the area (location) information for a given cardholder by their unique identifier (UID). It validates the provided UIDs for both the cardholder and the area before performing the update.
- Parameters:
- Raises:
ValueError – If the cardholder UID or area UID is malformed (not a valid UUID).
- Returns:
The result of the cardholder update operation.
- Return type:
Any
- update_custom_fields(cardholder_uid: str, customFields: CardholderCustomizedField)
Update custom fields for a specific cardholder.
This method updates the custom fields of a cardholder identified by the given UID. It sends a PATCH request to the GuardPoint API with the updated custom fields.
- Parameters:
cardholder_uid (str) – The unique identifier of the cardholder.
customFields (CardholderCustomizedField) – An instance of CardholderCustomizedField containing the custom fields to be updated.
- Raises:
ValueError – If the provided cardholder_uid is not a valid UUID.
GuardPointUnauthorized – If the request is unauthorized (HTTP 401).
GuardPointError – If the cardholder is not found (HTTP 404) or any other error occurs.
- Returns:
True if the update is successful.
- Return type:
- update_personal_details(cardholder_uid: str, personal_details: CardholderPersonalDetail)
Update the personal details of a cardholder.
This method updates the personal details of a cardholder identified by the given UID. It sends a PATCH request to the GuardPoint API with the updated details.
- Parameters:
cardholder_uid (str) – The unique identifier of the cardholder.
personal_details (CardholderPersonalDetail) – An instance of CardholderPersonalDetail containing the updated personal details.
- Raises:
ValueError – If the provided cardholder_uid is not a valid UUID.
GuardPointUnauthorized – If the request is unauthorized (HTTP 401).
GuardPointError – If the cardholder is not found (HTTP 404) or any other error occurs.
- Returns:
True if the update is successful.
- Return type:
- class pyGuardPoint.Cardholder(*args, **kwargs)
Represents a cardholder with various attributes and methods to manage and observe changes in the cardholder’s data.
Attributes
- uidstr
Unique identifier for the cardholder.
- lastNamestr
Last name of the cardholder.
- firstNamestr
First name of the cardholder.
- cardholderIdNumberany
Identification number of the cardholder.
- statusany
Status of the cardholder.
- fromDateValidany
Start date of the cardholder’s validity.
- isFromDateActiveany
Indicates if the start date is active.
- toDateValidany
End date of the cardholder’s validity.
- isToDateActiveany
Indicates if the end date is active.
- photoany
Photo of the cardholder.
- cardholderTypeCardholderType
Type of the cardholder.
- securityGroupSecurityGroup
Security group associated with the cardholder.
- cardholderPersonalDetailCardholderPersonalDetail
Personal details of the cardholder.
- cardholderCustomizedFieldCardholderCustomizedField
Customized fields for the cardholder.
- insideAreaArea
Area where the cardholder is currently located.
- ownerSiteUIDstr
Unique identifier for the owner site.
- securityGroupApiKeyany
API key for the security group.
- ownerSiteApiKeyany
API key for the owner site.
- accessGroupApiKeysany
API keys for access groups.
- liftAccessGroupApiKeysany
API keys for lift access groups.
- cardholderTypeUIDstr
Unique identifier for the cardholder type.
- departmentUIDany
Unique identifier for the department.
- descriptionstr
Description of the cardholder.
- grantAccessForSupervisorany
Indicates if access is granted for the supervisor.
- isSupervisorany
Indicates if the cardholder is a supervisor.
- needEscortany
Indicates if the cardholder needs an escort.
- personalWeeklyProgramUIDany
Unique identifier for the personal weekly program.
- pinCodestr
PIN code of the cardholder.
- sharedStatusstr
Shared status of the cardholder.
- securityGroupUIDstr
Unique identifier for the security group.
- accessGroupUIDsany
Unique identifiers for access groups.
- liftAccessGroupUIDsany
Unique identifiers for lift access groups.
- lastDownloadTimeany
Last download time of the cardholder’s data.
- lastInOutAreastr
Last in/out area of the cardholder.
- lastInOutReaderUIDany
Unique identifier for the last in/out reader.
- lastInOutDateany
Last in/out date of the cardholder.
- lastAreaReaderDateany
Last area reader date of the cardholder.
- lastAreaReaderUIDany
Unique identifier for the last area reader.
- lastPassDateany
Last pass date of the cardholder.
- lastReaderPassUIDany
Unique identifier for the last reader pass.
- insideAreaUIDstr
Unique identifier for the inside area.
- cardslist
List of cards associated with the cardholder.
Methods
- __init__(*args, kwargs)
Initializes a new instance of the Cardholder class.
- to_search_pattern()
Generates a search pattern string based on the cardholder’s details.
- pretty_print(obj: object = None)
Prints the cardholder’s attributes in a readable format.
- dict(editable_only=False, changed_only=False, non_empty_only=False)
Returns a dictionary representation of the cardholder’s attributes.
- _remove_non_changed(ch: dict)
Removes attributes that have not changed from the dictionary.
- _remove_non_editable(ch: dict)
Removes non-editable attributes from the dictionary.
- status: any = None
- fromDateValid: any = None
- isFromDateActive: any = None
- toDateValid: any = None
- isToDateActive: any = None
- photo: any = None
- securityGroupApiKey: any = None
- ownerSiteApiKey: any = None
- accessGroupApiKeys: any = None
- liftAccessGroupApiKeys: any = None
- departmentUID: any = None
- grantAccessForSupervisor: any = None
- isSupervisor: any = None
- needEscort: any = None
- personalWeeklyProgramUID: any = None
- accessGroupUIDs: any = None
- liftAccessGroupUIDs: any = None
- lastDownloadTime: any = None
- lastInOutReaderUID: any = None
- lastInOutDate: any = None
- lastAreaReaderDate: any = None
- lastAreaReaderUID: any = None
- lastPassDate: any = None
- lastReaderPassUID: any = None
- securityGroup: SecurityGroup = None
- cardholderType: CardholderType = None
- cardholderPersonalDetail: CardholderPersonalDetail = None
- cardholderCustomizedField: CardholderCustomizedField = None
- to_search_pattern()
- dict(editable_only=False, changed_only=False, non_empty_only=False)
- class pyGuardPoint.Card(*args, **kwargs)
-
- cardholderUID: any = None
- readerFunctionUID: any = None
- dict(editable_only=False, changed_only=False)
- class pyGuardPoint.CardholderPersonalDetail(*args, **kwargs)
-
- dict(editable_only=False, changed_only=False, non_empty_only=False)
- class pyGuardPoint.CardholderCustomizedField(*args, **kwargs)
-
- cF_DateTimeField_1: any = None
- cF_DateTimeField_2: any = None
- cF_DateTimeField_3: any = None
- cF_DateTimeField_4: any = None
- cF_DateTimeField_5: any = None
- dict(changed_only=False)
- class pyGuardPoint.AccessEvent(*args, **kwargs)
Represents an access event with various attributes related to cardholder and access details.
- Parameters:
accessDeniedCode (str) – Code indicating the reason for access denial.
cardCode (str) – Code of the card used for access.
cardholderFirstName (any) – First name of the cardholder.
cardholderIdNumber (any) – Identification number of the cardholder.
cardholderLastName (any) – Last name of the cardholder.
cardholderTypeName (any) – Type name of the cardholder.
cardholderTypeUID (any) – Unique identifier for the cardholder type.
cardholderUID (str) – Unique identifier for the cardholder.
carRegistrationNum (any) – Car registration number associated with the cardholder.
dateTime (str) – Date and time of the access event.
escortCardCode (any) – Code of the escort’s card.
escortFirstName (any) – First name of the escort.
escortLastName (any) – Last name of the escort.
escortUID (any) – Unique identifier for the escort.
inOutType (any) – Type of access (in or out).
isEscort (bool) – Indicates if the cardholder is an escort.
isPastEvent (bool) – Indicates if the event is a past event.
isSlave (bool) – Indicates if the event is a slave event.
journalUpdateDateTime (str) – Date and time when the journal was last updated.
logID (int) – Log identifier for the access event.
readerFunctionCodes (list) – List of function codes for the reader.
readerName (str) – Name of the reader.
readerUID (str) – Unique identifier for the reader.
transactionCode (int) – Code representing the transaction type.
type (str) – Type of the access event.
uid (str) – Unique identifier for the access event.
ownerSiteUID (str) – Unique identifier for the owner site.
additionalSites (any) – Additional sites associated with the event.
ownerSiteName (str) – Name of the owner site.
additionalSitesNames (any) – Names of additional sites associated with the event.
additionalInfo (any) – Additional information related to the access event.
- Variables:
accessDeniedCode – Code indicating the reason for access denial.
cardCode – Code of the card used for access.
cardholderFirstName – First name of the cardholder.
cardholderIdNumber – Identification number of the cardholder.
cardholderLastName – Last name of the cardholder.
cardholderTypeName – Type name of the cardholder.
cardholderTypeUID – Unique identifier for the cardholder type.
cardholderUID – Unique identifier for the cardholder.
carRegistrationNum – Car registration number associated with the cardholder.
dateTime – Date and time of the access event.
escortCardCode – Code of the escort’s card.
escortFirstName – First name of the escort.
escortLastName – Last name of the escort.
escortUID – Unique identifier for the escort.
inOutType – Type of access (in or out).
isEscort – Indicates if the cardholder is an escort.
isPastEvent – Indicates if the event is a past event.
isSlave – Indicates if the event is a slave event.
journalUpdateDateTime – Date and time when the journal was last updated.
logID – Log identifier for the access event.
readerFunctionCodes – List of function codes for the reader.
readerName – Name of the reader.
readerUID – Unique identifier for the reader.
transactionCode – Code representing the transaction type.
type – Type of the access event.
uid – Unique identifier for the access event.
ownerSiteUID – Unique identifier for the owner site.
additionalSites – Additional sites associated with the event.
ownerSiteName – Name of the owner site.
additionalSitesNames – Names of additional sites associated with the event.
additionalInfo – Additional information related to the access event.
- Raises:
ValueError – If any of the provided arguments are invalid.
- Example:
>>> event = AccessEvent(cardCode="12345", dateTime="2023-10-01T12:00:00Z") >>> event.dict() {'accessDeniedCode': '', 'cardCode': '12345', 'cardholderFirstName': None, ...}
Methods
- __init__(*args, kwargs)
Initializes an AccessEvent instance with the provided arguments.
- dict()
Converts the AccessEvent instance to a dictionary representation.
- cardholderFirstName: any = None
- cardholderIdNumber: any = None
- cardholderLastName: any = None
- cardholderTypeName: any = None
- cardholderTypeUID: any = None
- carRegistrationNum: any = None
- escortCardCode: any = None
- escortFirstName: any = None
- escortLastName: any = None
- escortUID: any = None
- inOutType: any = None
- additionalSites: any = None
- additionalSitesNames: any = None
- additionalInfo: any = None
- dict()
- class pyGuardPoint.AlarmEvent(*args, **kwargs)
- additionalSites: any = None
- additionalSitesNames: any = None
- confirmationComments: any = None
- userFirstName: any = None
- userLastName: any = None
- userName: any = None
- userUID: any = None
- dict()
- class pyGuardPoint.Relay(*args, **kwargs)
-
- description: any = None
- weeklyProgramUID: any = None
- liftReaderUID: any = None
- apiKey: any = None
- dict(editable_only=False, changed_only=False)
- class pyGuardPoint.Controller(*args, **kwargs)
- isActivated: any = None
- isPooling: any = None
- isConnected: any = None
- description: any = None
- apiKey: any = None
- dict()
- class pyGuardPoint.Reader(*args, **kwargs)
-
- description: any = None
- firstOutputUID: any = None
- secondOutputUID: any = None
- weeklyProgramUID: any = None
- readerFunctionIDs: any = None
- apiKey: any = None
- doorControlInput1UID: any = None
- doorControlInput2UID: any = None
- motorizedReaderInputUID: any = None
- dict()