Member Group Associations
API Endpoint | Namespace | Supported Generics |
---|---|---|
member/<member_id>/groups |
evclient.member.member_groups(<member>).<method> |
CRUD |
Additional parameters¶
As member related custom fields are always bound to a specific member, the namespace used for custom field associations requires the member as constructor argument, to avoid passing it again to all endpoints:
Name | Type | Description | Default |
---|---|---|---|
member |
Member | int |
Identifies the member to modify custom field values on. Can be either an id or a Member object. |
required |
Generic Model Mappings¶
Generic Model | Invoice Model |
---|---|
ModelType |
MemberMemberGroup |
CreateModelType |
MemberMemberGroupCreate |
UpdateModelType |
MemberMemberGroupUpdate |
Additional Methods¶
add_to_group ¶
Adds a member to a group. Will silently ignore if the member is already in the group, unless ignore_existing is set to False.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
group |
MemberGroup | int
|
The group object or id to add the member to. |
required |
payment_active |
bool
|
If set to True, the group will be activated for billing purposes |
False
|
ignore_existing |
bool
|
If set to False, will raise an exception if the member is already in the group. |
False
|
get_group_membership ¶
Returns the membership object of this member in the given group, None if the member is not in the group.
This method can be useful if the group membership should be updated or deleted.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
group |
MemberGroup | int
|
The group object or id to fetch. |
required |
remove_from_group ¶
Removes a member from a group. Raises an exception if the member is not in the group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
group |
MemberGroup | int
|
The group object or id to remove the member from. |
required |
set_group_billing_status ¶
Activates or deactivates the membership of the member in the given group for billing purposes. Returns the updated membership object if successful. Raises an exception if the member is not in the group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
group |
MemberGroup | int
|
The group object or id to activate. |
required |
new_billing_status |
bool
|
The new billing status for the group. |
required |