Skip to content

Commit f7fd18b

Browse files
authored
Merge pull request #109 from tranpl/jan_2023_update
Jan 2023 update
2 parents 9df2007 + 799084e commit f7fd18b

File tree

10 files changed

+2458
-882
lines changed

10 files changed

+2458
-882
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,21 @@ __Install directly in Package Manager Console or Command Line Interface__
8080
```C#
8181
Package Manager
8282

83-
Install-Package RedcapAPI -Version 1.3.0
83+
Install-Package RedcapAPI -Version 1.3.1
8484

8585
```
8686

8787
```C#
8888
.NET CLI
8989

90-
dotnet add package RedcapAPI --version 1.3.0
90+
dotnet add package RedcapAPI --version 1.3.1
9191

9292
```
9393

9494
```C#
9595
Paket CLI
9696

97-
paket add RedcapAPI --version 1.3.0
97+
paket add RedcapAPI --version 1.3.1
9898

9999
```
100100

RedcapApi/Api/RedcapApi.cs

+685-716
Large diffs are not rendered by default.

RedcapApi/Interfaces/IRedcap.cs

+1,629-75
Large diffs are not rendered by default.

RedcapApi/Models/Format.cs

-39
This file was deleted.

RedcapApi/Models/RedcapFormat.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ namespace Redcap.Models
88
/// Format, 0 = json
99
/// Format, 1 = csv [default]
1010
/// Format, 2 = xml
11+
/// </summary>
12+
///
1113
public enum RedcapFormat
1214
{
1315

14-
/// </summary>
1516
/// <summary>
1617
/// Default Javascript Notation
1718
/// </summary>

RedcapApi/Models/RedcapReturnFormat.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ namespace Redcap.Models
66
/// Specifies the format of error messages
77
///
88
/// The format that the response object should be if there are errors generated when executing the http request.
9-
/// OnErrorFormat, 0 = json
10-
/// OnErrorFormat, 1 = csv
11-
/// OnErrorFormat, 2 = xml
9+
/// ReturnFormat, 0 = json
10+
/// ReturnFormat, 1 = csv
11+
/// ReturnFormat, 2 = xml
12+
/// </summary>
1213
///
1314
public enum RedcapReturnFormat
1415
{
1516

16-
/// </summary>
1717
/// <summary>
1818
/// Default Javascript Notation
1919
/// </summary>

RedcapApi/Models/RedcapUser.cs

+88
Original file line numberDiff line numberDiff line change
@@ -2,89 +2,177 @@
22

33
namespace Redcap.Models
44
{
5+
/// <summary>
6+
/// Redcap User Class
7+
/// </summary>
58
public class RedcapUser
69
{
10+
/// <summary>
11+
/// username
12+
/// </summary>
713
[Display(Name = "username")]
814
public string Username { get; set; }
915

16+
/// <summary>
17+
/// expiration date
18+
/// </summary>
1019
[Display(Name = "expiration")]
1120
public string Expiration { get; set; }
1221

22+
/// <summary>
23+
/// data access group
24+
/// </summary>
1325
[Display(Name = "data_access_group")]
1426
public string DataAccessGroup { get; set; }
1527

28+
/// <summary>
29+
/// design
30+
/// </summary>
1631
[Display(Name = "design")]
1732
public string Design { get; set; }
1833

34+
/// <summary>
35+
/// user rights
36+
/// </summary>
1937
[Display(Name = "user_rights")]
2038
public string UserRights { get; set; }
2139

40+
/// <summary>
41+
/// data access groups
42+
/// </summary>
2243
[Display(Name = "data_access_groups")]
2344
public string DataAccessGroups { get; set; }
2445

46+
/// <summary>
47+
/// data export
48+
/// </summary>
2549
[Display(Name = "data_export")]
2650
public string DataExport { get; set; }
2751

52+
/// <summary>
53+
/// reports
54+
/// </summary>
2855
[Display(Name = "reports")]
2956
public string Reports { get; set; }
3057

58+
/// <summary>
59+
/// stats and charts
60+
/// </summary>
3161
[Display(Name = "stats_and_charts")]
3262
public string StatsAndCharts { get; set; }
3363

64+
/// <summary>
65+
/// manage survey participants
66+
/// </summary>
3467
[Display(Name = "manage_survey_participants")]
3568
public string ManageSurveyParticipants { get; set; }
3669

70+
/// <summary>
71+
/// calendar
72+
/// </summary>
3773
[Display(Name = "calendar")]
3874
public string Calendar { get; set; }
3975

76+
/// <summary>
77+
/// data import tool
78+
/// </summary>
4079
[Display(Name = "data_import_tool")]
4180
public string DataImportTool { get; set; }
4281

82+
/// <summary>
83+
/// data comparison tool
84+
/// </summary>
4385
[Display(Name = "data_comparison_tool")]
4486
public string DataComparisonTool { get; set; }
4587

88+
/// <summary>
89+
/// logging
90+
/// </summary>
4691
[Display(Name = "logging")]
4792
public string Logging { get; set; }
4893

94+
95+
/// <summary>
96+
/// file repository
97+
/// </summary>
4998
[Display(Name = "file_repository")]
5099
public string FileRepository { get; set; }
51100

101+
/// <summary>
102+
/// data quality create
103+
/// </summary>
52104
[Display(Name = "data_quality_create")]
53105
public string DataQualityCreate { get; set; }
54106

107+
/// <summary>
108+
/// data quality execute
109+
/// </summary>
55110
[Display(Name = "data_quality_execute")]
56111
public string DataQualityExecute { get; set; }
57112

113+
/// <summary>
114+
/// api export
115+
/// </summary>
58116
[Display(Name = "api_export")]
59117
public string ApiExport { get; set; }
60118

119+
/// <summary>
120+
/// api import
121+
/// </summary>
61122
[Display(Name = "api_import")]
62123
public string ApiImport { get; set; }
63124

125+
/// <summary>
126+
/// mobile app
127+
/// </summary>
64128
[Display(Name = "mobile_app")]
65129
public string MobileApp { get; set; }
66130

131+
/// <summary>
132+
/// record create tool
133+
/// </summary>
67134
[Display(Name ="record_create_tool")]
68135
public string RecordCreateTool { get; set; }
69136

137+
/// <summary>
138+
/// mobile app download data
139+
/// </summary>
70140
[Display(Name = "mobile_app_download_data")]
71141
public string MobileAppDownloadData { get; set; }
72142

143+
/// <summary>
144+
/// record create
145+
/// </summary>
73146
[Display(Name = "record_create")]
74147
public string RecordCreate { get; set; }
75148

149+
/// <summary>
150+
/// record rename
151+
/// </summary>
76152
[Display(Name = "record_rename")]
77153
public string RecordRename { get; set; }
78154

155+
/// <summary>
156+
/// record delete
157+
/// </summary>
79158
[Display(Name = "record_delete")]
80159
public string RecordDelete { get; set; }
81160

161+
/// <summary>
162+
/// lock records all forms
163+
/// </summary>
82164
[Display(Name = "lock_records_all_forms")]
83165
public string LockRecordsAllForms { get; set; }
84166

167+
/// <summary>
168+
/// lock records
169+
/// </summary>
85170
[Display(Name = "lock_records")]
86171
public string LockRecords { get; set; }
87172

173+
/// <summary>
174+
/// lock records customization
175+
/// </summary>
88176
[Display(Name = "lock_records_customization")]
89177
public string LockRecordsCustomization { get; set; }
90178
}

RedcapApi/Redcap.csproj

+8-5
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,23 @@
1010
<Description>This library allows applications on the .NET platform to make http calls to REDCap instances.</Description>
1111
<Product>Redcap Api Library</Product>
1212
<PackageId>RedcapAPI</PackageId>
13-
<Version>1.3.0</Version>
14-
<AssemblyVersion>1.3.0</AssemblyVersion>
13+
<Version>1.3.1</Version>
14+
<AssemblyVersion>1.3.1</AssemblyVersion>
1515
<PackageTags>redcap api library vcu</PackageTags>
1616
<ApplicationIcon />
1717
<OutputType>Library</OutputType>
1818
<NeutralLanguage>en</NeutralLanguage>
19-
<FileVersion>1.3.0</FileVersion>
19+
<FileVersion>1.3.1</FileVersion>
2020
<Copyright>https://github.com/cctrbic/redcap-api/blob/master/LICENSE.md</Copyright>
2121
<icon>https://vortex.cctr.vcu.edu/images/ram_crest_160.png</icon>
2222
<PackageIcon>vcu.png</PackageIcon>
2323
<Title>Redcap Api</Title>
24-
<PackageReleaseNotes>- add new api methods for FileRepository
25-
- update documentation</PackageReleaseNotes>
24+
<PackageReleaseNotes>-update api documentation,
25+
-multiple breaking changes
26+
-fix some apis where parameters were behind the releases
27+
-streamline api parameters to match official documentations</PackageReleaseNotes>
2628
<PackageReadmeFile>README.md</PackageReadmeFile>
29+
<GenerateDocumentationFile>True</GenerateDocumentationFile>
2730
</PropertyGroup>
2831
<ItemGroup>
2932
<None Include="..\README.md">

RedcapApi/Utilities/Utils.cs

+17-17
Original file line numberDiff line numberDiff line change
@@ -211,45 +211,45 @@ public static async Task<string> HandleReturnContent(this RedcapApi redcapApi, R
211211
/// <param name="onErrorFormat"></param>
212212
/// <param name="redcapDataType"></param>
213213
/// <returns>tuple, string, string, string</returns>
214-
public static async Task<(string format, string onErrorFormat, string redcapDataType)> HandleFormat(this RedcapApi redcapApi, ReturnFormat? format = ReturnFormat.json, OnErrorFormat? onErrorFormat = OnErrorFormat.json, RedcapDataType? redcapDataType = RedcapDataType.flat)
214+
public static async Task<(string format, string onErrorFormat, string redcapDataType)> HandleFormat(this RedcapApi redcapApi, RedcapFormat? format = RedcapFormat.json, RedcapReturnFormat? onErrorFormat = RedcapReturnFormat.json, RedcapDataType? redcapDataType = RedcapDataType.flat)
215215
{
216216
// default
217-
var _format = ReturnFormat.json.ToString();
218-
var _onErrorFormat = OnErrorFormat.json.ToString();
217+
var _format = RedcapFormat.json.ToString();
218+
var _onErrorFormat = RedcapReturnFormat.json.ToString();
219219
var _redcapDataType = RedcapDataType.flat.ToString();
220220

221221
try
222222
{
223223

224224
switch (format)
225225
{
226-
case ReturnFormat.json:
227-
_format = ReturnFormat.json.ToString();
226+
case RedcapFormat.json:
227+
_format = RedcapFormat.json.ToString();
228228
break;
229-
case ReturnFormat.csv:
230-
_format = ReturnFormat.csv.ToString();
229+
case RedcapFormat.csv:
230+
_format = RedcapFormat.csv.ToString();
231231
break;
232-
case ReturnFormat.xml:
233-
_format = ReturnFormat.xml.ToString();
232+
case RedcapFormat.xml:
233+
_format = RedcapFormat.xml.ToString();
234234
break;
235235
default:
236-
_format = ReturnFormat.json.ToString();
236+
_format = RedcapFormat.json.ToString();
237237
break;
238238
}
239239

240240
switch (onErrorFormat)
241241
{
242-
case OnErrorFormat.json:
243-
_onErrorFormat = OnErrorFormat.json.ToString();
242+
case RedcapReturnFormat.json:
243+
_onErrorFormat = RedcapReturnFormat.json.ToString();
244244
break;
245-
case OnErrorFormat.csv:
246-
_onErrorFormat = OnErrorFormat.csv.ToString();
245+
case RedcapReturnFormat.csv:
246+
_onErrorFormat = RedcapReturnFormat.csv.ToString();
247247
break;
248-
case OnErrorFormat.xml:
249-
_onErrorFormat = OnErrorFormat.xml.ToString();
248+
case RedcapReturnFormat.xml:
249+
_onErrorFormat = RedcapReturnFormat.xml.ToString();
250250
break;
251251
default:
252-
_onErrorFormat = OnErrorFormat.json.ToString();
252+
_onErrorFormat = RedcapReturnFormat.json.ToString();
253253
break;
254254
}
255255

0 commit comments

Comments
 (0)