createProfile method

Future<CreateProfileResponse> createProfile({
  1. required String businessName,
  2. required Logging logging,
  3. required String name,
  4. required String phone,
  5. String? clientToken,
  6. String? email,
  7. List<Tag>? tags,
})

Creates a customer profile. You can have up to five customer profiles, each representing a distinct private network. A profile is the mechanism used to create the concept of a private network.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter businessName : Specifies the name for the business associated with this profile.

Parameter logging : Specifies whether or not logging is enabled for this profile.

Parameter name : Specifies the name of the profile.

Parameter phone : Specifies the phone number associated with the profile.

Parameter clientToken : Reserved for future use.

Parameter email : Specifies the email address associated with this customer profile.

Parameter tags : Specifies the key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to resources (capabilities, partnerships, and so on) for any purpose.

Implementation

Future<CreateProfileResponse> createProfile({
  required String businessName,
  required Logging logging,
  required String name,
  required String phone,
  String? clientToken,
  String? email,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'B2BI.CreateProfile'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'businessName': businessName,
      'logging': logging.value,
      'name': name,
      'phone': phone,
      'clientToken': clientToken ?? _s.generateIdempotencyToken(),
      if (email != null) 'email': email,
      if (tags != null) 'tags': tags,
    },
  );

  return CreateProfileResponse.fromJson(jsonResponse.body);
}