Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add net standard support for OneOfs (box/box-codegen#674) #421

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "271bf60", "specHash": "06fc5f7", "version": "1.8.0" }
{ "engineHash": "91ccaf2", "specHash": "6782a0d", "version": "1.8.0" }
18 changes: 9 additions & 9 deletions Box.Sdk.Gen.Tests.Integration/Test/Commons/ICommonsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@

namespace Box.Sdk.Gen {
public interface ICommonsManager {
public BoxJwtAuth GetJwtAuth();
BoxJwtAuth GetJwtAuth();

public BoxClient GetDefaultClientWithUserSubject(string userId);
BoxClient GetDefaultClientWithUserSubject(string userId);

public BoxClient GetDefaultClient();
BoxClient GetDefaultClient();

public System.Threading.Tasks.Task<FolderFull> CreateNewFolderAsync();
System.Threading.Tasks.Task<FolderFull> CreateNewFolderAsync();

public System.Threading.Tasks.Task<FileFull> UploadNewFileAsync();
System.Threading.Tasks.Task<FileFull> UploadNewFileAsync();

public System.Threading.Tasks.Task<TermsOfService> GetOrCreateTermsOfServicesAsync();
System.Threading.Tasks.Task<TermsOfService> GetOrCreateTermsOfServicesAsync();

public System.Threading.Tasks.Task<ClassificationTemplateFieldsOptionsField> GetOrCreateClassificationAsync(ClassificationTemplate classificationTemplate);
System.Threading.Tasks.Task<ClassificationTemplateFieldsOptionsField> GetOrCreateClassificationAsync(ClassificationTemplate classificationTemplate);

public System.Threading.Tasks.Task<ClassificationTemplate> GetOrCreateClassificationTemplateAsync();
System.Threading.Tasks.Task<ClassificationTemplate> GetOrCreateClassificationTemplateAsync();

public System.Threading.Tasks.Task<ShieldInformationBarrier> GetOrCreateShieldInformationBarrierAsync(BoxClient client, string enterpriseId);
System.Threading.Tasks.Task<ShieldInformationBarrier> GetOrCreateShieldInformationBarrierAsync(BoxClient client, string enterpriseId);

}
}
4 changes: 4 additions & 0 deletions Box.Sdk.Gen/Internal/OneOfT1.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
namespace Box.Sdk.Gen {
public class OneOf<T0> {
#if NETSTANDARD2_0
protected T0 _val0 { get; }
#else
protected T0? _val0 { get; }
#endif

protected OneOf (T0 value) { _val0 = value; }

Expand Down
8 changes: 8 additions & 0 deletions Box.Sdk.Gen/Internal/OneOfT2.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
namespace Box.Sdk.Gen {
public class OneOf<T0,T1> {
#if NETSTANDARD2_0
protected T0 _val0 { get; }
#else
protected T0? _val0 { get; }
#endif

#if NETSTANDARD2_0
protected T1 _val1 { get; }
#else
protected T1? _val1 { get; }
#endif

protected OneOf (T0 value) { _val0 = value; }

Expand Down
12 changes: 12 additions & 0 deletions Box.Sdk.Gen/Internal/OneOfT3.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
namespace Box.Sdk.Gen {
public class OneOf<T0,T1,T2> {
#if NETSTANDARD2_0
protected T0 _val0 { get; }
#else
protected T0? _val0 { get; }
#endif

#if NETSTANDARD2_0
protected T1 _val1 { get; }
#else
protected T1? _val1 { get; }
#endif

#if NETSTANDARD2_0
protected T2 _val2 { get; }
#else
protected T2? _val2 { get; }
#endif

protected OneOf (T0 value) { _val0 = value; }

Expand Down
16 changes: 16 additions & 0 deletions Box.Sdk.Gen/Internal/OneOfT4.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
namespace Box.Sdk.Gen {
public class OneOf<T0,T1,T2,T3> {
#if NETSTANDARD2_0
protected T0 _val0 { get; }
#else
protected T0? _val0 { get; }
#endif

#if NETSTANDARD2_0
protected T1 _val1 { get; }
#else
protected T1? _val1 { get; }
#endif

#if NETSTANDARD2_0
protected T2 _val2 { get; }
#else
protected T2? _val2 { get; }
#endif

#if NETSTANDARD2_0
protected T3 _val3 { get; }
#else
protected T3? _val3 { get; }
#endif

protected OneOf (T0 value) { _val0 = value; }

Expand Down
20 changes: 20 additions & 0 deletions Box.Sdk.Gen/Internal/OneOfT5.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,34 @@
namespace Box.Sdk.Gen {
public class OneOf<T0,T1,T2,T3,T4> {
#if NETSTANDARD2_0
protected T0 _val0 { get; }
#else
protected T0? _val0 { get; }
#endif

#if NETSTANDARD2_0
protected T1 _val1 { get; }
#else
protected T1? _val1 { get; }
#endif

#if NETSTANDARD2_0
protected T2 _val2 { get; }
#else
protected T2? _val2 { get; }
#endif

#if NETSTANDARD2_0
protected T3 _val3 { get; }
#else
protected T3? _val3 { get; }
#endif

#if NETSTANDARD2_0
protected T4 _val4 { get; }
#else
protected T4? _val4 { get; }
#endif

protected OneOf (T0 value) { _val0 = value; }

Expand Down
24 changes: 24 additions & 0 deletions Box.Sdk.Gen/Internal/OneOfT6.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,40 @@
namespace Box.Sdk.Gen {
public class OneOf<T0,T1,T2,T3,T4,T5> {
#if NETSTANDARD2_0
protected T0 _val0 { get; }
#else
protected T0? _val0 { get; }
#endif

#if NETSTANDARD2_0
protected T1 _val1 { get; }
#else
protected T1? _val1 { get; }
#endif

#if NETSTANDARD2_0
protected T2 _val2 { get; }
#else
protected T2? _val2 { get; }
#endif

#if NETSTANDARD2_0
protected T3 _val3 { get; }
#else
protected T3? _val3 { get; }
#endif

#if NETSTANDARD2_0
protected T4 _val4 { get; }
#else
protected T4? _val4 { get; }
#endif

#if NETSTANDARD2_0
protected T5 _val5 { get; }
#else
protected T5? _val5 { get; }
#endif

protected OneOf (T0 value) { _val0 = value; }

Expand Down
28 changes: 28 additions & 0 deletions Box.Sdk.Gen/Internal/OneOfT7.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,46 @@
namespace Box.Sdk.Gen {
public class OneOf<T0,T1,T2,T3,T4,T5,T6> {
#if NETSTANDARD2_0
protected T0 _val0 { get; }
#else
protected T0? _val0 { get; }
#endif

#if NETSTANDARD2_0
protected T1 _val1 { get; }
#else
protected T1? _val1 { get; }
#endif

#if NETSTANDARD2_0
protected T2 _val2 { get; }
#else
protected T2? _val2 { get; }
#endif

#if NETSTANDARD2_0
protected T3 _val3 { get; }
#else
protected T3? _val3 { get; }
#endif

#if NETSTANDARD2_0
protected T4 _val4 { get; }
#else
protected T4? _val4 { get; }
#endif

#if NETSTANDARD2_0
protected T5 _val5 { get; }
#else
protected T5? _val5 { get; }
#endif

#if NETSTANDARD2_0
protected T6 _val6 { get; }
#else
protected T6? _val6 { get; }
#endif

protected OneOf (T0 value) { _val0 = value; }

Expand Down
32 changes: 32 additions & 0 deletions Box.Sdk.Gen/Internal/OneOfT8.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,52 @@
namespace Box.Sdk.Gen {
public class OneOf<T0,T1,T2,T3,T4,T5,T6,T7> {
#if NETSTANDARD2_0
protected T0 _val0 { get; }
#else
protected T0? _val0 { get; }
#endif

#if NETSTANDARD2_0
protected T1 _val1 { get; }
#else
protected T1? _val1 { get; }
#endif

#if NETSTANDARD2_0
protected T2 _val2 { get; }
#else
protected T2? _val2 { get; }
#endif

#if NETSTANDARD2_0
protected T3 _val3 { get; }
#else
protected T3? _val3 { get; }
#endif

#if NETSTANDARD2_0
protected T4 _val4 { get; }
#else
protected T4? _val4 { get; }
#endif

#if NETSTANDARD2_0
protected T5 _val5 { get; }
#else
protected T5? _val5 { get; }
#endif

#if NETSTANDARD2_0
protected T6 _val6 { get; }
#else
protected T6? _val6 { get; }
#endif

#if NETSTANDARD2_0
protected T7 _val7 { get; }
#else
protected T7? _val7 { get; }
#endif

protected OneOf (T0 value) { _val0 = value; }

Expand Down
Loading