startSchemaExtension method

Future<StartSchemaExtensionResult> startSchemaExtension({
  1. required bool createSnapshotBeforeSchemaExtension,
  2. required String description,
  3. required String directoryId,
  4. required String ldifContent,
})

Applies a schema extension to a Microsoft AD directory.

May throw DirectoryUnavailableException. May throw EntityDoesNotExistException. May throw InvalidParameterException. May throw SnapshotLimitExceededException. May throw ClientException. May throw ServiceException.

Parameter createSnapshotBeforeSchemaExtension : If true, creates a snapshot of the directory before applying the schema extension.

Parameter description : A description of the schema extension.

Parameter directoryId : The identifier of the directory for which the schema extension will be applied to.

Parameter ldifContent : The LDIF file represented as a string. To construct the LdifContent string, precede each line as it would be formatted in an ldif file with \n. See the example request below for more details. The file size can be no larger than 1MB.

Implementation

Future<StartSchemaExtensionResult> startSchemaExtension({
  required bool createSnapshotBeforeSchemaExtension,
  required String description,
  required String directoryId,
  required String ldifContent,
}) async {
  ArgumentError.checkNotNull(createSnapshotBeforeSchemaExtension,
      'createSnapshotBeforeSchemaExtension');
  ArgumentError.checkNotNull(description, 'description');
  _s.validateStringLength(
    'description',
    description,
    0,
    128,
    isRequired: true,
  );
  ArgumentError.checkNotNull(directoryId, 'directoryId');
  ArgumentError.checkNotNull(ldifContent, 'ldifContent');
  _s.validateStringLength(
    'ldifContent',
    ldifContent,
    1,
    500000,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DirectoryService_20150416.StartSchemaExtension'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'CreateSnapshotBeforeSchemaExtension':
          createSnapshotBeforeSchemaExtension,
      'Description': description,
      'DirectoryId': directoryId,
      'LdifContent': ldifContent,
    },
  );

  return StartSchemaExtensionResult.fromJson(jsonResponse.body);
}