updateMembership method
Updates membership configuration.
Parameter membershipId :
Required element for UpdateMembership to identify the membership to
update.
Parameter incidentResponseTeam :
Optional element for UpdateMembership to update the membership name.
Parameter membershipAccountsConfigurationsUpdate :
The membershipAccountsConfigurationsUpdate field in the
UpdateMembershipRequest structure allows you to update the
configuration settings for accounts within a membership.
This field is optional and contains a structure of type
MembershipAccountsConfigurationsUpdate that specifies the
updated account configurations for the membership.
Parameter membershipName :
Optional element for UpdateMembership to update the membership name.
Parameter optInFeatures :
Optional element for UpdateMembership to enable or disable opt-in features
for the service.
Parameter undoMembershipCancellation :
The undoMembershipCancellation parameter is a boolean flag
that indicates whether to reverse a previously requested membership
cancellation. When set to true, this will revoke the cancellation request
and maintain the membership status.
This parameter is optional and can be used in scenarios where you need to restore a membership that was marked for cancellation but hasn't been fully terminated yet.
-
If set to
true, the cancellation request will be revoked -
If set to
falsethe service will throw a ValidationException.
Implementation
Future<void> updateMembership({
required String membershipId,
List<IncidentResponder>? incidentResponseTeam,
MembershipAccountsConfigurationsUpdate?
membershipAccountsConfigurationsUpdate,
String? membershipName,
List<OptInFeature>? optInFeatures,
bool? undoMembershipCancellation,
}) async {
final $payload = <String, dynamic>{
if (incidentResponseTeam != null)
'incidentResponseTeam': incidentResponseTeam,
if (membershipAccountsConfigurationsUpdate != null)
'membershipAccountsConfigurationsUpdate':
membershipAccountsConfigurationsUpdate,
if (membershipName != null) 'membershipName': membershipName,
if (optInFeatures != null) 'optInFeatures': optInFeatures,
if (undoMembershipCancellation != null)
'undoMembershipCancellation': undoMembershipCancellation,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/v1/membership/${Uri.encodeComponent(membershipId)}/update-membership',
exceptionFnMap: _exceptionFns,
);
}