pub struct GroupsMemberFieldsGroupResource<'a> { /* private fields */ }Expand description
client.groups().member_fields().group()
Implementations§
Source§impl<'a> GroupsMemberFieldsGroupResource<'a>
impl<'a> GroupsMemberFieldsGroupResource<'a>
Sourcepub fn create(
&self,
group_id: impl Display,
body: &GroupMemberFieldGroupCreate,
) -> Result<GroupMemberFieldGroup>
pub fn create( &self, group_id: impl Display, body: &GroupMemberFieldGroupCreate, ) -> Result<GroupMemberFieldGroup>
Create a group-specific membership field
POST /groups/{groupId}/memberfields/group
Creates a field whose values are stored separately for each person’s membership in this group. Requires permission to edit group member fields. name must be unique within the group; referenceName must also be unique and is generated from name when omitted. Choose fieldTypeCode at creation; subsequent field updates cannot change it. Select-like options receive new backend IDs, and defaults are normalized to those IDs. The response is the field definition, without a type wrapper or member values. Existing memberships are not populated with the new default by this endpoint.
§Example
let body = models::GroupMemberFieldGroupCreate {
field_type_code: "text".into(),
name: "T-Shirt size".into(),
required_in_registration_form: false,
security_level: 1,
use_in_registration_form: true,
..Default::default()
};
let result = client.groups().member_fields().group().create(42, &body)?;
println!("{}", result.name);Sourcepub fn delete(
&self,
group_id: impl Display,
group_member_field_id: impl Display,
) -> Result<()>
pub fn delete( &self, group_id: impl Display, group_member_field_id: impl Display, ) -> Result<()>
Delete a membership field and its stored values
DELETE /groups/{groupId}/memberfields/group/{groupMemberFieldId}
Deletes the group-specific field definition, its selection options and all stored member values for that field. Requires permission to edit member fields of the path group. Supply a field belonging to that group. This operation has no delete-preview workflow and returns 204 without a body. Global person fields and person-field values are unaffected.
§Example
client.groups().member_fields().group().delete(42, 42)?;Sourcepub fn patch(
&self,
group_id: impl Display,
group_member_field_id: impl Display,
body: &GroupMemberFieldGroupPatch,
) -> Result<GroupMemberFieldGroup>
pub fn patch( &self, group_id: impl Display, group_member_field_id: impl Display, body: &GroupMemberFieldGroupPatch, ) -> Result<GroupMemberFieldGroup>
Partially update a membership field definition
PATCH /groups/{groupId}/memberfields/group/{groupMemberFieldId}
Updates only supplied fields of a field belonging to the path group. Requires permission to edit group member fields. Empty {} is accepted and preserves the definition. fieldTypeCode is ignored; a field’s type cannot be changed here. When updating choices, send the full list with numeric IDs for retained choices; omitted IDs are deleted and removed from all member selections and the default. Use options=[] to remove all choices; omit options to preserve it. Avoid options=null because the current implementation reallocates IDs and can clear existing selections. Unlike create and PUT, PATCH does not check uniqueness of the display name, but it checks changed reference names.
§Example
let body = models::GroupMemberFieldGroupPatch {
name: Some("T-Shirt size".into()),
..Default::default()
};
let result = client.groups().member_fields().group().patch(42, 42, &body)?;
println!("{}", result.name);Sourcepub fn update(
&self,
group_id: impl Display,
group_member_field_id: impl Display,
body: &GroupMemberFieldGroupUpdate,
) -> Result<GroupMemberFieldGroup>
pub fn update( &self, group_id: impl Display, group_member_field_id: impl Display, body: &GroupMemberFieldGroupUpdate, ) -> Result<GroupMemberFieldGroup>
Replace a membership field definition
PUT /groups/{groupId}/memberfields/group/{groupMemberFieldId}
Updates a field belonging to the path group. Requires permission to edit group member fields and the required name/referenceName/securityLevel/registration flags. Unlike PATCH, omitted notes, signup labels and defaultValue are cleared, and sortKey resets to zero. The display name and reference name must be unique within the group. The field type is unchanged. Send the full option list with numeric IDs for retained choices: removed choices are removed from member selections and defaults. Omitting options or sending null currently reallocates existing choice IDs and can clear selections. The returned object is the saved field definition.
§Example
let body = models::GroupMemberFieldGroupUpdate {
name: "T-Shirt size".into(),
reference_name: "t-shirt-size".into(),
required_in_registration_form: false,
security_level: 1,
use_in_registration_form: true,
..Default::default()
};
let result = client.groups().member_fields().group().update(42, 42, &body)?;
println!("{}", result.name);