-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(csharp): add performances playground (#2644)
- Loading branch information
1 parent
ec644ff
commit 832e86a
Showing
21 changed files
with
649 additions
and
247 deletions.
There are no files selected for viewing
70 changes: 0 additions & 70 deletions
70
clients/algoliasearch-client-csharp/algoliasearch/Models/AbstractSchema.cs
This file was deleted.
Oops, something went wrong.
75 changes: 20 additions & 55 deletions
75
clients/algoliasearch-client-csharp/algoliasearch/Models/Common/AbstractSchema.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,30 @@ | ||
using System; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
|
||
namespace Algolia.Search.Models.Common; | ||
|
||
/// <summary> | ||
/// Abstract base class for oneOf, anyOf schemas in the API specification | ||
/// </summary> | ||
public abstract class AbstractSchema | ||
namespace Algolia.Search.Models.Common | ||
{ | ||
/// <summary> | ||
/// Custom JSON serializer | ||
/// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification | ||
/// </summary> | ||
public static readonly JsonSerializerSettings SerializerSettings = new() | ||
public abstract partial class AbstractSchema | ||
{ | ||
// OpenAPI generated types generally hide default constructors. | ||
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, | ||
MissingMemberHandling = MissingMemberHandling.Error, | ||
ContractResolver = new DefaultContractResolver | ||
{ | ||
NamingStrategy = new CamelCaseNamingStrategy | ||
{ | ||
OverrideSpecifiedNames = false | ||
} | ||
} | ||
}; | ||
|
||
/// <summary> | ||
/// Custom JSON serializer for objects with additional properties | ||
/// </summary> | ||
public static readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings | ||
{ | ||
// OpenAPI generated types generally hide default constructors. | ||
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, | ||
MissingMemberHandling = MissingMemberHandling.Ignore, | ||
ContractResolver = new DefaultContractResolver | ||
{ | ||
NamingStrategy = new CamelCaseNamingStrategy | ||
{ | ||
OverrideSpecifiedNames = false | ||
} | ||
} | ||
}; | ||
|
||
/// <summary> | ||
/// Gets or Sets the actual instance | ||
/// </summary> | ||
public abstract object ActualInstance { get; set; } | ||
/// <summary> | ||
/// Gets or Sets the actual instance | ||
/// </summary> | ||
public abstract Object ActualInstance { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or Sets IsNullable to indicate whether the instance is nullable | ||
/// </summary> | ||
public bool IsNullable { get; protected set; } | ||
/// <summary> | ||
/// Gets or Sets IsNullable to indicate whether the instance is nullable | ||
/// </summary> | ||
public bool IsNullable { get; protected set; } | ||
|
||
/// <summary> | ||
/// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` | ||
/// </summary> | ||
public string SchemaType { get; protected set; } | ||
/// <summary> | ||
/// Gets or Sets the schema type, which can be either `oneOf` or `anyOf` | ||
/// </summary> | ||
public string SchemaType { get; protected set; } | ||
|
||
/// <summary> | ||
/// Converts the instance into JSON string. | ||
/// </summary> | ||
public abstract string ToJson(); | ||
/// <summary> | ||
/// Converts the instance into JSON string. | ||
/// </summary> | ||
public abstract string ToJson(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
clients/algoliasearch-client-csharp/algoliasearch/Transport/CallType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
|
||
namespace Algolia.Search.Transport; | ||
|
||
/// <summary> | ||
/// https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/enumeration-types | ||
/// Binary enums beware when adding new values | ||
/// </summary> | ||
[Flags] | ||
public enum CallType | ||
{ | ||
/// <summary> | ||
/// Read Call | ||
/// </summary> | ||
Read = 1, | ||
|
||
/// <summary> | ||
/// Write Call | ||
/// </summary> | ||
Write = 2 | ||
} |
16 changes: 16 additions & 0 deletions
16
clients/algoliasearch-client-csharp/algoliasearch/Transport/HttpScheme.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace Algolia.Search.Transport; | ||
|
||
/// <summary> | ||
/// Http Scheme | ||
/// </summary> | ||
public enum HttpScheme | ||
{ | ||
/// <summary> | ||
/// Http | ||
/// </summary> | ||
Http, | ||
/// <summary> | ||
/// Https | ||
/// </summary> | ||
Https | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.