OpenSource » SampleCode » NexPortWebApiClient
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

Fix model errors and return default value for nullable properties

Changeset cd0c1c55fe12

Parent 186b5e2838f2

by Profile picture of Thai NguyenThai Nguyen

Changes to 4 files · Browse files at cd0c1c55fe12 Showing diff from parent 186b5e2838f2 Diff from another changeset...

 
210
211
212
213
 
214
215
216
217
218
219
220
 
221
222
223
224
225
226
227
 
228
229
230
 
245
246
247
248
 
249
250
251
252
253
254
255
 
256
257
258
 
210
211
212
 
213
214
215
216
217
218
219
 
220
221
222
223
224
225
226
 
227
228
229
230
 
245
246
247
 
248
249
250
251
252
253
254
 
255
256
257
258
@@ -210,21 +210,21 @@
  /// When this enrollment was created   /// </summary>   /// <value>When this enrollment was created</value> - [DataMember(Name = "enrollment_date", EmitDefaultValue = false)] + [DataMember(Name = "enrollment_date", EmitDefaultValue = true)]   public DateTime EnrollmentDate { get; set; }     /// <summary>   /// When this enrollment expires (UTC)   /// </summary>   /// <value>When this enrollment expires (UTC)</value> - [DataMember(Name = "expiration_date", EmitDefaultValue = false)] + [DataMember(Name = "expiration_date", EmitDefaultValue = true)]   public DateTime? ExpirationDate { get; set; }     /// <summary>   /// When this enrollment was completed by the student (UTC)   /// </summary>   /// <value>When this enrollment was completed by the student (UTC)</value> - [DataMember(Name = "completion_date", EmitDefaultValue = false)] + [DataMember(Name = "completion_date", EmitDefaultValue = true)]   public DateTime? CompletionDate { get; set; }     /// <summary> @@ -245,14 +245,14 @@
  /// When this enrollment was first accessed (UTC)   /// </summary>   /// <value>When this enrollment was first accessed (UTC)</value> - [DataMember(Name = "first_activity_date", EmitDefaultValue = false)] + [DataMember(Name = "first_activity_date", EmitDefaultValue = true)]   public DateTime? FirstActivityDate { get; set; }     /// <summary>   /// When this enrollment was last accessed (UTC)   /// </summary>   /// <value>When this enrollment was last accessed (UTC)</value> - [DataMember(Name = "last_activity_date", EmitDefaultValue = false)] + [DataMember(Name = "last_activity_date", EmitDefaultValue = true)]   public DateTime? LastActivityDate { get; set; }     /// <summary>
 
138
139
140
141
 
142
143
144
145
146
147
148
 
149
150
151
152
153
154
155
 
156
157
158
159
160
161
162
 
163
164
165
166
167
168
169
 
170
171
172
 
194
195
196
197
 
198
199
200
201
202
203
204
 
205
206
207
208
209
210
211
 
212
213
214
215
216
217
218
 
219
220
221
222
223
224
225
 
226
227
228
 
138
139
140
 
141
142
143
144
145
146
147
 
148
149
150
151
152
153
154
 
155
156
157
158
159
160
161
 
162
163
164
165
166
167
168
 
169
170
171
172
 
194
195
196
 
197
198
199
200
201
202
203
 
204
205
206
207
208
209
210
 
211
212
213
214
215
216
217
 
218
219
220
221
222
223
224
 
225
226
227
228
@@ -138,35 +138,35 @@
  /// When this syllabus was created   /// </summary>   /// <value>When this syllabus was created</value> - [DataMember(Name = "utc_date_created", EmitDefaultValue = false)] + [DataMember(Name = "utc_date_created", EmitDefaultValue = true)]   public DateTime? UtcDateCreated { get; set; }     /// <summary>   /// When this syllabus was last modified   /// </summary>   /// <value>When this syllabus was last modified</value> - [DataMember(Name = "utc_date_last_modified", EmitDefaultValue = false)] + [DataMember(Name = "utc_date_last_modified", EmitDefaultValue = true)]   public DateTime? UtcDateLastModified { get; set; }     /// <summary>   /// Does the section show up on the enrollment list?   /// </summary>   /// <value>Does the section show up on the enrollment list?</value> - [DataMember(Name = "hidden", EmitDefaultValue = false)] + [DataMember(Name = "hidden", EmitDefaultValue = true)]   public bool? Hidden { get; set; }     /// <summary>   /// Can the student print their own certificate   /// </summary>   /// <value>Can the student print their own certificate</value> - [DataMember(Name = "disable_certificates_for_student", EmitDefaultValue = false)] + [DataMember(Name = "disable_certificates_for_student", EmitDefaultValue = true)]   public bool? DisableCertificatesForStudent { get; set; }     /// <summary>   /// Are students allowed to drop the section on their own?   /// </summary>   /// <value>Are students allowed to drop the section on their own?</value> - [DataMember(Name = "allow_drops", EmitDefaultValue = false)] + [DataMember(Name = "allow_drops", EmitDefaultValue = true)]   public bool? AllowDrops { get; set; }     /// <summary> @@ -194,35 +194,35 @@
  /// The first day that the student can be enrolled into this section   /// </summary>   /// <value>The first day that the student can be enrolled into this section</value> - [DataMember(Name = "enrollment_start", EmitDefaultValue = false)] + [DataMember(Name = "enrollment_start", EmitDefaultValue = true)]   public DateTime? EnrollmentStart { get; set; }     /// <summary>   /// The last day that the student can be enrolled into this section   /// </summary>   /// <value>The last day that the student can be enrolled into this section</value> - [DataMember(Name = "enrollment_end", EmitDefaultValue = false)] + [DataMember(Name = "enrollment_end", EmitDefaultValue = true)]   public DateTime? EnrollmentEnd { get; set; }     /// <summary>   /// The last day that the student can drop this section   /// </summary>   /// <value>The last day that the student can drop this section</value> - [DataMember(Name = "final_drop_date", EmitDefaultValue = false)] + [DataMember(Name = "final_drop_date", EmitDefaultValue = true)]   public DateTime? FinalDropDate { get; set; }     /// <summary>   /// When the section opens for launching.   /// </summary>   /// <value>When the section opens for launching.</value> - [DataMember(Name = "training_start", EmitDefaultValue = false)] + [DataMember(Name = "training_start", EmitDefaultValue = true)]   public DateTime? TrainingStart { get; set; }     /// <summary>   /// When the section closes.   /// </summary>   /// <value>When the section closes.</value> - [DataMember(Name = "training_end", EmitDefaultValue = false)] + [DataMember(Name = "training_end", EmitDefaultValue = true)]   public DateTime? TrainingEnd { get; set; }     /// <summary>
 
38
39
40
41
 
42
43
44
45
 
46
47
48
 
94
95
96
97
 
98
99
100
 
108
109
110
111
112
 
 
113
114
115
 
184
185
186
187
 
188
189
190
191
 
192
193
194
195
 
196
197
198
199
 
200
201
202
203
204
 
 
205
206
207
208
209
 
 
210
211
212
213
 
 
214
215
216
 
218
219
220
221
222
 
 
223
224
225
226
227
 
 
228
229
230
 
244
245
246
247
248
 
 
 
249
250
251
 
38
39
40
 
41
42
43
44
 
45
46
47
48
 
94
95
96
 
97
98
99
100
 
108
109
110
 
 
111
112
113
114
115
 
184
185
186
 
187
188
189
190
 
191
192
193
194
 
195
196
197
198
 
199
200
201
202
 
 
203
204
205
206
207
 
 
208
209
210
211
212
 
213
214
215
216
217
 
219
220
221
 
 
222
223
224
225
226
 
 
227
228
229
230
231
 
245
246
247
 
 
248
249
250
251
252
253
@@ -38,11 +38,11 @@
  /// <param name="utcDateCreated">When this subscription was created (required).</param>   /// <param name="utcDateUpdated">When this subscription was last updated.</param>   /// <param name="billingCode">The billing code for this subscription (required).</param> - /// <param name="utcExpirationDate">When this subscription expires (required).</param> + /// <param name="utcExpirationDate">When this subscription expires.</param>   /// <param name="isDisabled">True if disabled, false if not disabled (required).</param>   /// <param name="subscriptionStatus">subscriptionStatus.</param>   /// <param name="apiErrorEntity">apiErrorEntity (required).</param> - public SubscriptionResponse(Guid subscriptionId = default, Guid userId = default, Guid orgId = default, DateTime utcDateCreated = default, DateTime? utcDateUpdated = default, string billingCode = default, DateTime utcExpirationDate = default, bool isDisabled = default, SubscriptionResponseStatus subscriptionStatus = default, ApiErrorEntity apiErrorEntity = default) + public SubscriptionResponse(Guid subscriptionId = default, Guid userId = default, Guid orgId = default, DateTime utcDateCreated = default, DateTime? utcDateUpdated = default, string billingCode = default, DateTime? utcExpirationDate = default, bool isDisabled = default, SubscriptionResponseStatus subscriptionStatus = default, ApiErrorEntity apiErrorEntity = default)   {   SubscriptionId = subscriptionId;   UserId = userId; @@ -94,7 +94,7 @@
  /// When this subscription was last updated   /// </summary>   /// <value>When this subscription was last updated</value> - [DataMember(Name = "utc_date_updated", EmitDefaultValue = false)] + [DataMember(Name = "utc_date_updated", EmitDefaultValue = true)]   public DateTime? UtcDateUpdated { get; set; }     /// <summary> @@ -108,8 +108,8 @@
  /// When this subscription expires   /// </summary>   /// <value>When this subscription expires</value> - [DataMember(Name = "utc_expiration_date", EmitDefaultValue = false)] - public DateTime UtcExpirationDate { get; set; } + [DataMember(Name = "utc_expiration_date", EmitDefaultValue = true)] + public DateTime? UtcExpirationDate { get; set; }     /// <summary>   /// True if disabled, false if not disabled @@ -184,33 +184,34 @@
  return   (   SubscriptionId == input.SubscriptionId || - (SubscriptionId.Equals(input.SubscriptionId)) + SubscriptionId.Equals(input.SubscriptionId)   ) &&   (   UserId == input.UserId || - (UserId.Equals(input.UserId)) + UserId.Equals(input.UserId)   ) &&   (   OrgId == input.OrgId || - (OrgId.Equals(input.OrgId)) + OrgId.Equals(input.OrgId)   ) &&   (   UtcDateCreated == input.UtcDateCreated || - (UtcDateCreated.Equals(input.UtcDateCreated)) + UtcDateCreated.Equals(input.UtcDateCreated)   ) &&   (   UtcDateUpdated == input.UtcDateUpdated || - (UtcDateUpdated != null && - UtcDateUpdated.Equals(input.UtcDateUpdated)) + UtcDateUpdated != null && + UtcDateUpdated.Equals(input.UtcDateUpdated)   ) &&   (   BillingCode == input.BillingCode || - (BillingCode != null && - BillingCode.Equals(input.BillingCode)) + BillingCode != null && + BillingCode.Equals(input.BillingCode)   ) &&   (   UtcExpirationDate == input.UtcExpirationDate || - (UtcExpirationDate.Equals(input.UtcExpirationDate)) + UtcExpirationDate != null && + UtcExpirationDate.Equals(input.UtcExpirationDate)   ) &&   (   IsDisabled == input.IsDisabled || @@ -218,13 +219,13 @@
  ) &&   (   SubscriptionStatus.Equals(input.SubscriptionStatus) || - (SubscriptionStatus != null && - SubscriptionStatus.Equals(input.SubscriptionStatus)) + SubscriptionStatus != null && + SubscriptionStatus.Equals(input.SubscriptionStatus)   ) &&   (   ApiErrorEntity.Equals(input.ApiErrorEntity) || - (ApiErrorEntity != null && - ApiErrorEntity.Equals(input.ApiErrorEntity)) + ApiErrorEntity != null && + ApiErrorEntity.Equals(input.ApiErrorEntity)   );   }   @@ -244,8 +245,9 @@
  if (UtcDateUpdated != null)   hashCode = hashCode * 59 + UtcDateUpdated.GetHashCode();   if (BillingCode != null) - hashCode = hashCode * 59 + BillingCode.GetHashCode(); - hashCode = hashCode * 59 + UtcExpirationDate.GetHashCode(); + hashCode = hashCode * 59 + BillingCode.GetHashCode(); + if (UtcExpirationDate != null) + hashCode = hashCode * 59 + UtcExpirationDate.GetHashCode();   hashCode = hashCode * 59 + IsDisabled.GetHashCode();   if (SubscriptionStatus != null)   hashCode = hashCode * 59 + SubscriptionStatus.GetHashCode();
 
6
7
8
9
10
11
 
 
 
12
13
14
15
16
17
 
18
19
20
 
 
21
22
23
 
6
7
8
 
 
 
9
10
11
12
13
14
15
16
 
17
18
 
 
19
20
21
22
23
@@ -6,18 +6,18 @@
  <Authors>Nexport Solutions</Authors>   <Company>Darwin Global, LLC</Company>   <GeneratePackageOnBuild>true</GeneratePackageOnBuild> - <AssemblyVersion>1.0.25.0000</AssemblyVersion> - <FileVersion>1.0.25.0000</FileVersion> - <Version>1.0.25</Version> + <AssemblyVersion>1.0.26.0000</AssemblyVersion> + <FileVersion>1.0.26.0000</FileVersion> + <Version>1.0.26</Version>   <PackageTags>nexport, nexport api, nexport sdk</PackageTags>   <Description>Client SDK for integration with Nexport v6.4.6 and newer</Description>   </PropertyGroup>     <ItemGroup> - <PackageReference Include="JsonSubTypes" Version="1.7.0" /> + <PackageReference Include="JsonSubTypes" Version="1.8.0" />   <PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> - <PackageReference Include="RestSharp" Version="106.11.4" /> - <PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" /> + <PackageReference Include="RestSharp" Version="106.12.0" /> + <PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />   </ItemGroup>    </Project>