C# Client Library
A C# Client Library for the AnalyzeRe REST API
AnalyzeRe.JsonConverters.AnalyzeReJsonConverter Class Reference

A pre-configured RestSharp serializer / deserializer which is made to support parsing of AnalyzeRe API JSON strings, including complex objects such as derived resources, references, URIs and DateTimes. More...

Public Member Functions

 AnalyzeReJsonConverter ()
 Create a new AnalyzeRe JsonConverter More...
 
object Deserialize (string json, Type deserializeType)
 Deserializes the rest response to a run-time type as per this converter's configuration. More...
 
Deserialize< T > (IRestResponse response)
 Deserializes the rest response as per this converter's configuration. More...
 
Deserialize< T > (string json)
 Deserializes the JSON string as per this converter's configuration. More...
 
string Serialize (object obj)
 Serialize the object as JSON More...
 
string Serialize (object obj, bool indented)
 Serialize the object as JSON More...
 

Public Attributes

readonly JsonSerializerSettings DeserializerSettings = DefaultDeserializerSettings.ShallowCopy()
 The Newtonsoft.Json.JsonSerializerSettings settings used for deserializing resources. More...
 
readonly JsonSerializerSettings SerializerSettings = DefaultSerializerSettings.ShallowCopy()
 The Newtonsoft.Json.JsonSerializerSettings settings used for serializing resources. More...
 

Static Public Attributes

static readonly AnalyzeReJsonConverter Default = new AnalyzeReJsonConverter()
 Returns the default AnalyzeReJsonConverter instance. More...
 
static JsonSerializerSettings DefaultDeserializerSettings
 The Newtonsoft.Json.JsonSerializerSettings settings used for deserializing resources. More...
 
static JsonSerializerSettings DefaultSerializerSettings
 The Newtonsoft.Json.JsonSerializerSettings settings used for serializing resources. More...
 

Properties

string ContentType [get, set]
 RestSharp.Deserializers.IDeserializer.ContentType More...
 
CultureInfo Culture [get, set]
 RestSharp.Deserializers.IDeserializer.Culture More...
 
string DateFormat [get, set]
 RestSharp.Deserializers.IDeserializer.DateFormat More...
 
string Namespace [get, set]
 RestSharp.Deserializers.IDeserializer.Namespace More...
 
string RootElement [get, set]
 RestSharp.Deserializers.IDeserializer.RootElement More...
 

Detailed Description

A pre-configured RestSharp serializer / deserializer which is made to support parsing of AnalyzeRe API JSON strings, including complex objects such as derived resources, references, URIs and DateTimes.

Definition at line 17 of file AnalyzeReJsonConverter.cs.

Inheritance diagram for AnalyzeRe.JsonConverters.AnalyzeReJsonConverter:

Constructor & Destructor Documentation

AnalyzeRe.JsonConverters.AnalyzeReJsonConverter.AnalyzeReJsonConverter ( )
inline

Create a new AnalyzeRe JsonConverter

Definition at line 105 of file AnalyzeReJsonConverter.cs.

Member Function Documentation

object AnalyzeRe.JsonConverters.AnalyzeReJsonConverter.Deserialize ( string  json,
Type  deserializeType 
)
inline

Deserializes the rest response to a run-time type as per this converter's configuration.

Parameters
jsonThe string to deserialize.
deserializeTypeThe type to deserialize to.
Returns
A new instance of type T filled in with the deserialized response content.

Definition at line 159 of file AnalyzeReJsonConverter.cs.

T AnalyzeRe.JsonConverters.AnalyzeReJsonConverter.Deserialize< T > ( IRestResponse  response)
inline

Deserializes the rest response as per this converter's configuration.

Template Parameters
TThe type to deserialize to.
Parameters
responseThe response to deserialize.
Returns
A new instance of type T filled in with the deserialized response content.

Definition at line 132 of file AnalyzeReJsonConverter.cs.

Deserializes the JSON string as per this converter's configuration.

Template Parameters
TThe type to deserialize to.
Parameters
jsonThe string to deserialize.
Returns
A new instance of type T filled in with the deserialized JSON string.

Definition at line 145 of file AnalyzeReJsonConverter.cs.

string AnalyzeRe.JsonConverters.AnalyzeReJsonConverter.Serialize ( object  obj)
inline

Serialize the object as JSON

Parameters
objThe object to serialize.
Returns
Serialized JSON of the object.

Definition at line 167 of file AnalyzeReJsonConverter.cs.

string AnalyzeRe.JsonConverters.AnalyzeReJsonConverter.Serialize ( object  obj,
bool  indented 
)
inline

Serialize the object as JSON

Parameters
objThe object to serialize.
indentedChoose whether to use indented formatting or not
Returns
Serialized JSON of the object.

Definition at line 176 of file AnalyzeReJsonConverter.cs.

Member Data Documentation

readonly AnalyzeReJsonConverter AnalyzeRe.JsonConverters.AnalyzeReJsonConverter.Default = new AnalyzeReJsonConverter()
static

Returns the default AnalyzeReJsonConverter instance.

Definition at line 20 of file AnalyzeReJsonConverter.cs.

JsonSerializerSettings AnalyzeRe.JsonConverters.AnalyzeReJsonConverter.DefaultDeserializerSettings
static
Initial value:
=>
_defaultDeserializerSettings ?? (_defaultDeserializerSettings =
new JsonSerializerSettings
{
Culture = CultureInfo.InvariantCulture,
DateFormatHandling = DateFormatHandling.IsoDateFormat,
DateParseHandling = DateParseHandling.None,
DateTimeZoneHandling = DateTimeZoneHandling.Utc,
FloatFormatHandling = FloatFormatHandling.Symbol,
NullValueHandling = NullValueHandling.Ignore,
Converters = new JsonConverter[]
{
new StringEnumConverter(),
new ReferenceConverter(),
new LayerViewCreationConverter(),
new DerivedResourceCreationConverter<IAPIType>(),
new ComplexNestedObjectConverter(),
new UriConverter(),
},
ContractResolver = new RespectIgnoreDataMemberResolver()
})

The Newtonsoft.Json.JsonSerializerSettings settings used for deserializing resources.

Definition at line 27 of file AnalyzeReJsonConverter.cs.

JsonSerializerSettings AnalyzeRe.JsonConverters.AnalyzeReJsonConverter.DefaultSerializerSettings
static
Initial value:
=>
_defaultSerializerSettings ?? (_defaultSerializerSettings =
new JsonSerializerSettings
{
Culture = CultureInfo.InvariantCulture,
DateFormatHandling = DateFormatHandling.IsoDateFormat,
DateTimeZoneHandling = DateTimeZoneHandling.Utc,
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
FloatFormatHandling = FloatFormatHandling.Symbol,
NullValueHandling = NullValueHandling.Ignore,
Converters = new JsonConverter[]
{
new IsoDateTimeConverter {
DateTimeFormat = API.DateTimeFormat,
DateTimeStyles = DateTimeStyles.AdjustToUniversal
},
new StringEnumConverter(),
new ReferenceConverter(),
new PortfolioViewSerializer(),
new UriConverter()
},
ContractResolver = new AnalyzeReSerializationContractResolver()
})

The Newtonsoft.Json.JsonSerializerSettings settings used for serializing resources.

Definition at line 55 of file AnalyzeReJsonConverter.cs.

readonly JsonSerializerSettings AnalyzeRe.JsonConverters.AnalyzeReJsonConverter.DeserializerSettings = DefaultDeserializerSettings.ShallowCopy()

The Newtonsoft.Json.JsonSerializerSettings settings used for deserializing resources.

Definition at line 83 of file AnalyzeReJsonConverter.cs.

readonly JsonSerializerSettings AnalyzeRe.JsonConverters.AnalyzeReJsonConverter.SerializerSettings = DefaultSerializerSettings.ShallowCopy()

The Newtonsoft.Json.JsonSerializerSettings settings used for serializing resources.

Definition at line 88 of file AnalyzeReJsonConverter.cs.

Property Documentation

string AnalyzeRe.JsonConverters.AnalyzeReJsonConverter.ContentType
getset

RestSharp.Deserializers.IDeserializer.ContentType

Definition at line 93 of file AnalyzeReJsonConverter.cs.

CultureInfo AnalyzeRe.JsonConverters.AnalyzeReJsonConverter.Culture
getset

RestSharp.Deserializers.IDeserializer.Culture

Definition at line 95 of file AnalyzeReJsonConverter.cs.

string AnalyzeRe.JsonConverters.AnalyzeReJsonConverter.DateFormat
getset

RestSharp.Deserializers.IDeserializer.DateFormat

Definition at line 97 of file AnalyzeReJsonConverter.cs.

string AnalyzeRe.JsonConverters.AnalyzeReJsonConverter.Namespace
getset

RestSharp.Deserializers.IDeserializer.Namespace

Definition at line 99 of file AnalyzeReJsonConverter.cs.

string AnalyzeRe.JsonConverters.AnalyzeReJsonConverter.RootElement
getset

RestSharp.Deserializers.IDeserializer.RootElement

Definition at line 101 of file AnalyzeReJsonConverter.cs.


The documentation for this class was generated from the following file: