updateProfile method

Future<UpdateProfileResponse> updateProfile({
  1. required String profileId,
  2. String? businessName,
  3. String? email,
  4. String? name,
  5. String? phone,
})

Updates the specified parameters for a profile. 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 profileId : Specifies the unique, system-generated identifier for the profile.

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

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

Parameter name : The name of the profile, used to identify it.

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

Implementation

Future<UpdateProfileResponse> updateProfile({
  required String profileId,
  String? businessName,
  String? email,
  String? name,
  String? phone,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'B2BI.UpdateProfile'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'profileId': profileId,
      if (businessName != null) 'businessName': businessName,
      if (email != null) 'email': email,
      if (name != null) 'name': name,
      if (phone != null) 'phone': phone,
    },
  );

  return UpdateProfileResponse.fromJson(jsonResponse.body);
}