updateDirectoryConfig method

Future<UpdateDirectoryConfigResult> updateDirectoryConfig({
  1. required String directoryName,
  2. List<String>? organizationalUnitDistinguishedNames,
  3. ServiceAccountCredentials? serviceAccountCredentials,
})

Updates the specified Directory Config object in AppStream 2.0. This object includes the configuration information required to join fleets and image builders to Microsoft Active Directory domains.

May throw ResourceInUseException. May throw ResourceNotFoundException. May throw ConcurrentModificationException. May throw OperationNotPermittedException. May throw InvalidRoleException.

Parameter directoryName : The name of the Directory Config object.

Parameter organizationalUnitDistinguishedNames : The distinguished names of the organizational units for computer accounts.

Parameter serviceAccountCredentials : The credentials for the service account used by the fleet or image builder to connect to the directory.

Implementation

Future<UpdateDirectoryConfigResult> updateDirectoryConfig({
  required String directoryName,
  List<String>? organizationalUnitDistinguishedNames,
  ServiceAccountCredentials? serviceAccountCredentials,
}) async {
  ArgumentError.checkNotNull(directoryName, 'directoryName');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'PhotonAdminProxyService.UpdateDirectoryConfig'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DirectoryName': directoryName,
      if (organizationalUnitDistinguishedNames != null)
        'OrganizationalUnitDistinguishedNames':
            organizationalUnitDistinguishedNames,
      if (serviceAccountCredentials != null)
        'ServiceAccountCredentials': serviceAccountCredentials,
    },
  );

  return UpdateDirectoryConfigResult.fromJson(jsonResponse.body);
}