getUsers method

Implementation

Future<GenericServerResponse<GetBeaUsersOutput>> getUsers(GenericServerInput<GetBeaUsersInput>? input) async {
  GenericServerResponse<GetBeaUsersOutput> genericServerResponse = new GenericServerResponse<GetBeaUsersOutput>();
  try{

    String url = UrlUtils.getUrl(_baseUrl, UrlUtils.URL_GET_ALL_USERS);

    String jsonInput = "{}";

    Response response = await bsm!.genericBeaHttpPost(url, jsonInput);
    int? statusCode = response.statusCode;

    switch(statusCode){
      case 200:
        genericServerResponse.data = GetBeaUsersOutput.fromJson(response.data['result']);
        break;
      case 500:
        var res = response.data['error'];
        BeaError? error = res == null ? res : BeaError.fromJson(res);
        if (error != null) {
          genericServerResponse.beaError = error;
        } else {
          genericServerResponse.beaError = new BeaError("Unknown Error", 0, "");
        }
        break;
      case 401:
        genericServerResponse.beaSession = new BeaSession(true);
        break;
    }
  }on Exception catch (e){
    print('Error getUsers');
    FLog.error(
        className: this.runtimeType.toString(),
        methodName: "getUsers",
        text: 'Error getUsers - $e');
    throw e;
  }

  return genericServerResponse;
}