Skip to content
Merged
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
44 changes: 22 additions & 22 deletions contentstack.model.generator/CMA/ContentStackError.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Newtonsoft.Json;
using System;
using System;
using System.Collections.Generic;
using System.Net;
using System.Runtime.Serialization;

using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace contentstack.CMA
{
/// <summary>
Expand All @@ -13,7 +13,7 @@ namespace contentstack.CMA
public class ContentstackException : Exception
{
#region Private Variables
private string _ErrorMessage = string.Empty;
private string _ErrorMessage = string.Empty;

#endregion

Expand All @@ -31,7 +31,7 @@ public class ContentstackException : Exception
/// <summary>
/// This is error message.
/// </summary>
[JsonProperty("error_message")]
[JsonPropertyName("error_message")]
public string ErrorMessage
{
get
Expand All @@ -48,13 +48,13 @@ public string ErrorMessage
/// <summary>
/// This is error code.
/// </summary>
[JsonProperty("error_code")]
[JsonPropertyName("error_code")]
public int ErrorCode { get; set; }

/// <summary>
/// Set of errors in detail.
/// </summary>
[JsonProperty("errors")]
[JsonPropertyName("errors")]
public Dictionary<string, object> Errors { get; set; }

#endregion
Expand Down Expand Up @@ -85,21 +85,21 @@ public ContentstackException(Exception exception)
: base(exception.Message, exception.InnerException)
{
this.ErrorMessage = exception.Message;
}

protected ContentstackException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}

public ContentstackException(string message, Exception innerException) : base(message, innerException)
{
}
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
}
}
protected ContentstackException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
public ContentstackException(string message, Exception innerException) : base(message, innerException)
{
}
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
}
#endregion


}
}
15 changes: 8 additions & 7 deletions contentstack.model.generator/CMA/OAuth/OAuthService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using System.Text.Json.Serialization;

namespace contentstack.CMA.OAuth
{
Expand Down Expand Up @@ -408,25 +409,25 @@ internal static string GetDeveloperHubHostname(string baseHost)

public class OAuthTokenResponse
{
[JsonProperty("access_token")]
[JsonPropertyName("access_token")]
public string AccessToken { get; set; }

[JsonProperty("refresh_token")]
[JsonPropertyName("refresh_token")]
public string RefreshToken { get; set; }
Comment thread
OMpawar-21 marked this conversation as resolved.

[JsonProperty("token_type")]
[JsonPropertyName("token_type")]
public string TokenType { get; set; }

[JsonProperty("expires_in")]
[JsonPropertyName("expires_in")]
public int ExpiresIn { get; set; }

[JsonProperty("scope")]
[JsonPropertyName("scope")]
public string Scope { get; set; }

[JsonProperty("organization_uid")]
[JsonPropertyName("organization_uid")]
public string OrganizationUid { get; set; }

[JsonProperty("user_uid")]
[JsonPropertyName("user_uid")]
public string UserUid { get; set; }

// Computed property for expiration time
Expand Down
4 changes: 2 additions & 2 deletions contentstack.model.generator/Model/Contenttype.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Text.Json.Serialization;

namespace contentstack.model.generator.Model
{
Comment thread
OMpawar-21 marked this conversation as resolved.
Expand All @@ -11,7 +11,7 @@ public class Contenttype

public List<Field> Schema { get; set; }

[JsonProperty(propertyName: "reference_to")]
[JsonPropertyName("reference_to")]
public string ReferenceTo { get; set; }
}
}
12 changes: 6 additions & 6 deletions contentstack.model.generator/Model/Field.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Text.Json.Serialization;

namespace contentstack.model.generator.Model
Comment thread
OMpawar-21 marked this conversation as resolved.
{
public class Field
{
[JsonProperty(PropertyName = "display_name")]
[JsonPropertyName("display_name")]
public string DisplayName { get; set; }

public string Uid { get; set; }

[JsonProperty(PropertyName = "data_type")]
[JsonPropertyName("data_type")]
public string DataType { get; set; }

[JsonProperty(PropertyName = "multiple")]
[JsonPropertyName("multiple")]
public bool IsMultiple { get; set; }

[JsonProperty(PropertyName = "reference_to")]
[JsonPropertyName("reference_to")]
public object ReferenceTo { get; set; }

[JsonProperty(PropertyName = "field_metadata")]
[JsonPropertyName("field_metadata")]
public MetaData FieldMetadata { get; set; }

public List<Contenttype> Blocks { get; set; }
Expand Down
16 changes: 8 additions & 8 deletions contentstack.model.generator/Model/MetaData.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;

namespace contentstack.model.generator.Model
{
public class MetaData
Comment thread
OMpawar-21 marked this conversation as resolved.
{
[JsonProperty(PropertyName = "ref_multiple")]
[JsonPropertyName("ref_multiple")]
public bool RefMultiple { get; set; }

[JsonProperty(PropertyName = "default_value")]
[JsonPropertyName("default_value")]
public object DefaultValue { get; set; }

[JsonProperty(PropertyName = "ref_multiple_content_types")]
[JsonPropertyName("ref_multiple_content_types")]
public bool RefMultipleContentType { get; set; }

[JsonProperty(PropertyName = "allow_rich_text")]
[JsonPropertyName("allow_rich_text")]
public bool IsRichText { get; set; }

[JsonProperty(PropertyName = "markdown")]
[JsonPropertyName("markdown")]
public bool IsMarkdown { get; set; }

[JsonProperty(PropertyName = "extension")]
[JsonPropertyName("extension")]
public bool IsExtension { get; set; }

[JsonProperty(PropertyName = "allow_json_rte")]
[JsonPropertyName("allow_json_rte")]
public bool IsJsonRTE { get; set; }
}
}
20 changes: 10 additions & 10 deletions contentstack.model.generator/Model/OAuth.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using contentstack.model.generator.Model;

namespace Contentstack.Model.Generator.Model
Expand All @@ -11,7 +11,7 @@ namespace Contentstack.Model.Generator.Model
public class OAuthAppAuthorizationResponse
{

[JsonProperty("data")]
[JsonPropertyName("data")]
public OAuthAppAuthorizationData[] Data { get; set; }
}

Expand All @@ -21,19 +21,19 @@ public class OAuthAppAuthorizationResponse
public class OAuthAppAuthorizationData
{

[JsonProperty("authorization_uid")]
[JsonPropertyName("authorization_uid")]
public string AuthorizationUid { get; set; }


[JsonProperty("user")]
[JsonPropertyName("user")]
public OAuthUser User { get; set; }
}


public class OAuthUser
{

[JsonProperty("uid")]
[JsonPropertyName("uid")]
public string Uid { get; set; }
}

Expand Down Expand Up @@ -178,23 +178,23 @@ public override string ToString()
public class OAuthResponse
{

[JsonProperty("access_token")]
[JsonPropertyName("access_token")]
public string AccessToken { get; set; }


[JsonProperty("refresh_token")]
[JsonPropertyName("refresh_token")]
public string RefreshToken { get; set; }


[JsonProperty("expires_in")]
[JsonPropertyName("expires_in")]
public int ExpiresIn { get; set; }


[JsonProperty("organization_uid")]
[JsonPropertyName("organization_uid")]
public string OrganizationUid { get; set; }


[JsonProperty("user_uid")]
[JsonPropertyName("user_uid")]
public string UserUid { get; set; }
}
/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions contentstack.model.generator/Model/StackResponse.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System;
using Newtonsoft.Json;
using System.Text.Json.Serialization;

Comment thread
OMpawar-21 marked this conversation as resolved.
namespace Contentstack.Model.Generator.Model
{
public class StackResponse
{
[JsonProperty(PropertyName = "api_key")]
[JsonPropertyName("api_key")]
public string APIKey { get; set; }
public string Name { get; set; }
[JsonProperty(PropertyName = "master_locale")]
[JsonPropertyName("master_locale")]
public string MasterLocale { get; set; }
public string Uid { get; set; }
public string Description { get; set; }
Expand Down
Loading