createConferenceProvider method

Future<CreateConferenceProviderResponse> createConferenceProvider({
  1. required String conferenceProviderName,
  2. required ConferenceProviderType conferenceProviderType,
  3. required MeetingSetting meetingSetting,
  4. String? clientRequestToken,
  5. IPDialIn? iPDialIn,
  6. PSTNDialIn? pSTNDialIn,
})

Adds a new conference provider under the user's AWS account.

May throw AlreadyExistsException.

Parameter conferenceProviderName : The name of the conference provider.

Parameter conferenceProviderType : Represents a type within a list of predefined types.

Parameter meetingSetting : The meeting settings for the conference provider.

Parameter clientRequestToken : The request token of the client.

Parameter iPDialIn : The IP endpoint and protocol for calling.

Parameter pSTNDialIn : The information for PSTN conferencing.

Implementation

Future<CreateConferenceProviderResponse> createConferenceProvider({
  required String conferenceProviderName,
  required ConferenceProviderType conferenceProviderType,
  required MeetingSetting meetingSetting,
  String? clientRequestToken,
  IPDialIn? iPDialIn,
  PSTNDialIn? pSTNDialIn,
}) async {
  ArgumentError.checkNotNull(
      conferenceProviderName, 'conferenceProviderName');
  _s.validateStringLength(
    'conferenceProviderName',
    conferenceProviderName,
    1,
    50,
    isRequired: true,
  );
  ArgumentError.checkNotNull(
      conferenceProviderType, 'conferenceProviderType');
  ArgumentError.checkNotNull(meetingSetting, 'meetingSetting');
  _s.validateStringLength(
    'clientRequestToken',
    clientRequestToken,
    10,
    150,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AlexaForBusiness.CreateConferenceProvider'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ConferenceProviderName': conferenceProviderName,
      'ConferenceProviderType': conferenceProviderType.toValue(),
      'MeetingSetting': meetingSetting,
      'ClientRequestToken':
          clientRequestToken ?? _s.generateIdempotencyToken(),
      if (iPDialIn != null) 'IPDialIn': iPDialIn,
      if (pSTNDialIn != null) 'PSTNDialIn': pSTNDialIn,
    },
  );

  return CreateConferenceProviderResponse.fromJson(jsonResponse.body);
}