createMembership method

Future<CreateMembershipResponse> createMembership({
  1. required List<IncidentResponder> incidentResponseTeam,
  2. required String membershipName,
  3. String? clientToken,
  4. bool? coverEntireOrganization,
  5. List<OptInFeature>? optInFeatures,
  6. Map<String, String>? tags,
})

Creates a new membership.

Parameter incidentResponseTeam : Required element used in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.

Parameter membershipName : Required element used in combination with CreateMembership to create a name for the membership.

Parameter clientToken :

Parameter coverEntireOrganization : The coverEntireOrganization parameter is a boolean flag that determines whether the membership should be applied to the entire Amazon Web Services Organization. When set to true, the membership will be created for all accounts within the organization. When set to false, the membership will only be created for specified accounts.

This parameter is optional. If not specified, the default value is false.

  • If set to true: The membership will automatically include all existing and future accounts in the Amazon Web Services Organization.
  • If set to false: The membership will only apply to explicitly specified accounts.

Parameter optInFeatures : Optional element to enable the monitoring and investigation opt-in features for the service.

Parameter tags : Optional element for customer configured tags.

Implementation

Future<CreateMembershipResponse> createMembership({
  required List<IncidentResponder> incidentResponseTeam,
  required String membershipName,
  String? clientToken,
  bool? coverEntireOrganization,
  List<OptInFeature>? optInFeatures,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'incidentResponseTeam': incidentResponseTeam,
    'membershipName': membershipName,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (coverEntireOrganization != null)
      'coverEntireOrganization': coverEntireOrganization,
    if (optInFeatures != null) 'optInFeatures': optInFeatures,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/membership',
    exceptionFnMap: _exceptionFns,
  );
  return CreateMembershipResponse.fromJson(response);
}