@espressif/rainmaker-base-cdf
    Preparing search index...

    Class ESPRMGroup

    Represents a user group in the system, responsible for managing group-related information and associated nodes.

    The ESPRMGroup class holds details about the group such as its name, ID, associated nodes, subgroups, and additional properties like metadata and custom data.

    Implements

    Index

    Constructors

    • Creates an instance of ESPRMGroup with the specified configuration.

      Parameters

      • config: ESPRMGroupInterface

        The configuration object containing the properties to initialize the group.

      Returns ESPRMGroup

    Properties

    customData?: Record<string, any>

    Custom data associated with the group.

    description?: string

    A description of the group.

    fabricId?: string

    The fabric ID associated with the group.

    id: string

    The unique identifier of the group.

    isMatter?: boolean

    Indicates whether the group is a Matter-enabled group.

    isPrimaryUser?: boolean

    Indicates whether the group is a primary user group.

    metadata?: Record<string, any>

    Additional metadata associated with the group.

    mutuallyExclusive?: boolean

    Indicates whether the group has mutually exclusive users.

    name: string

    The name of the group.

    nodeDetails?: ESPRMNode[]

    A list of ESPRMNode instances representing the nodes in the group.

    nodes?: string[]

    A list of node IDs associated with the group.

    parentGroupId?: string

    The ID of the parent group.

    subGroups?: ESPRMGroup[]

    A list of subgroups within this group.

    totalNodes?: number

    The total number of nodes in the group.

    type?: string

    The type of the group (e.g., "admin", "user").

    Methods

    • Adds a list of nodes to the current group.

      Parameters

      • nodeList: string[]

        The list of node IDs to add to the group.

      Returns Promise<ESPAPIResponse>

      A promise that resolves to the API success response.

      If the nodeList is empty.

    • Creates a sub-group under the current group.

      Parameters

      Returns Promise<ESPRMGroup>

      A promise that resolves to the created sub-group as an ESPRMGroup instance.

    • Deletes the current group.

      Returns Promise<ESPAPIResponse>

      A promise that resolves to the API success response.

    • Retrieves the list of node IDs associated with the group.

      Returns Promise<string[]>

      A promise that resolves to an array of node IDs.

    • Retrieves a list of nodes with detailed information.

      Returns Promise<ESPRMNode[]>

      A promise that resolves to an array of ESPRMNode instances with detailed data.

    • Retrieves the list of sub-groups for the current group.

      Returns Promise<ESPRMGroup[]>

      A promise that resolves to an array of ESPRMGroup instances representing the sub-groups.

    • Removes the user from the current group.

      This method sends a DELETE request to the API to remove the user's association with the current group, effectively allowing the user to leave the group.

      Returns Promise<ESPAPIResponse>

      A promise that resolves to the API success response.

    • Removes a list of nodes from the current group.

      Parameters

      • nodeList: string[]

        The list of node IDs to remove from the group.

      Returns Promise<ESPAPIResponse>

      A promise that resolves to the API success response.

      If the nodeList is empty.

    • Removes sharing permissions for a specified user in the current group.

      Parameters

      • username: string

        The username of the user for whom sharing permissions will be removed.

      Returns Promise<ESPAPIResponse>

      A promise that resolves to the API success response.

    • Shares the specified groups with a user.

      Parameters

      Returns Promise<string>

      A promise that resolves to the request ID from the API.

    • Transfers the specified groups to another user.

      Parameters

      Returns Promise<string>

      A promise that resolves to the request ID from the API.

    • Updates the information of the current group.

      Parameters

      Returns Promise<ESPAPIResponse>

      A promise that resolves to the API success response.

    • Updates the metadata of the current group.

      Parameters

      • metadata: Record<string, any>

        The new metadata to set for the group.

      Returns Promise<ESPAPIResponse>

      A promise that resolves to the API success response.