getVariables method

Future<Response> getVariables({
  1. int? limit,
  2. String? cursor,
  3. String? projectId,
  4. String? state,
})

Retrieve all variables

Implementation

Future<Response> getVariables({
  int? limit,
  String? cursor,
  String? projectId,
  String? state,
}) async {
  try {
    final response = await _dio.get(
      '/variables',
      queryParameters: {
        if (limit != null) 'limit': limit,
        if (cursor != null) 'cursor': cursor,
        if (projectId != null) 'projectId': projectId,
        if (state != null) 'state': state,
      },
    );
    return response;
  } on DioException catch (e) {
    throw Exception('Failed to retrieve variables: ${e.message}');
  }
}