wxc_sdk.groups package

Groups API

class wxc_sdk.groups.GroupMember(*, id: str | None = None, type: str | None = None, displayName: str | None = None, operation: str | None = None)[source]

Bases: ApiModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.

member_id: str | None

Person ID of the group member.

member_type: str | None

Member type.

display_name: str | None
operation: str | None
model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'forbid', 'populate_by_name': True, 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'display_name': FieldInfo(annotation=Union[str, NoneType], required=False, alias='displayName', alias_priority=1), 'member_id': FieldInfo(annotation=Union[str, NoneType], required=False, alias='id', alias_priority=2), 'member_type': FieldInfo(annotation=Union[str, NoneType], required=False, alias='type', alias_priority=2), 'operation': FieldInfo(annotation=Union[str, NoneType], required=False, alias='operation', alias_priority=1)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class wxc_sdk.groups.Group(*, id: str | None = None, displayName: str | None = None, members: list[GroupMember] | None = None, orgId: str | None = None, description: str | None = None, created: datetime | None = None, lastModified: datetime | None = None, memberSize: int | None = None, usage: str | None = None)[source]

Bases: ApiModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.

group_id: str | None

A unique identifier for the group.

display_name: str | None

The name of the group.

members: list[GroupMember] | None

An array of members

org_id: str | None

The ID of the organization to which this group belongs.

description: str | None
created: datetime | None

The timestamp indicating creation date/time of group

last_modified: datetime | None

The timestamp indicating lastModification time of group

member_size: int | None
usage: str | None
model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'forbid', 'populate_by_name': True, 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'created': FieldInfo(annotation=Union[datetime, NoneType], required=False, alias='created', alias_priority=1), 'description': FieldInfo(annotation=Union[str, NoneType], required=False, alias='description', alias_priority=1), 'display_name': FieldInfo(annotation=Union[str, NoneType], required=False, alias='displayName', alias_priority=1), 'group_id': FieldInfo(annotation=Union[str, NoneType], required=False, alias='id', alias_priority=2), 'last_modified': FieldInfo(annotation=Union[datetime, NoneType], required=False, alias='lastModified', alias_priority=1), 'member_size': FieldInfo(annotation=Union[int, NoneType], required=False, alias='memberSize', alias_priority=1), 'members': FieldInfo(annotation=Union[list[GroupMember], NoneType], required=False, alias='members', alias_priority=1), 'org_id': FieldInfo(annotation=Union[str, NoneType], required=False, alias='orgId', alias_priority=1), 'usage': FieldInfo(annotation=Union[str, NoneType], required=False, alias='usage', alias_priority=1)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class wxc_sdk.groups.GroupsApi(*, session: RestSession, base: str | None = None)[source]

Bases: ApiChild

Groups contain a collection of members in Webex. A member represents a Webex user. A group is used to assign templates and settings to the set of members contained in a group. To create and manage a group, including adding and removing members from a group, an auth token containing the identity:groups_rw is required. Searching and viewing members of a group requires an auth token with a scope of identity:groups_read. To learn more about managing people to use as members in the /groups API please refer to the People API.

list(include_members: bool | None = None, attributes: str | None = None, sort_by: str | None = None, sort_order: str | None = None, list_filter: str | None = None, org_id: str | None = None, **params) Generator[Group, None, None][source]

List groups in your organization.

Parameters:
  • include_members (bool) – Include members in list response

  • attributes (str) – comma separated list of attributes to return

  • sort_by (str) – attribute to sort by

  • sort_order (str) – sort order, ascending or descending

  • org_id (str) – List groups in this organization. Only admin users of another organization (such as partners) may use this parameter.

  • list_filter (str) – Searches the group by displayName with an operator and a value. The available operators are eq (equal) and sw (starts with). Only displayName can be used to filter results.

  • params

Returns:

generator of Group objects

create(settings: Group) Group[source]

Create a new group using the provided settings. Only display_name is mandatory

Parameters:

settings (Group) – settings for new group

Returns:

new group

Return type:

Group

details(group_id: str, include_members: bool | None = None) Group[source]

Get group details

Parameters:
  • group_id (str) – group id

  • include_members (bool) – return members in response

Returns:

group details

Return type:

Group

members(group_id: str, **params) Generator[GroupMember, None, None][source]

Query members of a group

Parameters:
  • group_id (str) – group id

  • params

Returns:

generator of GroupMember instances

update(group_id: str, settings: Group | None = None, remove_all: bool | None = None) Group[source]

update group information.

Options: change displayName, add new members, remove some or all members, replace all members

Parameters:
  • group_id

  • settings

  • remove_all

Returns:

delete_group(group_id: str)[source]

Delete a group

Parameters:

group_id (str) – group id

base = 'groups'
session: RestSession

REST session