diff --git a/DreamFactory.AddressBook/Controllers/ContactController.cs b/DreamFactory.AddressBook/Controllers/ContactController.cs index de59c7f..4e92045 100644 --- a/DreamFactory.AddressBook/Controllers/ContactController.cs +++ b/DreamFactory.AddressBook/Controllers/ContactController.cs @@ -57,8 +57,21 @@ public async Task List(int? groupId, int offset = 0, int limit = 1 contacts = result.Records.Select(x => x.Contact); - ViewBag.GroupName = result.Records.Select(x => x.ContactGroup.Name).FirstOrDefault(); ViewBag.TotalResults = result.Meta.Count; + if (result.Records.Any()) + { + ViewBag.GroupName = result.Records.Select(x => x.ContactGroup.Name).FirstOrDefault(); + } + else + { + query = new SqlQuery + { + Filter = "id = " + groupId + }; + + DatabaseResourceWrapper contactGroupResult = await databaseApi.GetRecordsAsync("contact_group", query); + ViewBag.GroupName = contactGroupResult.Records.Select(x => x.Name).FirstOrDefault(); + } } else { @@ -106,7 +119,11 @@ public async Task Create(ContactCreateViewModel model) return View(model); } - model.Contact.ImageUrl = await UploadImage(model.ImageUpload) ?? model.Contact.ImageUrl; + string result = await UploadImage(model.ImageUpload); + if (result != null) + { + model.Contact.ImageUrl = DreamFactoryContext.BaseAddress + "/files/" + result; + } IEnumerable records = new List { model.Contact }; records = (await databaseApi.CreateRecordsAsync("contact", records, new SqlQuery())).Records; @@ -170,7 +187,12 @@ public async Task Edit(ContactViewModel model) return View(model); } - model.Contact.ImageUrl = await UploadImage(model.ImageUpload) ?? model.Contact.ImageUrl; + string result = await UploadImage(model.ImageUpload); + if (result != null) + { + model.Contact.ImageUrl = DreamFactoryContext.BaseAddress + "/files/" + result; + } + await databaseApi.UpdateRecordsAsync("contact", new List { model.Contact }, new SqlQuery()); return RedirectToAction("List", Request.QueryString.ToRouteValues(new { GroupId = model.GroupId })); @@ -189,7 +211,7 @@ public async Task Details(int id) string imageData = string.Empty; if (!string.IsNullOrEmpty(contact.ImageUrl)) { - imageData = await filesApi.GetTextFileAsync(contact.ImageUrl); + imageData = await filesApi.GetTextFileAsync(contact.ImageUrl.Split('/').Last()); } ContactViewModel model = new ContactViewModel diff --git a/DreamFactory.AddressBook/Models/Entities/Contact.cs b/DreamFactory.AddressBook/Models/Entities/Contact.cs index f31a23c..68d7f69 100644 --- a/DreamFactory.AddressBook/Models/Entities/Contact.cs +++ b/DreamFactory.AddressBook/Models/Entities/Contact.cs @@ -7,28 +7,35 @@ public class Contact { + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } + [JsonProperty(PropertyName = "first_name")] [Display(Name = "First name")] [Required(ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_Required", ErrorMessage = null)] [MaxLength(40, ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_MaxLength", ErrorMessage = null)] public string FirstName { get; set; } + [JsonProperty(PropertyName = "last_name")] [Display(Name = "Last name")] [Required(ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_Required", ErrorMessage = null)] [MaxLength(40, ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_MaxLength", ErrorMessage = null)] public string LastName { get; set; } + [JsonProperty(PropertyName = "image_url")] public string ImageUrl { get; set; } + [JsonProperty(PropertyName = "twitter")] [Display(Name = "Twitter handle")] [MaxLength(18, ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_MaxLength", ErrorMessage = null)] public string Twitter { get; set; } + [JsonProperty(PropertyName = "skype")] [Display(Name = "Skype name")] [MaxLength(255, ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_MaxLength", ErrorMessage = null)] public string Skype { get; set; } + [JsonProperty(PropertyName = "notes")] [Display(Name = "Notes")] public string Notes { get; set; } diff --git a/DreamFactory.AddressBook/Models/Entities/ContactContactGroup.cs b/DreamFactory.AddressBook/Models/Entities/ContactContactGroup.cs index 92c21dd..e86fa97 100644 --- a/DreamFactory.AddressBook/Models/Entities/ContactContactGroup.cs +++ b/DreamFactory.AddressBook/Models/Entities/ContactContactGroup.cs @@ -4,10 +4,13 @@ public class ContactContactGroup { + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } + [JsonProperty(PropertyName = "contact_id")] public int? ContactId { get; set; } + [JsonProperty(PropertyName = "contact_group_id")] public int? ContactGroupId { get; set; } [JsonProperty(PropertyName = "contact_by_contact_id")] diff --git a/DreamFactory.AddressBook/Models/Entities/ContactGroup.cs b/DreamFactory.AddressBook/Models/Entities/ContactGroup.cs index c41aa39..ca58071 100644 --- a/DreamFactory.AddressBook/Models/Entities/ContactGroup.cs +++ b/DreamFactory.AddressBook/Models/Entities/ContactGroup.cs @@ -7,8 +7,10 @@ public class ContactGroup { + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } + [JsonProperty(PropertyName = "name")] [Display(Name = "Name")] [Required(ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_Required", ErrorMessage = null)] [MaxLength(128, ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_MaxLength", ErrorMessage = null)] diff --git a/DreamFactory.AddressBook/Models/Entities/ContactInfo.cs b/DreamFactory.AddressBook/Models/Entities/ContactInfo.cs index 39eb74a..c5ac1ac 100644 --- a/DreamFactory.AddressBook/Models/Entities/ContactInfo.cs +++ b/DreamFactory.AddressBook/Models/Entities/ContactInfo.cs @@ -6,45 +6,56 @@ public class ContactInfo { + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } + [JsonProperty(PropertyName = "ordinal")] public int? Ordinal { get; set; } + [JsonProperty(PropertyName = "contact_id")] [Required(ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_Required", ErrorMessage = null)] public int? ContactId { get; set; } + [JsonProperty(PropertyName = "info_type")] public string InfoType { get; set; } + [JsonProperty(PropertyName = "phone")] [Display(Name = "Phone")] [Required(ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_Required", ErrorMessage = null)] [MaxLength(32, ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_MaxLength", ErrorMessage = null)] public string Phone { get; set; } + [JsonProperty(PropertyName = "email")] [Display(Name = "Email")] [Required(ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_Required", ErrorMessage = null)] [MaxLength(255, ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_MaxLength", ErrorMessage = null)] public string Email { get; set; } + [JsonProperty(PropertyName = "address")] [Display(Name = "Address")] [Required(ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_Required", ErrorMessage = null)] [MaxLength(255, ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_MaxLength", ErrorMessage = null)] public string Address { get; set; } + [JsonProperty(PropertyName = "city")] [Display(Name = "City")] [Required(ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_Required", ErrorMessage = null)] [MaxLength(64, ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_MaxLength", ErrorMessage = null)] public string City { get; set; } + [JsonProperty(PropertyName = "state")] [Display(Name = "State")] [Required(ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_Required", ErrorMessage = null)] [MaxLength(64, ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_MaxLength", ErrorMessage = null)] public string State { get; set; } + [JsonProperty(PropertyName = "zip")] [Display(Name = "Zip")] [Required(ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_Required", ErrorMessage = null)] [MaxLength(16, ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_MaxLength", ErrorMessage = null)] public string Zip { get; set; } + [JsonProperty(PropertyName = "country")] [Display(Name = "Country")] [Required(ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_Required", ErrorMessage = null)] [MaxLength(64, ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessage_MaxLength", ErrorMessage = null)] diff --git a/DreamFactory.Demo/Demo/DatabaseDemo.cs b/DreamFactory.Demo/Demo/DatabaseDemo.cs index 7075053..a72f163 100644 --- a/DreamFactory.Demo/Demo/DatabaseDemo.cs +++ b/DreamFactory.Demo/Demo/DatabaseDemo.cs @@ -57,7 +57,7 @@ public async Task RunAsync(IRestContext context) firstRecord.FirstName = "Andrei 2"; await databaseApi.UpdateRecordsAsync(TableName, records, new SqlQuery()); - SqlQuery query = new SqlQuery { Filter = "age > 30", Order = "age", Fields = "*" }; + SqlQuery query = new SqlQuery { Filter = "Age > 30", Order = "Age", Fields = "*" }; IEnumerable selection = (await databaseApi.GetRecordsAsync(TableName, query)).Records; string ages = selection.Select(x => x.Age.ToString(CultureInfo.InvariantCulture)).ToStringList(); Console.WriteLine("Get records with SqlQuery: ages={0}", ages); @@ -85,7 +85,7 @@ private static IEnumerable CreateStaffRecords() private static TableSchema CreateTestTableSchema() { ITableSchemaBuilder builder = new TableSchemaBuilder(); - return builder.WithName(TableName).WithFieldsFrom().WithKeyField("uid").Build(); + return builder.WithName(TableName).WithFieldsFrom().WithKeyField("Uid").Build(); } internal class StaffRecord diff --git a/DreamFactory.Tests/Api/DatabaseApiTests.cs b/DreamFactory.Tests/Api/DatabaseApiTests.cs index 8a8f3f8..8113095 100644 --- a/DreamFactory.Tests/Api/DatabaseApiTests.cs +++ b/DreamFactory.Tests/Api/DatabaseApiTests.cs @@ -12,6 +12,7 @@ using DreamFactory.Rest; using DreamFactory.Serialization; using Microsoft.VisualStudio.TestTools.UnitTesting; + using Newtonsoft.Json; using Shouldly; [TestClass] @@ -331,7 +332,7 @@ private static IDatabaseApi CreateDatabaseApi(string alt = null) private static TableSchema CreateTestTableSchema() { ITableSchemaBuilder builder = new TableSchemaBuilder(); - return builder.WithName("staff").WithFieldsFrom().WithKeyField("uid").Build(); + return builder.WithName("staff").WithFieldsFrom().WithKeyField("Uid").Build(); } private static IEnumerable CreateStaffRecords() @@ -343,17 +344,25 @@ private static IEnumerable CreateStaffRecords() internal class StaffRecord { + [JsonProperty(PropertyName = "uid")] public int Uid { get; set; } + [JsonProperty(PropertyName = "first_name")] public string FirstName { get; set; } + [JsonProperty(PropertyName = "last_name")] public string LastName { get; set; } + [JsonProperty(PropertyName = "age")] public int Age { get; set; } + [JsonProperty(PropertyName = "active")] public bool Active { get; set; } } internal class ProcResponse { + [JsonProperty(PropertyName = "dataset")] public List Dataset { get; set; } + [JsonProperty(PropertyName = "foo")] public int Foo { get; set; } + [JsonProperty(PropertyName = "bar")] public string Bar { get; set; } } } diff --git a/DreamFactory.Tests/DreamFactory.Tests.csproj b/DreamFactory.Tests/DreamFactory.Tests.csproj index b81000d..27f234f 100644 --- a/DreamFactory.Tests/DreamFactory.Tests.csproj +++ b/DreamFactory.Tests/DreamFactory.Tests.csproj @@ -92,7 +92,6 @@ - diff --git a/DreamFactory.Tests/Model/TableSchemaBuilderTests.cs b/DreamFactory.Tests/Model/TableSchemaBuilderTests.cs index e0e4b57..e7c98ea 100644 --- a/DreamFactory.Tests/Model/TableSchemaBuilderTests.cs +++ b/DreamFactory.Tests/Model/TableSchemaBuilderTests.cs @@ -66,10 +66,10 @@ public void ShouldBuildWithFieldsFromRecord() // Assert schema.Field.Count.ShouldBe(4); - schema.Field.Single(x => x.Name == "id").Type.ShouldBe("id"); - schema.Field.Single(x => x.Name == "name").Type.ShouldBe("string"); - schema.Field.Single(x => x.Name == "age").Type.ShouldBe("integer"); - schema.Field.Single(x => x.Name == "active").Type.ShouldBe("boolean"); + schema.Field.Single(x => x.Name == "Id").Type.ShouldBe("id"); + schema.Field.Single(x => x.Name == "Name").Type.ShouldBe("string"); + schema.Field.Single(x => x.Name == "Age").Type.ShouldBe("integer"); + schema.Field.Single(x => x.Name == "Active").Type.ShouldBe("boolean"); } private class Record diff --git a/DreamFactory.Tests/Rest/RestContextTests.cs b/DreamFactory.Tests/Rest/RestContextTests.cs index 895ad96..ba2c946 100644 --- a/DreamFactory.Tests/Rest/RestContextTests.cs +++ b/DreamFactory.Tests/Rest/RestContextTests.cs @@ -171,7 +171,7 @@ public void ShouldThrowIfAnyArgumentsAreNull() private static IRestContext CreateRestContext() { IHttpFacade httpFacade = new TestDataHttpFacade(); - IRestContext context = new RestContext("http://base_address", "app_name", "app_api_key", null, httpFacade, new JsonContentSerializer()); + IRestContext context = new RestContext("http://base_address", "app_name", "app_api_key", null, httpFacade, new JsonContentSerializer(), RestApiVersion.V1); return context; } } diff --git a/DreamFactory.Tests/Serialization/SnakeCasePropertyNameResolverTests.cs b/DreamFactory.Tests/Serialization/SnakeCasePropertyNameResolverTests.cs deleted file mode 100644 index 3fcf9ff..0000000 --- a/DreamFactory.Tests/Serialization/SnakeCasePropertyNameResolverTests.cs +++ /dev/null @@ -1,52 +0,0 @@ -namespace DreamFactory.Tests.Serialization -{ - using DreamFactory.Serialization; - using Microsoft.VisualStudio.TestTools.UnitTesting; - using Shouldly; - - [TestClass] - public class SnakeCasePropertyNameResolverTests - { - [TestMethod] - public void ShouldResolveSingleWordPropertyName() - { - // Arrange - var resolver = new SnakeCasePropertyNameResolver(); - var propertyName = "Uid"; - - // Act - string resolved = resolver.Resolve(propertyName); - - // Assert - resolved.ShouldBe("uid"); - } - - [TestMethod] - public void ShouldResolveMultipleWordPropertyName() - { - // Arrange - var resolver = new SnakeCasePropertyNameResolver(); - var propertyName = "FirstName"; - - // Act - string resolved = resolver.Resolve(propertyName); - - // Assert - resolved.ShouldBe("first_name"); - } - - [TestMethod] - public void ShouldNotChangeAlreadySnakeCasePropertyName() - { - // Arrange - var resolver = new SnakeCasePropertyNameResolver(); - var propertyName = "first_name"; - - // Act - string resolved = resolver.Resolve(propertyName); - - // Assert - resolved.ShouldBe("first_name"); - } - } -} \ No newline at end of file diff --git a/DreamFactory.Tests/TestData/rest/db/_schema/post.request.json b/DreamFactory.Tests/TestData/rest/db/_schema/post.request.json index 2808ac4..e508a92 100644 --- a/DreamFactory.Tests/TestData/rest/db/_schema/post.request.json +++ b/DreamFactory.Tests/TestData/rest/db/_schema/post.request.json @@ -1 +1 @@ -{"resource":[{"name":"staff","field":[{"name":"uid","type":"integer","required":false},{"name":"first_name","type":"string","required":false},{"name":"last_name","type":"string","required":false},{"name":"age","type":"integer","required":false},{"name":"active","type":"boolean","required":false},{"name":"uid","type":"id","required":true,"auto_increment":true,"is_primary_key":true}]}]} \ No newline at end of file +{"resource":[{"name":"staff","field":[{"name":"Uid","type":"id","required":true,"auto_increment":true,"is_primary_key":true},{"name":"FirstName","type":"string","required":false},{"name":"LastName","type":"string","required":false},{"name":"Age","type":"integer","required":false},{"name":"Active","type":"boolean","required":false}]}]} \ No newline at end of file diff --git a/DreamFactory.Tests/TestData/rest/db/_schema/put.request.json b/DreamFactory.Tests/TestData/rest/db/_schema/put.request.json index 2808ac4..e508a92 100644 --- a/DreamFactory.Tests/TestData/rest/db/_schema/put.request.json +++ b/DreamFactory.Tests/TestData/rest/db/_schema/put.request.json @@ -1 +1 @@ -{"resource":[{"name":"staff","field":[{"name":"uid","type":"integer","required":false},{"name":"first_name","type":"string","required":false},{"name":"last_name","type":"string","required":false},{"name":"age","type":"integer","required":false},{"name":"active","type":"boolean","required":false},{"name":"uid","type":"id","required":true,"auto_increment":true,"is_primary_key":true}]}]} \ No newline at end of file +{"resource":[{"name":"staff","field":[{"name":"Uid","type":"id","required":true,"auto_increment":true,"is_primary_key":true},{"name":"FirstName","type":"string","required":false},{"name":"LastName","type":"string","required":false},{"name":"Age","type":"integer","required":false},{"name":"Active","type":"boolean","required":false}]}]} \ No newline at end of file diff --git a/DreamFactory/Api/BaseApi.cs b/DreamFactory/Api/BaseApi.cs index 22c83b3..65b3a14 100644 --- a/DreamFactory/Api/BaseApi.cs +++ b/DreamFactory/Api/BaseApi.cs @@ -387,19 +387,6 @@ internal IHttpAddress BuildAddress(string[] resourceParts, SqlQuery query) return address; } - /// - /// Executes given IHttpRequest and returns response body. - /// - /// Request to be executed. - /// Response body. - /// Thrown when there was an error executing request. - internal async Task ExecuteRequest(IHttpRequest request) - { - IHttpResponse response = await HttpFacade.RequestAsync(request); - HttpUtils.ThrowOnBadStatus(response, ContentSerializer); - return response.Body; - } - /// /// Executes given IHttpRequest and returns deserialized response body. /// @@ -413,5 +400,18 @@ internal async Task ExecuteRequest(IHttpRequest request) string body = await ExecuteRequest(request); return ContentSerializer.Deserialize(body); } + + /// + /// Executes given IHttpRequest and returns response body. + /// + /// Request to be executed. + /// Response body. + /// Thrown when there was an error executing request. + internal async Task ExecuteRequest(IHttpRequest request) + { + IHttpResponse response = await HttpFacade.RequestAsync(request); + HttpUtils.ThrowOnBadStatus(response, ContentSerializer); + return response.Body; + } } } diff --git a/DreamFactory/DreamFactory.csproj b/DreamFactory/DreamFactory.csproj index 64af854..2d3431d 100644 --- a/DreamFactory/DreamFactory.csproj +++ b/DreamFactory/DreamFactory.csproj @@ -180,10 +180,7 @@ - - - diff --git a/DreamFactory/Http/HttpUtils.cs b/DreamFactory/Http/HttpUtils.cs index 6fa8062..5160a6e 100644 --- a/DreamFactory/Http/HttpUtils.cs +++ b/DreamFactory/Http/HttpUtils.cs @@ -126,11 +126,11 @@ private static string TryGetErrorMessage(IHttpResponse response, IContentSeriali try { string message = @default; - var error = new { error = new List() }; - error = serializer.Deserialize(response.Body, error); - if (error != null && error.error != null) + var body = new { error = new Error() }; + body = serializer.Deserialize(response.Body, body); + if (body != null && body.error != null) { - message = error.error.First().Message; + message = body.error.Message; } return string.Format("{0} - {1}", response.Code, message); diff --git a/DreamFactory/Model/Builder/TableSchemaBuilder.cs b/DreamFactory/Model/Builder/TableSchemaBuilder.cs index bf8a9b4..8410f24 100644 --- a/DreamFactory/Model/Builder/TableSchemaBuilder.cs +++ b/DreamFactory/Model/Builder/TableSchemaBuilder.cs @@ -4,6 +4,7 @@ using DreamFactory.Serialization; using global::System; using global::System.Collections.Generic; + using global::System.Linq; using global::System.Reflection; /// @@ -14,7 +15,6 @@ public class TableSchemaBuilder : ITableSchemaBuilder private readonly List fields; private string tableName; - private readonly IPropertyNameResolver propertyNameResolver; /// /// Initializes a new instance of the class. @@ -22,17 +22,6 @@ public class TableSchemaBuilder : ITableSchemaBuilder public TableSchemaBuilder() { fields = new List(); - propertyNameResolver = new SnakeCasePropertyNameResolver(); - } - - /// - /// Initializes a new instance of the class. - /// Resolver to be used when serializing property names. - /// - public TableSchemaBuilder(IPropertyNameResolver propertyNameResolver) - { - fields = new List(); - this.propertyNameResolver = propertyNameResolver; } /// @@ -62,16 +51,27 @@ public ITableSchemaBuilder WithName(string name) /// public ITableSchemaBuilder WithKeyField(string fieldName) { - FieldSchema field = new FieldSchema + FieldSchema field = fields.FirstOrDefault(x => x.Name == fieldName); + if (field == null) { - Name = fieldName, - Required = true, - Type = "id", - IsPrimaryKey = true, - AutoIncrement = true - }; + field = new FieldSchema + { + Name = fieldName, + Required = true, + Type = "id", + IsPrimaryKey = true, + AutoIncrement = true + }; + fields.Add(field); + } + else + { + field.Required = true; + field.Type = "id"; + field.IsPrimaryKey = true; + field.AutoIncrement = true; + } - fields.Add(field); return this; } @@ -81,14 +81,14 @@ public ITableSchemaBuilder WithKeyField(string fieldName) IEnumerable properties = (typeof(TRecord)).GetTypeInfo().DeclaredProperties; foreach (PropertyInfo propertyInfo in properties) { - if (string.Compare(propertyNameResolver.Resolve(propertyInfo.Name), "id", StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(propertyInfo.Name, "id", StringComparison.OrdinalIgnoreCase) == 0) { if (!propertyInfo.PropertyType.GetTypeInfo().IsValueType) { throw new NotSupportedException("Field 'id' must be of a value type"); } - WithKeyField(propertyNameResolver.Resolve(propertyInfo.Name)); + WithKeyField(propertyInfo.Name); continue; } @@ -96,7 +96,7 @@ public ITableSchemaBuilder WithKeyField(string fieldName) FieldSchema field = new FieldSchema { - Name = propertyNameResolver.Resolve(propertyInfo.Name), + Name = propertyInfo.Name, Required = false, Type = typeName }; diff --git a/DreamFactory/Model/Database/DatabaseResourceWrapper.cs b/DreamFactory/Model/Database/DatabaseResourceWrapper.cs index 077e166..8a65f4f 100644 --- a/DreamFactory/Model/Database/DatabaseResourceWrapper.cs +++ b/DreamFactory/Model/Database/DatabaseResourceWrapper.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.Database { + using Newtonsoft.Json; + /// /// Wrapper for database response resources. /// @@ -10,6 +12,7 @@ public class DatabaseResourceWrapper : ResourceWrapper /// Metadata for requested resources. /// /// Property is populated only if request query contained IncludeSchema or IncludeCount parameter. + [JsonProperty(PropertyName = "meta")] public QueryMetadata Meta { get; set; } } } diff --git a/DreamFactory/Model/Database/FieldSchema.cs b/DreamFactory/Model/Database/FieldSchema.cs index 317bc08..75be6ca 100644 --- a/DreamFactory/Model/Database/FieldSchema.cs +++ b/DreamFactory/Model/Database/FieldSchema.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.Database { using global::System.Collections.Generic; + using Newtonsoft.Json; /// /// Field schema. @@ -10,96 +11,127 @@ public class FieldSchema /// /// The API name of the field. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// The displayable label for the field. /// + [JsonProperty(PropertyName = "label")] public string Label { get; set; } /// /// The DSP abstract data type for this field. /// + [JsonProperty(PropertyName = "type")] public string Type { get; set; } /// /// The native database type used for this field. /// + [JsonProperty(PropertyName = "db_type")] public string DbType { get; set; } /// /// The maximum length allowed (in characters for string, displayed for numbers). /// + [JsonProperty(PropertyName = "length")] public int? Length { get; set; } /// /// Total number of places for numbers. /// + [JsonProperty(PropertyName = "precision")] public int? Precision { get; set; } /// /// Number of decimal places allowed for numbers. /// + [JsonProperty(PropertyName = "scale")] public int? Scale { get; set; } /// /// Default value for this field. /// + [JsonProperty(PropertyName = "default_value")] public string DefaultValue { get; set; } /// /// Is a value required for record creation. /// + [JsonProperty(PropertyName = "required")] public bool? Required { get; set; } /// /// Is null allowed as a value. /// + [JsonProperty(PropertyName = "allow_null")] public bool? AllowNull { get; set; } /// /// Is the length fixed (not variable). /// + [JsonProperty(PropertyName = "fixed_length")] public bool? FixedLength { get; set; } /// /// Does the data type support multibyte characters. /// + [JsonProperty(PropertyName = "supports_multibyte")] public bool? SupportsMultibyte { get; set; } /// /// Does the integer field value increment upon new record creation. /// + [JsonProperty(PropertyName = "auto_increment")] public bool? AutoIncrement { get; set; } /// /// Is this field used as/part of the primary key. /// + [JsonProperty(PropertyName = "is_primary_key")] public bool? IsPrimaryKey { get; set; } /// /// Is this field used as a foreign key. /// + [JsonProperty(PropertyName = "is_foreign_key")] public bool? IsForeignKey { get; set; } + /// + /// Is this field unique. + /// + [JsonProperty(PropertyName = "is_unique")] + public bool? IsUnique { get; set; } + + /// + /// Is this field used as an index. + /// + [JsonProperty(PropertyName = "is_index")] + public bool? IsIndex { get; set; } + /// /// For foreign keys, the referenced table name. /// + [JsonProperty(PropertyName = "ref_table")] public string RefTable { get; set; } /// /// For foreign keys, the referenced table field name. /// + [JsonProperty(PropertyName = "ref_fields")] public string RefFields { get; set; } /// /// Validations to be performed on this field. /// - public List Validation { get; set; } + [JsonProperty(PropertyName = "validation")] + public object Validation { get; set; } /// /// Selectable string values for client menus and picklist validation. /// + [JsonProperty(PropertyName = "value")] public List Value { get; set; } } } diff --git a/DreamFactory/Model/Database/Metadata.cs b/DreamFactory/Model/Database/Metadata.cs index 5a61018..6259d47 100644 --- a/DreamFactory/Model/Database/Metadata.cs +++ b/DreamFactory/Model/Database/Metadata.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.Database { + using Newtonsoft.Json; + /// /// Query metadata class. /// @@ -8,11 +10,13 @@ public class QueryMetadata /// /// Queried table schema. /// + [JsonProperty(PropertyName = "schema")] public TableSchema Schema { get; set; } /// /// Records total count. /// + [JsonProperty(PropertyName = "count")] public int? Count { get; set; } } } diff --git a/DreamFactory/Model/Database/RelatedSchema.cs b/DreamFactory/Model/Database/RelatedSchema.cs index 4bfa6c6..2931eae 100644 --- a/DreamFactory/Model/Database/RelatedSchema.cs +++ b/DreamFactory/Model/Database/RelatedSchema.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.Database { + using Newtonsoft.Json; + /// /// Related schema. /// @@ -8,31 +10,37 @@ public class RelatedSchema /// /// Name of the relationship. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Relationship type - belongs_to, has_many, many_many. /// + [JsonProperty(PropertyName = "type")] public string Type { get; set; } /// /// The table name that is referenced by the relationship. /// + [JsonProperty(PropertyName = "ref_table")] public string RefTable { get; set; } /// /// The field name that is referenced by the relationship. /// + [JsonProperty(PropertyName = "ref_field")] public string RefField { get; set; } /// /// The intermediate joining table used for many_many relationships. /// + [JsonProperty(PropertyName = "join")] public string Join { get; set; } /// /// The current table field that is used in the relationship. /// + [JsonProperty(PropertyName = "field")] public string Field { get; set; } } } diff --git a/DreamFactory/Model/Database/SqlQuery.cs b/DreamFactory/Model/Database/SqlQuery.cs index 28988c8..ba138ee 100644 --- a/DreamFactory/Model/Database/SqlQuery.cs +++ b/DreamFactory/Model/Database/SqlQuery.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.Database { using global::System.Collections.Generic; + using Newtonsoft.Json; /// /// SQL query parameters. @@ -22,52 +23,62 @@ public SqlQuery() /// /// Comma-delimited list of the identifiers of the records to retrieve. /// + [JsonProperty(PropertyName = "ids")] public string Ids { get; set; } /// /// SQL WHERE clause filter to limit the records retrieved. /// + [JsonProperty(PropertyName = "filter")] public string Filter { get; set; } /// /// Maximum number of records to return. /// + [JsonProperty(PropertyName = "limit")] public int? Limit { get; set; } /// /// Offset the filter results to a particular record index (may require order> parameter in some scenarios). /// + [JsonProperty(PropertyName = "offset")] public int? Offset { get; set; } /// /// SQL ORDER_BY clause containing field and direction for filter results. /// + [JsonProperty(PropertyName = "order")] public string Order { get; set; } /// /// Comma-delimited list of field names to retrieve for each record, '*' to return all fields. /// + [JsonProperty(PropertyName = "fields")] public string Fields { get; set; } /// /// Comma-delimited list of relationship names to retrieve for each record, or '*' to retrieve all. /// + [JsonProperty(PropertyName = "related")] public string Related { get; set; } /// /// Include the total number of filter results in returned metadata. /// + [JsonProperty(PropertyName = "include_count")] public bool? IncludeCount { get; set; } /// /// Include the schema of the table queried in returned metadata. /// + [JsonProperty(PropertyName = "include_schema")] public bool? IncludeSchema { get; set; } /// /// Collection of key/value pairs representing custom parameters that will be added to query string. /// /// Adding parameters in this collection does not override any other parameters that were added in query string with the same key. + [JsonProperty(PropertyName = "custom_parameters")] public Dictionary CustomParameters { get; set; } } } \ No newline at end of file diff --git a/DreamFactory/Model/Database/StoredProcParam.cs b/DreamFactory/Model/Database/StoredProcParam.cs index dfe3f30..88aa7b4 100644 --- a/DreamFactory/Model/Database/StoredProcParam.cs +++ b/DreamFactory/Model/Database/StoredProcParam.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.Database { + using Newtonsoft.Json; + /// /// Stored procedure parameter descriptor. /// @@ -8,26 +10,31 @@ public class StoredProcParam /// /// Name of the parameter, required for OUT and INOUT types, must be the same as the stored procedure's parameter name. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Parameter type of IN, OUT, or INOUT, defaults to IN. /// + [JsonProperty(PropertyName = "param_type")] public string ParamType { get; set; } /// /// Value of the parameter, used for the IN and INOUT types, defaults to NULL. /// + [JsonProperty(PropertyName = "value")] public string Value { get; set; } /// /// For INOUT and OUT parameters, the requested type for the returned value, i.e. integer, boolean, string, etc. Defaults to value type for INOUT and string for OUT. /// + [JsonProperty(PropertyName = "type")] public string Type { get; set; } /// /// For INOUT and OUT parameters, the requested length for the returned value. May be required by some database drivers. /// + [JsonProperty(PropertyName = "length")] public int? Length { get; set; } } } \ No newline at end of file diff --git a/DreamFactory/Model/Database/StoredProcRequest.cs b/DreamFactory/Model/Database/StoredProcRequest.cs index 611a338..a29518a 100644 --- a/DreamFactory/Model/Database/StoredProcRequest.cs +++ b/DreamFactory/Model/Database/StoredProcRequest.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.Database { using global::System.Collections.Generic; + using Newtonsoft.Json; /// /// Stored procedure request. @@ -10,11 +11,13 @@ public class StoredProcRequest /// /// Optional array of input and output parameters. /// + [JsonProperty(PropertyName = "params")] public List Params { get; set; } /// /// Add this wrapper around the expected data set before returning, same as URL parameter. /// + [JsonProperty(PropertyName = "wrapper")] public string Wrapper { get; set; } } } diff --git a/DreamFactory/Model/Database/TableInfo.cs b/DreamFactory/Model/Database/TableInfo.cs index d0caa67..d7d29b7 100644 --- a/DreamFactory/Model/Database/TableInfo.cs +++ b/DreamFactory/Model/Database/TableInfo.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.Database { using global::System.Collections.Generic; + using Newtonsoft.Json; /// /// A table information. @@ -10,21 +11,25 @@ public class TableInfo /// /// Identifier/Name for the table. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Displayable singular name for the table. /// + [JsonProperty(PropertyName = "label")] public string Label { get; set; } /// /// Displayable plural name for the table. /// + [JsonProperty(PropertyName = "plural")] public string Plural { get; set; } /// /// List of allowed HTTP verbs. /// - public List Access { get; set; } + [JsonProperty(PropertyName = "access")] + public List Access { get; set; } } } diff --git a/DreamFactory/Model/Database/TableSchema.cs b/DreamFactory/Model/Database/TableSchema.cs index 33c2df7..40f962c 100644 --- a/DreamFactory/Model/Database/TableSchema.cs +++ b/DreamFactory/Model/Database/TableSchema.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.Database { using global::System.Collections.Generic; + using Newtonsoft.Json; /// /// Table schema. @@ -10,36 +11,43 @@ public class TableSchema /// /// Identifier/Name for the table. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Displayable singular name for the table. /// + [JsonProperty(PropertyName = "label")] public string Label { get; set; } /// /// Displayable plural name for the table. /// + [JsonProperty(PropertyName = "plural")] public string Plural { get; set; } /// /// Field(s), if any, that represent the primary key of each record. /// + [JsonProperty(PropertyName = "primary_key")] public string PrimaryKey { get; set; } /// /// Field(s), if any, that represent the name of each record. /// + [JsonProperty(PropertyName = "name_field")] public string NameField { get; set; } /// /// An array of available fields in each record. /// + [JsonProperty(PropertyName = "field")] public List Field { get; set; } /// /// An array of available relationships to other tables. /// + [JsonProperty(PropertyName = "related")] public List Related { get; set; } } } \ No newline at end of file diff --git a/DreamFactory/Model/Email/EmailAddress.cs b/DreamFactory/Model/Email/EmailAddress.cs index 86a0b02..4471cde 100644 --- a/DreamFactory/Model/Email/EmailAddress.cs +++ b/DreamFactory/Model/Email/EmailAddress.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.Email { + using Newtonsoft.Json; + /// /// Email address. /// @@ -8,11 +10,13 @@ public class EmailAddress /// /// Optional name displayed along with the email address. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Required email address. /// + [JsonProperty(PropertyName = "email")] public string Email { get; set; } } } diff --git a/DreamFactory/Model/Email/EmailRequest.cs b/DreamFactory/Model/Email/EmailRequest.cs index f2a2418..cd340af 100644 --- a/DreamFactory/Model/Email/EmailRequest.cs +++ b/DreamFactory/Model/Email/EmailRequest.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.Email { using global::System.Collections.Generic; + using Newtonsoft.Json; /// /// Email request. @@ -10,61 +11,73 @@ public class EmailRequest /// /// Template name to base email on. /// + [JsonProperty(PropertyName = "template")] public string Template { get; set; } /// /// Email Template id to base email on. /// + [JsonProperty(PropertyName = "template_id")] public int? TemplateId { get; set; } /// /// Required single or multiple receiver addresses. /// + [JsonProperty(PropertyName = "to")] public List To { get; set; } /// /// Optional CC receiver addresses. /// + [JsonProperty(PropertyName = "cc")] public List Cc { get; set; } /// /// Optional BCC receiver addresses. /// + [JsonProperty(PropertyName = "bcc")] public List Bcc { get; set; } /// /// Text only subject line. /// + [JsonProperty(PropertyName = "subject")] public string Subject { get; set; } /// /// Text only version of the body. /// + [JsonProperty(PropertyName = "body_text")] public string BodyText { get; set; } /// /// Escaped HTML version of the body. /// + [JsonProperty(PropertyName = "body_html")] public string BodyHtml { get; set; } /// /// Required sender name. /// + [JsonProperty(PropertyName = "from_name")] public string FromName { get; set; } /// /// Required sender email. /// + [JsonProperty(PropertyName = "from_email")] public string FromEmail { get; set; } /// /// Optional reply to name. /// + [JsonProperty(PropertyName = "reply_to_name")] public string ReplyToName { get; set; } /// /// Optional reply to email. /// + [JsonProperty(PropertyName = "reply_to_email")] public string ReplyToEmail { get; set; } } } diff --git a/DreamFactory/Model/Email/EmailResponse.cs b/DreamFactory/Model/Email/EmailResponse.cs index 25264ef..efab8a7 100644 --- a/DreamFactory/Model/Email/EmailResponse.cs +++ b/DreamFactory/Model/Email/EmailResponse.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.Email { + using Newtonsoft.Json; + /// /// Email response. /// @@ -8,6 +10,7 @@ public class EmailResponse /// /// Number of emails successfully sent. /// + [JsonProperty(PropertyName = "count")] public int? Count { get; set; } } } diff --git a/DreamFactory/Model/Error.cs b/DreamFactory/Model/Error.cs index 06b4869..ef9d2c5 100644 --- a/DreamFactory/Model/Error.cs +++ b/DreamFactory/Model/Error.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model { + using Newtonsoft.Json; + /// /// Error data. /// @@ -8,11 +10,13 @@ public class Error /// /// Gets error message. /// + [JsonProperty(PropertyName = "message")] public string Message { get; set; } /// /// Gets HTTP status code. /// + [JsonProperty(PropertyName = "code")] public int Code { get; set; } } } diff --git a/DreamFactory/Model/File/FileRequest.cs b/DreamFactory/Model/File/FileRequest.cs index a6d900c..6bbcd2e 100644 --- a/DreamFactory/Model/File/FileRequest.cs +++ b/DreamFactory/Model/File/FileRequest.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.File { + using Newtonsoft.Json; + /// /// FileRequest. /// @@ -8,16 +10,19 @@ public class FileRequest /// /// Gets Identifier/Name for the file, localized to requested resource. /// + [JsonProperty(PropertyName = @"name")] public string Name { get; set; } /// /// Full path of the file, from the service including container. /// + [JsonProperty(PropertyName = "path")] public string Path { get; set; } /// /// The media type of the content of the file. /// + [JsonProperty(PropertyName = "content_type")] public string ContentType { get; set; } } } diff --git a/DreamFactory/Model/File/FileResponse.cs b/DreamFactory/Model/File/FileResponse.cs index 02d974d..4c6d5d3 100644 --- a/DreamFactory/Model/File/FileResponse.cs +++ b/DreamFactory/Model/File/FileResponse.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.File { using global::System; + using Newtonsoft.Json; /// /// FileResponse. @@ -10,26 +11,31 @@ public class FileResponse /// /// Gets Identifier/Name for the file, localized to requested resource. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Full path of the file, from the service including container. /// + [JsonProperty(PropertyName = "path")] public string Path { get; set; } /// /// The media type of the content of the file. /// + [JsonProperty(PropertyName = "content_type")] public string ContentType { get; set; } /// /// Size of the file in bytes. /// + [JsonProperty(PropertyName = "content_length")] public string ContentLength { get; set; } /// /// A GMT date timestamp of when the file was last modified. /// + [JsonProperty(PropertyName = "last_modified")] public DateTime? LastModified { get; set; } } } diff --git a/DreamFactory/Model/File/FolderRequest.cs b/DreamFactory/Model/File/FolderRequest.cs index b481928..812b05e 100644 --- a/DreamFactory/Model/File/FolderRequest.cs +++ b/DreamFactory/Model/File/FolderRequest.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.File { using global::System.Collections.Generic; + using Newtonsoft.Json; /// /// FolderRequest. @@ -10,21 +11,25 @@ public class FolderRequest /// /// Gets Identifier/Name for the folder, localized to requested resource. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Full path of the folder, from the service including container. /// + [JsonProperty(PropertyName = "path")] public string Path { get; set; } /// /// An array of sub-folders to create. /// + [JsonProperty(PropertyName = "folder")] public List Folder { get; set; } /// /// An array of files to create. /// + [JsonProperty(PropertyName = "file")] public List File { get; set; } } } diff --git a/DreamFactory/Model/File/FolderResponse.cs b/DreamFactory/Model/File/FolderResponse.cs index c164377..e0fe292 100644 --- a/DreamFactory/Model/File/FolderResponse.cs +++ b/DreamFactory/Model/File/FolderResponse.cs @@ -2,6 +2,7 @@ { using global::System; using global::System.Collections.Generic; + using Newtonsoft.Json; /// /// FolderResponse. @@ -11,26 +12,31 @@ public class FolderResponse /// /// Gets Identifier/Name for the folder, localized to requested resource. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Full path of the folder, from the service including container. /// + [JsonProperty(PropertyName = "path")] public string Path { get; set; } /// /// A GMT date timestamp of when the folder was last modified. /// + [JsonProperty(PropertyName = "last_modified")] public DateTime? LastModified { get; set; } /// /// An array of contained sub-folders. /// + [JsonProperty(PropertyName = "folder")] public List Folder { get; set; } /// /// An array of contained files. /// + [JsonProperty(PropertyName = "file")] public List File { get; set; } } } diff --git a/DreamFactory/Model/File/StorageResource.cs b/DreamFactory/Model/File/StorageResource.cs index 2fb0357..1641d19 100644 --- a/DreamFactory/Model/File/StorageResource.cs +++ b/DreamFactory/Model/File/StorageResource.cs @@ -2,6 +2,7 @@ { using global::System; using global::System.Collections.Generic; + using Newtonsoft.Json; /// /// A storage resource information. @@ -11,31 +12,37 @@ public class StorageResource /// /// Identifier/Name for the resource. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Path for the resource. /// + [JsonProperty(PropertyName = "path")] public string Path { get; set; } /// /// Date and time of last modification. /// + [JsonProperty(PropertyName = "last_modified")] public DateTime? LastModified { get; set; } /// /// Resource content length. /// + [JsonProperty(PropertyName = "content_length")] public int ContentLength { get; set; } /// /// Resource type. /// + [JsonProperty(PropertyName = "type")] public string Type { get; set; } /// /// Resource content type. /// + [JsonProperty(PropertyName = "content_type")] public string ContentType { get; set; } } } diff --git a/DreamFactory/Model/RequestResourceWrapper.cs b/DreamFactory/Model/RequestResourceWrapper.cs index 969957e..8a53a45 100644 --- a/DreamFactory/Model/RequestResourceWrapper.cs +++ b/DreamFactory/Model/RequestResourceWrapper.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model { using global::System.Collections.Generic; + using Newtonsoft.Json; /// /// Wrapper for request resources. @@ -11,6 +12,7 @@ public class RequestResourceWrapper : ResourceWrapper /// /// Collection of identifiers. /// + [JsonProperty(PropertyName = "ids")] public int?[] Ids { get; set; } } } diff --git a/DreamFactory/Model/Resource.cs b/DreamFactory/Model/Resource.cs index 28e3660..e577a0e 100644 --- a/DreamFactory/Model/Resource.cs +++ b/DreamFactory/Model/Resource.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model { + using Newtonsoft.Json; + /// /// Resource. /// @@ -8,6 +10,7 @@ public class Resource /// /// Name of the resource. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } } } diff --git a/DreamFactory/Model/SuccessResponse.cs b/DreamFactory/Model/SuccessResponse.cs index 34c7571..8dd1e8c 100644 --- a/DreamFactory/Model/SuccessResponse.cs +++ b/DreamFactory/Model/SuccessResponse.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model { + using Newtonsoft.Json; + /// /// Success response. /// @@ -8,6 +10,7 @@ public class SuccessResponse /// /// Indicator whether request was successful. /// + [JsonProperty(PropertyName = "success")] public bool? Success { get; set; } } } diff --git a/DreamFactory/Model/System/App/AppRequest.cs b/DreamFactory/Model/System/App/AppRequest.cs index 9f7f88c..3f103b1 100644 --- a/DreamFactory/Model/System/App/AppRequest.cs +++ b/DreamFactory/Model/System/App/AppRequest.cs @@ -1,10 +1,6 @@ namespace DreamFactory.Model.System.App { - using DreamFactory.Model.System.AppGroup; - using DreamFactory.Model.System.Role; - using DreamFactory.Model.System.Service; - using DreamFactory.Model.System.User; - using global::System.Collections.Generic; + using Newtonsoft.Json; /// /// AppRequest. @@ -14,56 +10,67 @@ public class AppRequest : IRecord /// /// Identifier of this application. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Displayable name of this application. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Description of this application. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Is this system application active for use. /// + [JsonProperty(PropertyName = "is_active")] public bool? IsActive { get; set; } /// /// URL for accessing this application. /// + [JsonProperty(PropertyName = "url")] public string Url { get; set; } - + /// /// If hosted, the storage service identifier. /// + [JsonProperty(PropertyName = "storage_service_id")] public string StorageServiceId { get; set; } /// /// If hosted, the container of the storage service. /// + [JsonProperty(PropertyName = "storage_container")] public string StorageContainer { get; set; } /// /// True when this app needs to hide launchpad. /// + [JsonProperty(PropertyName = "requires_fullscreen")] public bool? RequiresFullscreen { get; set; } /// /// True to allow launchpad access via toggle. /// + [JsonProperty(PropertyName = "allow_fullscreen_toggle")] public bool? AllowFullscreenToggle { get; set; } /// /// Screen location for toggle placement. /// + [JsonProperty(PropertyName = "toggle_location")] public string ToggleLocation { get; set; } /// /// RoleId of the default role assigned to this application. /// + [JsonProperty(PropertyName = "role_id")] public int? RoleId { get; set; } } } diff --git a/DreamFactory/Model/System/App/AppResponse.cs b/DreamFactory/Model/System/App/AppResponse.cs index b8735fc..69c7b52 100644 --- a/DreamFactory/Model/System/App/AppResponse.cs +++ b/DreamFactory/Model/System/App/AppResponse.cs @@ -19,73 +19,111 @@ public class AppResponse /// /// Identifier of this application. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Displayable name of this application. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// ApiKey used for this application. /// + [JsonProperty(PropertyName = "api_key")] public string ApiKey { get; set; } /// /// Description of this application. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Is this system application active for use. /// + [JsonProperty(PropertyName = "is_active")] public bool? IsActive { get; set; } /// /// Is this system application active for use. /// + [JsonProperty(PropertyName = "type")] public int? Type{ get; set; } /// /// Path for this application. /// + [JsonProperty(PropertyName = "path")] public string Path { get; set; } /// /// URL for accessing this application. /// + [JsonProperty(PropertyName = "url")] public string Url { get; set; } /// /// If hosted, the storage service identifier. /// + [JsonProperty(PropertyName = "storage_service_id")] public string StorageServiceId { get; set; } /// /// If hosted, the container of the storage service. /// + [JsonProperty(PropertyName = "storage_container")] public string StorageContainer { get; set; } /// /// True when this app needs to hide launchpad. /// + [JsonProperty(PropertyName = "requires_fullscreen")] public bool? RequiresFullscreen { get; set; } /// /// True to allow launchpad access via toggle. /// + [JsonProperty(PropertyName = "allow_fullscreen_toggle")] public bool? AllowFullscreenToggle { get; set; } /// /// Screen location for toggle placement. /// + [JsonProperty(PropertyName = "toggle_location")] public string ToggleLocation { get; set; } /// /// RoleId of the default role assigned to this application. /// + [JsonProperty(PropertyName = "role_id")] public int? RoleId { get; set; } + /// + /// Date this application was created. + /// + [JsonProperty(PropertyName = "created_date")] + public DateTime? CreatedDate { get; set; } + + /// + /// User Id of who created this application. + /// + [JsonProperty(PropertyName = "created_by_id")] + public int? CreatedById { get; set; } + + /// + /// Date this application was last modified. + /// + [JsonProperty(PropertyName = "last_modified_date")] + public DateTime? LastModifiedDate { get; set; } + + /// + /// User Id of who last modified this application. + /// + [JsonProperty(PropertyName = "last_modified_by_id")] + public int? LastModifiedById { get; set; } + /// /// A single User record that this record potentially belongs to. /// @@ -151,25 +189,5 @@ public class AppResponse /// [JsonProperty(PropertyName = RelatedResources.App.Users)] public List Users { get; set; } - - /// - /// Date this application was created. - /// - public DateTime? CreatedDate { get; set; } - - /// - /// User Id of who created this application. - /// - public int? CreatedById { get; set; } - - /// - /// Date this application was last modified. - /// - public DateTime? LastModifiedDate { get; set; } - - /// - /// User Id of who last modified this application. - /// - public int? LastModifiedById { get; set; } } } diff --git a/DreamFactory/Model/System/App/RelatedApp.cs b/DreamFactory/Model/System/App/RelatedApp.cs index 781bf62..259d91e 100644 --- a/DreamFactory/Model/System/App/RelatedApp.cs +++ b/DreamFactory/Model/System/App/RelatedApp.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.System.App { using global::System; + using Newtonsoft.Json; /// /// RelatedApp. @@ -10,91 +11,109 @@ public class RelatedApp /// /// Identifier of this application. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Displayable name of this application. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Name of the application to use in API transactions. /// + [JsonProperty(PropertyName = "api_name")] public string ApiName { get; set; } /// /// Description of this application. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Is this system application active for use. /// + [JsonProperty(PropertyName = "is_active")] public bool? IsActive { get; set; } /// /// URL for accessing this application. /// + [JsonProperty(PropertyName = "url")] public string Url { get; set; } /// /// True when this application is hosted elsewhere, but available in Launchpad. /// + [JsonProperty(PropertyName = "is_url_external")] public bool? IsUrlExternal { get; set; } /// /// If hosted and imported, the url of zip or package file where the code originated. /// + [JsonProperty(PropertyName = "import_url")] public string ImportUrl { get; set; } /// /// If hosted, the storage service identifier. /// + [JsonProperty(PropertyName = "storage_service_id")] public string StorageServiceId { get; set; } /// /// If hosted, the container of the storage service. /// + [JsonProperty(PropertyName = "storage_container")] public string StorageContainer { get; set; } /// /// True when this app needs to hide launchpad. /// + [JsonProperty(PropertyName = "requires_fullscreen")] public bool? RequiresFullscreen { get; set; } /// /// True to allow launchpad access via toggle. /// + [JsonProperty(PropertyName = "allow_fullscreen_toggle")] public bool? AllowFullscreenToggle { get; set; } /// /// Screen location for toggle placement. /// + [JsonProperty(PropertyName = "toggle_location")] public string ToggleLocation { get; set; } /// /// True when the app relies on a browser plugin. /// + [JsonProperty(PropertyName = "requires_plugin")] public bool? RequiresPlugin { get; set; } /// /// Date this application was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// User Id of who created this application. /// + [JsonProperty(PropertyName = "created_by_id")] public int? CreatedById { get; set; } /// /// Date this application was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } /// /// User Id of who last modified this application. /// + [JsonProperty(PropertyName = "last_modified_by_id")] public int? LastModifiedById { get; set; } } } diff --git a/DreamFactory/Model/System/AppGroup/AppGroupRequest.cs b/DreamFactory/Model/System/AppGroup/AppGroupRequest.cs index a11e87d..13bf688 100644 --- a/DreamFactory/Model/System/AppGroup/AppGroupRequest.cs +++ b/DreamFactory/Model/System/AppGroup/AppGroupRequest.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.System.AppGroup { + using Newtonsoft.Json; + /// /// AppGroupResponse. /// @@ -8,16 +10,19 @@ public class AppGroupRequest : IRecord /// /// Identifier of this application group. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Displayable name of this application group. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Description of this application group. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } } } \ No newline at end of file diff --git a/DreamFactory/Model/System/AppGroup/AppGroupResponse.cs b/DreamFactory/Model/System/AppGroup/AppGroupResponse.cs index 4689300..74a74f8 100644 --- a/DreamFactory/Model/System/AppGroup/AppGroupResponse.cs +++ b/DreamFactory/Model/System/AppGroup/AppGroupResponse.cs @@ -15,36 +15,43 @@ public class AppGroupResponse /// /// Identifier of this application group. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Displayable name of this application group. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Description of this application group. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Date this group was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// User Id of who created this group. /// + [JsonProperty(PropertyName = "created_by_id")] public int? CreatedById { get; set; } /// /// Date this group was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } /// /// User Id of who last modified this group. /// + [JsonProperty(PropertyName = "last_modified_by_id")] public int? LastModifiedById { get; set; } /// diff --git a/DreamFactory/Model/System/AppGroup/RelatedAppGroup.cs b/DreamFactory/Model/System/AppGroup/RelatedAppGroup.cs index 9a36dac..ed886c0 100644 --- a/DreamFactory/Model/System/AppGroup/RelatedAppGroup.cs +++ b/DreamFactory/Model/System/AppGroup/RelatedAppGroup.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.System.AppGroup { using global::System; + using Newtonsoft.Json; /// /// RelatedAppGroup. @@ -10,36 +11,43 @@ public class RelatedAppGroup /// /// Identifier of this application group. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Displayable name of this application group. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Description of this application group. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Date this group was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// User Id of who created this group. /// + [JsonProperty(PropertyName = "created_by_id")] public int? CreatedById { get; set; } /// /// Date this group was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } /// /// User Id of who last modified this group. /// + [JsonProperty(PropertyName = "last_modified_by_id")] public int? LastModifiedById { get; set; } } } diff --git a/DreamFactory/Model/System/Config/ConfigRequest.cs b/DreamFactory/Model/System/Config/ConfigRequest.cs index 03ed090..c4bbf22 100644 --- a/DreamFactory/Model/System/Config/ConfigRequest.cs +++ b/DreamFactory/Model/System/Config/ConfigRequest.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.System.Config { using global::System.Collections.Generic; + using Newtonsoft.Json; /// /// ConfigRequest. @@ -10,16 +11,19 @@ public class ConfigRequest /// /// Comma-delimited list of fields the user is allowed to edit. /// + [JsonProperty(PropertyName = "editable_profile_fields")] public string EditableProfileFields { get; set; } /// /// An array of HTTP verbs that must be tunneled on this server. /// + [JsonProperty(PropertyName = "restricted_verbs")] public List RestrictedVerbs { get; set; } /// /// The date/time format used for timestamps. /// + [JsonProperty(PropertyName = "timestamp_format")] public string TimestampFormat { get; set; } } } diff --git a/DreamFactory/Model/System/Config/ConfigResponse.cs b/DreamFactory/Model/System/Config/ConfigResponse.cs index 0badd2c..3e051d0 100644 --- a/DreamFactory/Model/System/Config/ConfigResponse.cs +++ b/DreamFactory/Model/System/Config/ConfigResponse.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.System.Config { using global::System.Collections.Generic; + using Newtonsoft.Json; /// /// ConfigResponse. @@ -10,16 +11,19 @@ public class ConfigResponse /// /// Comma-delimited list of fields the user is allowed to edit. /// + [JsonProperty(PropertyName = "editable_profile_fields")] public string EditableProfileFields { get; set; } /// /// An array of HTTP verbs that must be tunneled on this server. /// + [JsonProperty(PropertyName = "restricted_verbs")] public List RestrictedVerbs { get; set; } /// /// The date/time format used for timestamps. /// + [JsonProperty(PropertyName = "timestamp_format")] public string TimestampFormat { get; set; } } } diff --git a/DreamFactory/Model/System/Cors/CorsRequest.cs b/DreamFactory/Model/System/Cors/CorsRequest.cs index 61b6ec4..c82464e 100644 --- a/DreamFactory/Model/System/Cors/CorsRequest.cs +++ b/DreamFactory/Model/System/Cors/CorsRequest.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.System.Cors { + using Newtonsoft.Json; + /// /// CORS request. /// @@ -8,36 +10,43 @@ public class CorsRequest : IRecord /// /// Identifier of the record. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Path of the CORS. /// + [JsonProperty(PropertyName = "path")] public string Path { get; set; } /// /// Origin of the CORS. /// + [JsonProperty(PropertyName = "origin")] public string Origin { get; set; } /// /// Header of the CORS. /// + [JsonProperty(PropertyName = "header")] public string Header { get; set; } /// /// HTTP methods allowed. /// + [JsonProperty(PropertyName = "method")] public int? Method { get; set; } /// /// Max age. /// + [JsonProperty(PropertyName = "max_age")] public int? MaxAge { get; set; } /// /// Indicates whether it is enabled. /// + [JsonProperty(PropertyName = "enabled")] public bool Enabled { get; set; } } } diff --git a/DreamFactory/Model/System/Cors/CorsResponse.cs b/DreamFactory/Model/System/Cors/CorsResponse.cs index 67f797f..11c70a0 100644 --- a/DreamFactory/Model/System/Cors/CorsResponse.cs +++ b/DreamFactory/Model/System/Cors/CorsResponse.cs @@ -12,57 +12,67 @@ public class CorsResponse /// /// Identifier of the record. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Path of the CORS. /// + [JsonProperty(PropertyName = "path")] public string Path { get; set; } /// /// Origin of the CORS. /// + [JsonProperty(PropertyName = "origin")] public string Origin { get; set; } /// /// Header of the CORS. /// + [JsonProperty(PropertyName = "header")] public string Header { get; set; } /// /// HTTP methods allowed. /// + [JsonProperty(PropertyName = "method")] public int? Method { get; set; } /// /// Max age. /// + [JsonProperty(PropertyName = "max_age")] public int? MaxAge { get; set; } /// /// Indicates whether it is enabled. /// + [JsonProperty(PropertyName = "enabled")] public bool Enabled { get; set; } - /// /// Date this CORS record was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// User Id of who created this CORS record. /// + [JsonProperty(PropertyName = "created_by_id")] public int? CreatedById { get; set; } /// /// Date this CORS record was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } /// /// User Id of who last modified this CORS record. /// + [JsonProperty(PropertyName = "last_modified_by_id")] public int? LastModifiedById { get; set; } /// diff --git a/DreamFactory/Model/System/Custom/CustomRequest.cs b/DreamFactory/Model/System/Custom/CustomRequest.cs index 120459b..c05b2b9 100644 --- a/DreamFactory/Model/System/Custom/CustomRequest.cs +++ b/DreamFactory/Model/System/Custom/CustomRequest.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.System.Custom { + using Newtonsoft.Json; + /// /// CustomRequest. /// @@ -8,16 +10,19 @@ public class CustomRequest /// /// Id of the user linked to custom setting. /// + [JsonProperty(PropertyName = "user_id")] public int? UserId { get; set; } /// /// Name of the resource. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Value of the resource. /// + [JsonProperty(PropertyName = "value")] public string Value { get; set; } } } diff --git a/DreamFactory/Model/System/Custom/CustomResponse.cs b/DreamFactory/Model/System/Custom/CustomResponse.cs index 4dd169b..40295a6 100644 --- a/DreamFactory/Model/System/Custom/CustomResponse.cs +++ b/DreamFactory/Model/System/Custom/CustomResponse.cs @@ -12,42 +12,50 @@ public class CustomResponse /// /// Id of the custom setting. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Id of the user linked to this custom setting. /// /// + [JsonProperty(PropertyName = "user_id")] public int? UserId { get; set; } /// /// Name of the custom setting. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Value of the custom setting. /// + [JsonProperty(PropertyName = "value")] public string Value { get; set; } /// /// Date when the custom setting was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// Date when the custom setting was modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } /// /// UserId that created the custom setting. /// + [JsonProperty(PropertyName = "created_by_id")] public int? CreatedById { get; set; } /// /// UserId that modified the custom setting. /// + [JsonProperty(PropertyName = "last_modified_by_id")] public int? LastModifiedById { get; set; } /// diff --git a/DreamFactory/Model/System/Email/EmailTemplateRequest.cs b/DreamFactory/Model/System/Email/EmailTemplateRequest.cs index f754cc2..9f7a5f5 100644 --- a/DreamFactory/Model/System/Email/EmailTemplateRequest.cs +++ b/DreamFactory/Model/System/Email/EmailTemplateRequest.cs @@ -2,6 +2,7 @@ { using DreamFactory.Model.Email; using global::System.Collections.Generic; + using Newtonsoft.Json; /// /// EmailTemplateRequest. @@ -11,61 +12,73 @@ public class EmailTemplateRequest : IRecord /// /// Identifier of this email template. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Displayable name of this email template. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Description of this email template. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Single or multiple receiver addresses. /// + [JsonProperty(PropertyName = "to")] public List To { get; set; } /// /// Optional CC receiver addresses. /// + [JsonProperty(PropertyName = "cc")] public List Cc { get; set; } /// /// Optional BCC receiver addresses. /// + [JsonProperty(PropertyName = "bcc")] public List Bcc { get; set; } /// /// Text only subject line. /// + [JsonProperty(PropertyName = "subject")] public string Subject { get; set; } /// /// Text only version of the body. /// + [JsonProperty(PropertyName = "body_text")] public string BodyText { get; set; } /// /// Escaped HTML version of the body. /// + [JsonProperty(PropertyName = "body_html")] public string BodyHtml { get; set; } /// /// Required sender name and email. /// + [JsonProperty(PropertyName = "from")] public EmailAddress From { get; set; } /// /// Optional reply to name and email. /// + [JsonProperty(PropertyName = "reply_to")] public EmailAddress ReplyTo { get; set; } /// /// Array of default name value pairs for template replacement. /// + [JsonProperty(PropertyName = "defaults")] public List Defaults { get; set; } } } diff --git a/DreamFactory/Model/System/Email/EmailTemplateResponse.cs b/DreamFactory/Model/System/Email/EmailTemplateResponse.cs index 33fd547..1983a48 100644 --- a/DreamFactory/Model/System/Email/EmailTemplateResponse.cs +++ b/DreamFactory/Model/System/Email/EmailTemplateResponse.cs @@ -3,6 +3,7 @@ using DreamFactory.Model.Email; using global::System; using global::System.Collections.Generic; + using Newtonsoft.Json; /// /// EmailTemplateResponse. @@ -12,81 +13,97 @@ public class EmailTemplateResponse /// /// Identifier of this email template. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Displayable name of this email template. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Description of this email template. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Single or multiple receiver addresses. /// + [JsonProperty(PropertyName = "to")] public List To { get; set; } /// /// Optional CC receiver addresses. /// + [JsonProperty(PropertyName = "cc")] public List Cc { get; set; } /// /// Optional BCC receiver addresses. /// + [JsonProperty(PropertyName = "bcc")] public List Bcc { get; set; } /// /// Text only subject line. /// + [JsonProperty(PropertyName = "subject")] public string Subject { get; set; } /// /// Text only version of the body. /// + [JsonProperty(PropertyName = "body_text")] public string BodyText { get; set; } /// /// Escaped HTML version of the body. /// + [JsonProperty(PropertyName = "body_html")] public string BodyHtml { get; set; } /// /// Required sender name and email. /// + [JsonProperty(PropertyName = "from")] public EmailAddress From { get; set; } /// /// Optional reply to name and email. /// + [JsonProperty(PropertyName = "reply_to")] public EmailAddress ReplyTo { get; set; } /// /// Array of default name value pairs for template replacement. /// + [JsonProperty(PropertyName = "defaults")] public List Defaults { get; set; } /// /// Date this email template was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// User Id of who created this email template. /// + [JsonProperty(PropertyName = "created_by_id")] public int? CreatedById { get; set; } /// /// Date this email template was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } /// /// User Id of who last modified this email template. /// + [JsonProperty(PropertyName = "last_modified_by_id")] public int? LastModifiedById { get; set; } } } diff --git a/DreamFactory/Model/System/Email/RelatedEmailTemplate.cs b/DreamFactory/Model/System/Email/RelatedEmailTemplate.cs index c70e561..ea51d3e 100644 --- a/DreamFactory/Model/System/Email/RelatedEmailTemplate.cs +++ b/DreamFactory/Model/System/Email/RelatedEmailTemplate.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.System.Email { using global::System; + using Newtonsoft.Json; /// /// RelatedEmailTemplate. @@ -10,91 +11,109 @@ public class RelatedEmailTemplate /// /// Identifier of this email template. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Displayable name of this email template. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Description of this email template. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Single or multiple receiver addresses. /// + [JsonProperty(PropertyName = "to")] public string To { get; set; } /// /// Optional CC receiver addresses. /// + [JsonProperty(PropertyName = "cc")] public string Cc { get; set; } /// /// Optional BCC receiver addresses. /// + [JsonProperty(PropertyName = "bcc")] public string Bcc { get; set; } /// /// Text only subject line. /// + [JsonProperty(PropertyName = "subject")] public string Subject { get; set; } /// /// Text only version of the body. /// + [JsonProperty(PropertyName = "body_text")] public string BodyText { get; set; } /// /// Escaped HTML version of the body. /// + [JsonProperty(PropertyName = "body_html")] public string BodyHtml { get; set; } /// /// Required sender name. /// + [JsonProperty(PropertyName = "from_name")] public string FromName { get; set; } /// /// Required sender email. /// + [JsonProperty(PropertyName = "reply_email")] public string ReplyEmail { get; set; } /// /// Optional reply to name. /// + [JsonProperty(PropertyName = "reply_to_name")] public string ReplyToName { get; set; } /// /// Optional reply to email. /// + [JsonProperty(PropertyName = "reply_to_email")] public string ReplyToEmail { get; set; } /// /// Defaults for this email template. /// + [JsonProperty(PropertyName = "defaults")] public string Defaults { get; set; } /// /// Date this email template was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// User Id of who created this email template. /// + [JsonProperty(PropertyName = "created_by_id")] public int? CreatedById { get; set; } /// /// Date this email template was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } /// /// User Id of who last modified this email template. /// + [JsonProperty(PropertyName = "last_modified_by_id")] public int? LastModifiedById { get; set; } } } diff --git a/DreamFactory/Model/System/Environment/EnvironmentResponse.cs b/DreamFactory/Model/System/Environment/EnvironmentResponse.cs index 8351888..e0f63da 100644 --- a/DreamFactory/Model/System/Environment/EnvironmentResponse.cs +++ b/DreamFactory/Model/System/Environment/EnvironmentResponse.cs @@ -13,21 +13,25 @@ public class EnvironmentResponse /// /// Platform info. /// + [JsonProperty(PropertyName = "platform")] public PlatformSection Platform { get; set; } /// /// Authentication metadata. /// + [JsonProperty(PropertyName = "authentication")] public object Authentication { get; set; } /// /// Server metadata. /// + [JsonProperty(PropertyName = "server")] public object Server { get; set; } /// /// Config metadata. /// + [JsonProperty(PropertyName = "config")] public object Config { get; set; } /// diff --git a/DreamFactory/Model/System/Environment/PlatformSection.cs b/DreamFactory/Model/System/Environment/PlatformSection.cs index cace159..c793b24 100644 --- a/DreamFactory/Model/System/Environment/PlatformSection.cs +++ b/DreamFactory/Model/System/Environment/PlatformSection.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.System.Environment { + using Newtonsoft.Json; + /// /// PlatformSection. /// @@ -8,26 +10,31 @@ public class PlatformSection /// /// is_hosted. /// + [JsonProperty(PropertyName = "is_hosted")] public bool? IsHosted { get; set; } /// /// dsp_version_current. /// + [JsonProperty(PropertyName = "version_current")] public string VersionCurrent { get; set; } /// /// dsp_version_latest. /// + [JsonProperty(PropertyName = "version_latest")] public string VersionLatest { get; set; } /// /// upgrade_available. /// + [JsonProperty(PropertyName = "upgrade_available")] public bool? UpgradeAvailable { get; set; } /// /// Host name. /// + [JsonProperty(PropertyName = "host")] public string Host { get; set; } } } \ No newline at end of file diff --git a/DreamFactory/Model/System/Event/EventScriptRequest.cs b/DreamFactory/Model/System/Event/EventScriptRequest.cs index cdbeef9..b2ef456 100644 --- a/DreamFactory/Model/System/Event/EventScriptRequest.cs +++ b/DreamFactory/Model/System/Event/EventScriptRequest.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.System.Event { + using Newtonsoft.Json; + /// /// EventScriptRequest. /// @@ -8,31 +10,37 @@ public class EventScriptRequest /// /// Name of this event script /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Type for this event script. /// + [JsonProperty(PropertyName = "type")] public string Type { get; set; } /// /// Indicator whether this event script is active. /// + [JsonProperty(PropertyName = "is_active")] public bool? IsActive { get; set; } /// /// Indicator whether this event script affect process. /// + [JsonProperty(PropertyName = "affects_process")] public bool? AffectsProcess { get; set; } /// /// Content of this event script. /// + [JsonProperty(PropertyName = "content")] public string Content { get; set; } /// /// Config for this event script. /// + [JsonProperty(PropertyName = "config")] public string Config { get; set; } } } diff --git a/DreamFactory/Model/System/Event/EventScriptResponse.cs b/DreamFactory/Model/System/Event/EventScriptResponse.cs index 3185100..57433f2 100644 --- a/DreamFactory/Model/System/Event/EventScriptResponse.cs +++ b/DreamFactory/Model/System/Event/EventScriptResponse.cs @@ -13,41 +13,49 @@ public class EventScriptResponse /// /// Name for this event script /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Type of this event script. /// + [JsonProperty(PropertyName = "type")] public string Type { get; set; } /// /// Indicator whether this event script is active. /// + [JsonProperty(PropertyName = "is_active")] public bool? IsActive { get; set; } /// /// Indicator whether this event script affects process. /// + [JsonProperty(PropertyName = "affects_process")] public bool? AffectsProcess { get; set; } /// /// Content of this event script. /// + [JsonProperty(PropertyName = "content")] public string Content { get; set; } /// /// Config for this event script. /// + [JsonProperty(PropertyName = "config")] public string Config { get; set; } /// /// Date this event script was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// Date this event script was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } /// diff --git a/DreamFactory/Model/System/Event/RelatedEventScript.cs b/DreamFactory/Model/System/Event/RelatedEventScript.cs index 3b975f2..b3ad31d 100644 --- a/DreamFactory/Model/System/Event/RelatedEventScript.cs +++ b/DreamFactory/Model/System/Event/RelatedEventScript.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.System.Event { using global::System; + using Newtonsoft.Json; /// /// RelatedEventScript. @@ -10,51 +11,61 @@ public class RelatedEventScript /// /// Name of this event script. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Type of this event script. /// + [JsonProperty(PropertyName = "type")] public string Type { get; set; } /// /// Indicator whether this event script is active. /// + [JsonProperty(PropertyName = "is_active")] public bool? IsActive { get; set; } /// /// Indicator whether this event script affects process. /// + [JsonProperty(PropertyName = "affects_process")] public bool? AffectsProcess { get; set; } /// /// Content of this event script. /// + [JsonProperty(PropertyName = "content")] public string Content { get; set; } /// /// Config for this event script. /// + [JsonProperty(PropertyName = "config")] public string Config { get; set; } /// /// Id of the user that created this event script. /// + [JsonProperty(PropertyName = "created_by_id")] public int? CreatedById { get; set; } /// /// Id of the user that last modified this event script. /// + [JsonProperty(PropertyName = "modified_by_id")] public int? ModifiedById { get; set; } /// /// Date this event script was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// Date this event script was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } } } diff --git a/DreamFactory/Model/System/Lookup/LookupRequest.cs b/DreamFactory/Model/System/Lookup/LookupRequest.cs index 401e7fd..7a4d09d 100644 --- a/DreamFactory/Model/System/Lookup/LookupRequest.cs +++ b/DreamFactory/Model/System/Lookup/LookupRequest.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.System.Lookup { + using Newtonsoft.Json; + /// /// LookupRequest. /// @@ -8,26 +10,31 @@ public class LookupRequest : IRecord /// /// Identifier of this lookup. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Name for this lookup. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Value of this lookup. /// + [JsonProperty(PropertyName = "value")] public string Value { get; set; } /// /// Indicator whether this lookup is private. /// + [JsonProperty(PropertyName = "private")] public bool? Private { get; set; } /// /// Description for this lookup. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } } } diff --git a/DreamFactory/Model/System/Lookup/LookupResponse.cs b/DreamFactory/Model/System/Lookup/LookupResponse.cs index 6be8766..e6d0840 100644 --- a/DreamFactory/Model/System/Lookup/LookupResponse.cs +++ b/DreamFactory/Model/System/Lookup/LookupResponse.cs @@ -13,46 +13,55 @@ public class LookupResponse /// /// Id for this lookup /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Name for this lookup. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Value of this lookup. /// + [JsonProperty(PropertyName = "value")] public string Value { get; set; } /// /// Indicator whether this lookup is private. /// + [JsonProperty(PropertyName = "private")] public bool? Private { get; set; } /// /// Description for this lookup. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Date this lookup was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// Date this lookup was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } /// /// Id of the user that created this lookup. /// + [JsonProperty(PropertyName = "created_by_id")] public int? CreatedById { get; set; } /// /// Id of the user that last modified this lookup. /// + [JsonProperty(PropertyName = "last_modified_by_id")] public int? LastModifiedById { get; set; } /// diff --git a/DreamFactory/Model/System/Lookup/RelatedLookup.cs b/DreamFactory/Model/System/Lookup/RelatedLookup.cs index 2cb199d..7e9622c 100644 --- a/DreamFactory/Model/System/Lookup/RelatedLookup.cs +++ b/DreamFactory/Model/System/Lookup/RelatedLookup.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.System.Lookup { using global::System; + using Newtonsoft.Json; /// /// RelatedLookup. @@ -10,46 +11,55 @@ public class RelatedLookup /// /// Id of this lookup. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Name of this lookup. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Value of this lookup. /// + [JsonProperty(PropertyName = "value")] public string Value { get; set; } /// /// Indicator whether this lookup is private. /// + [JsonProperty(PropertyName = "private")] public bool? Private { get; set; } /// /// Description of this lookup. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Id of the user that created this lookup. /// + [JsonProperty(PropertyName = "created_by_id")] public int? CreatedById { get; set; } /// /// Id of the user that last modified this lookup. /// + [JsonProperty(PropertyName = "modified_by_id")] public int? ModifiedById { get; set; } /// /// Date this lookup was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// Date this lookup was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } } } diff --git a/DreamFactory/Model/System/Role/RelatedRole.cs b/DreamFactory/Model/System/Role/RelatedRole.cs index 4d35c5a..ecb21a5 100644 --- a/DreamFactory/Model/System/Role/RelatedRole.cs +++ b/DreamFactory/Model/System/Role/RelatedRole.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.System.Role { using global::System; + using Newtonsoft.Json; /// /// RelatedRole. @@ -10,46 +11,55 @@ public class RelatedRole /// /// Identifier of this role. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Displayable name of this role. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Description of this role. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Is this role active for use. /// + [JsonProperty(PropertyName = "is_active")] public bool? IsActive { get; set; } /// /// Default launched app for this role. /// + [JsonProperty(PropertyName = "default_app_id")] public int? DefaultAppId { get; set; } /// /// Date this role was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// User Id of who created this role. /// + [JsonProperty(PropertyName = "created_by_id")] public int? CreatedById { get; set; } /// /// Date this role was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } /// /// User Id of who last modified this role. /// + [JsonProperty(PropertyName = "last_modified_by_id")] public int? LastModifiedById { get; set; } } } diff --git a/DreamFactory/Model/System/Role/RoleRequest.cs b/DreamFactory/Model/System/Role/RoleRequest.cs index 4718eb3..5fa52de 100644 --- a/DreamFactory/Model/System/Role/RoleRequest.cs +++ b/DreamFactory/Model/System/Role/RoleRequest.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.System.Role { + using Newtonsoft.Json; + /// /// RoleResponse. /// @@ -8,21 +10,25 @@ public class RoleRequest : IRecord /// /// Identifier of this role. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Displayable name of this role. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Description of this role. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Is this role active for use. /// + [JsonProperty(PropertyName = "is_active")] public bool? IsActive { get; set; } } } diff --git a/DreamFactory/Model/System/Role/RoleResponse.cs b/DreamFactory/Model/System/Role/RoleResponse.cs index eaad3cb..6e556d8 100644 --- a/DreamFactory/Model/System/Role/RoleResponse.cs +++ b/DreamFactory/Model/System/Role/RoleResponse.cs @@ -18,41 +18,49 @@ public class RoleResponse /// /// Identifier of this role. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Displayable name of this role. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Description of this role. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Is this role active for use. /// + [JsonProperty(PropertyName = "is_active")] public bool? IsActive { get; set; } /// /// Date this role was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// User Id of who created this role. /// + [JsonProperty(PropertyName = "created_by_id")] public int? CreatedById { get; set; } /// /// Date this role was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } /// /// User Id of who last modified this role. /// + [JsonProperty(PropertyName = "last_modified_by_id")] public int? LastModifiedById { get; set; } /// diff --git a/DreamFactory/Model/System/Script/RelatedScriptType.cs b/DreamFactory/Model/System/Script/RelatedScriptType.cs index 50d242a..86ab221 100644 --- a/DreamFactory/Model/System/Script/RelatedScriptType.cs +++ b/DreamFactory/Model/System/Script/RelatedScriptType.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.System.Script { using global::System; + using Newtonsoft.Json; /// /// RelatedScriptType. @@ -10,36 +11,43 @@ public class RelatedScriptType /// /// Name of this script type. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Class name of this script type. /// + [JsonProperty(PropertyName = "class_name")] public string ClassName { get; set; } /// /// Label for this script type. /// + [JsonProperty(PropertyName = "label")] public string Label { get; set; } /// /// Description for this script type. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Indicator whether this script type is sandboxed. /// + [JsonProperty(PropertyName = "sandboxed")] public bool? Sandboxed { get; set; } /// /// Date this script type was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// Date this script type was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } } } diff --git a/DreamFactory/Model/System/Script/ScriptTypeResponse.cs b/DreamFactory/Model/System/Script/ScriptTypeResponse.cs index 220c2e6..071b069 100644 --- a/DreamFactory/Model/System/Script/ScriptTypeResponse.cs +++ b/DreamFactory/Model/System/Script/ScriptTypeResponse.cs @@ -15,36 +15,43 @@ public class ScriptTypeResponse /// /// Name of this script type. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Class name for this script type. /// + [JsonProperty(PropertyName = "class_name")] public string ClassName { get; set; } /// /// Label for this script type. /// + [JsonProperty(PropertyName = "label")] public string Label { get; set; } /// /// Description for this script type. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Indicator whether this script type is sandboxed or not. /// + [JsonProperty(PropertyName = "sandboxed")] public bool? Sandboxed { get; set; } /// /// Created date for this script type. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// Last modified date for this script type. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } /// diff --git a/DreamFactory/Model/System/Service/RelatedService.cs b/DreamFactory/Model/System/Service/RelatedService.cs index 2c7720c..bdfd9f0 100644 --- a/DreamFactory/Model/System/Service/RelatedService.cs +++ b/DreamFactory/Model/System/Service/RelatedService.cs @@ -2,6 +2,7 @@ { using global::System; using global::System.Collections.Generic; + using Newtonsoft.Json; /// /// RelatedService. @@ -11,91 +12,109 @@ public class RelatedService /// /// Identifier of this service. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Displayable name of this service. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Name of the service to use in API transactions. /// + [JsonProperty(PropertyName = "api_name")] public string ApiName { get; set; } /// /// Description of this service. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// True if this service is active for use. /// + [JsonProperty(PropertyName = "is_active")] public bool? IsActive { get; set; } /// /// One of the supported service types. /// + [JsonProperty(PropertyName = "type")] public string Type { get; set; } /// /// One of the supported enumerated service types. /// + [JsonProperty(PropertyName = "type_id")] public int? TypeId { get; set; } /// /// They supported storage service type. /// + [JsonProperty(PropertyName = "storage_type")] public string StorageType { get; set; } /// /// One of the supported enumerated storage service types. /// + [JsonProperty(PropertyName = "storage_type_id")] public int? StorageTypeId { get; set; } /// /// Any credentials data required by the service. /// + [JsonProperty(PropertyName = "credentials")] public Dictionary Credentials { get; set; } /// /// The format of the returned data of the service. /// + [JsonProperty(PropertyName = "native_format")] public string NativeFormat { get; set; } /// /// The base URL for remote web services. /// + [JsonProperty(PropertyName = "base_url")] public string BaseUrl { get; set; } /// /// Additional URL parameters required by the service. /// + [JsonProperty(PropertyName = "parameters")] public List> Parameters { get; set; } /// /// Additional headers required by the service. /// + [JsonProperty(PropertyName = "headers")] public List Headers { get; set; } /// /// Date this service was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// User Id of who created this service. /// + [JsonProperty(PropertyName = "created_by_id")] public int? CreatedById { get; set; } /// /// Date this service was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } /// /// User Id of who last modified this service. /// + [JsonProperty(PropertyName = "last_modified_by_id")] public int? LastModifiedById { get; set; } } } \ No newline at end of file diff --git a/DreamFactory/Model/System/Service/RelatedServiceType.cs b/DreamFactory/Model/System/Service/RelatedServiceType.cs index 939d907..33375a6 100644 --- a/DreamFactory/Model/System/Service/RelatedServiceType.cs +++ b/DreamFactory/Model/System/Service/RelatedServiceType.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.System.Service { using global::System; + using Newtonsoft.Json; /// /// RelatedServiceType. @@ -10,46 +11,55 @@ public class RelatedServiceType /// /// Name of this script type. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Class name of this script type. /// + [JsonProperty(PropertyName = "class_name")] public string ClassName { get; set; } /// /// Config handler of this script type. /// + [JsonProperty(PropertyName = "config_handler")] public string ConfigHandler { get; set; } /// /// Label for this script type. /// + [JsonProperty(PropertyName = "label")] public string Label { get; set; } /// /// Description for this script type. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Group for this script type. /// + [JsonProperty(PropertyName = "group")] public string Group { get; set; } /// /// Indicator whether this service type is singleton. /// + [JsonProperty(PropertyName = "singleton")] public bool? Singleton { get; set; } /// /// Date this script type was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// Date this script type was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } } } diff --git a/DreamFactory/Model/System/Service/ServiceRequest.cs b/DreamFactory/Model/System/Service/ServiceRequest.cs index 93bf5f6..1486a9d 100644 --- a/DreamFactory/Model/System/Service/ServiceRequest.cs +++ b/DreamFactory/Model/System/Service/ServiceRequest.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.System.Service { using global::System; + using Newtonsoft.Json; /// /// ServiceResponse. @@ -10,31 +11,37 @@ public class ServiceRequest : IRecord /// /// Identifier of this service. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Displayable name of this service. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Label of this service. /// + [JsonProperty(PropertyName = "label")] public string Label { get; set; } /// /// Description of this service. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// True if this service is active for use. /// + [JsonProperty(PropertyName = "is_active")] public bool? IsActive { get; set; } /// /// One of the supported service types. /// + [JsonProperty(PropertyName = "type")] public string Type { get; set; } } } \ No newline at end of file diff --git a/DreamFactory/Model/System/Service/ServiceResponse.cs b/DreamFactory/Model/System/Service/ServiceResponse.cs index 344120e..9f67126 100644 --- a/DreamFactory/Model/System/Service/ServiceResponse.cs +++ b/DreamFactory/Model/System/Service/ServiceResponse.cs @@ -17,61 +17,73 @@ public class ServiceResponse /// /// Identifier of this service. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Displayable name of this service. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Label of this service. /// + [JsonProperty(PropertyName = "label")] public string Label { get; set; } /// /// Description of this service. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// True if this service is active for use. /// + [JsonProperty(PropertyName = "is_active")] public bool? IsActive { get; set; } /// /// One of the supported service types. /// + [JsonProperty(PropertyName = "type")] public string Type { get; set; } /// /// Indicates whether this service is mutable. /// + [JsonProperty(PropertyName = "mutable")] public bool? Mutable { get; set; } /// /// Indicates whether this service can be deleted. /// + [JsonProperty(PropertyName = "deletable")] public bool? Deletable { get; set; } /// /// Date this service was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// Date this service was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } /// /// Id of the user that created this service. /// + [JsonProperty(PropertyName = "created_by_id")] public int? CreatedById { get; set; } /// /// Id of the user that last modified this service. /// + [JsonProperty(PropertyName = "last_modified_by_id")] public int? LastModifiedById { get; set; } /// diff --git a/DreamFactory/Model/System/Setting/RelatedSetting.cs b/DreamFactory/Model/System/Setting/RelatedSetting.cs index ce37b4c..e4473e9 100644 --- a/DreamFactory/Model/System/Setting/RelatedSetting.cs +++ b/DreamFactory/Model/System/Setting/RelatedSetting.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.System.Setting { using global::System; + using Newtonsoft.Json; /// /// RelatedSetting. @@ -10,36 +11,43 @@ public class RelatedSetting /// /// Id of this setting. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Name of this setting. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Value of this setting. /// + [JsonProperty(PropertyName = "value")] public string Value { get; set; } /// /// Id of the user that created this setting. /// + [JsonProperty(PropertyName = "created_by_id")] public int? CreatedById { get; set; } /// /// Id of the user that last modified this setting. /// - public int? ModifiedById { get; set; } + [JsonProperty(PropertyName = "last_modified_by_id")] + public int? LastModifiedById { get; set; } /// /// Date this setting was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// Date this setting was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } } } diff --git a/DreamFactory/Model/System/User/RelatedUser.cs b/DreamFactory/Model/System/User/RelatedUser.cs index e32d5a9..339af4a 100644 --- a/DreamFactory/Model/System/User/RelatedUser.cs +++ b/DreamFactory/Model/System/User/RelatedUser.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.System.User { using global::System; + using Newtonsoft.Json; /// /// RelatedUser. @@ -10,76 +11,91 @@ public class RelatedUser /// /// Identifier of this user. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// The email address required for this user. /// + [JsonProperty(PropertyName = "email")] public string Email { get; set; } /// /// The set-able, but never readable, password. /// + [JsonProperty(PropertyName = "password")] public string Password { get; set; } /// /// The first name for this user. /// + [JsonProperty(PropertyName = "first_name")] public string FirstName { get; set; } /// /// The last name for this user. /// + [JsonProperty(PropertyName = "last_name")] public string LastName { get; set; } /// /// Displayable name of this user. /// + [JsonProperty(PropertyName = "display_name")] public string DisplayName { get; set; } /// /// Phone number for this user. /// + [JsonProperty(PropertyName = "phone")] public string Phone { get; set; } /// /// True if this user is active for use. /// + [JsonProperty(PropertyName = "is_active")] public bool? IsActive { get; set; } /// /// True if this user is a system admin. /// + [JsonProperty(PropertyName = "is_sys_admin")] public bool? IsSysAdmin { get; set; } /// /// The default launched app for this user. /// + [JsonProperty(PropertyName = "default_app_id")] public string DefaultAppId { get; set; } /// /// The role to which this user is assigned. /// + [JsonProperty(PropertyName = "role_id")] public string RoleId { get; set; } /// /// Date this user was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// User Id of who created this user. /// + [JsonProperty(PropertyName = "created_by_id")] public int? CreatedById { get; set; } /// /// Date this user was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } /// /// User Id of who last modified this user. /// + [JsonProperty(PropertyName = "last_modified_by_id")] public int? LastModifiedById { get; set; } } } diff --git a/DreamFactory/Model/System/User/UserRequest.cs b/DreamFactory/Model/System/User/UserRequest.cs index a036750..aa9f77c 100644 --- a/DreamFactory/Model/System/User/UserRequest.cs +++ b/DreamFactory/Model/System/User/UserRequest.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.System.User { using global::System; + using Newtonsoft.Json; /// /// UserRequest. @@ -10,66 +11,79 @@ public class UserRequest : IRecord /// /// Identifier of this user. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Displayable name of this user. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// The first name for this user. /// + [JsonProperty(PropertyName = "first_name")] public string FirstName { get; set; } /// /// The last name for this user. /// + [JsonProperty(PropertyName = "last_name")] public string LastName { get; set; } /// /// The last login date for this user. /// + [JsonProperty(PropertyName = "last_login_date")] public DateTime? LastLoginDate { get; set; } /// /// The email address required for this user. /// + [JsonProperty(PropertyName = "email")] public string Email { get; set; } /// /// True if this user is active for use. /// + [JsonProperty(PropertyName = "is_active")] public bool? IsActive { get; set; } /// /// Phone number for this user. /// + [JsonProperty(PropertyName = "phone")] public string Phone { get; set; } /// /// The security question for this user. /// + [JsonProperty(PropertyName = "security_question")] public string SecurityQuestion { get; set; } /// /// The security answer for this user. /// + [JsonProperty(PropertyName = "security_answer")] public string SecurityAnswer { get; set; } /// /// The default launched app for this user. /// + [JsonProperty(PropertyName = "default_app_id")] public int? DefaultAppId { get; set; } /// /// The adLDAP for this user. /// + [JsonProperty(PropertyName = "adldap")] public string Adldap { get; set; } /// /// The OAuth provider for this user. /// + [JsonProperty(PropertyName = "oauth_provider")] public string OauthProvider { get; set; } } } diff --git a/DreamFactory/Model/System/User/UserResponse.cs b/DreamFactory/Model/System/User/UserResponse.cs index de69904..6dd8dc2 100644 --- a/DreamFactory/Model/System/User/UserResponse.cs +++ b/DreamFactory/Model/System/User/UserResponse.cs @@ -23,106 +23,127 @@ public class UserResponse /// /// Identifier of this user. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Displayable name of this user. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// The first name for this user. /// + [JsonProperty(PropertyName = "first_name")] public string FirstName { get; set; } /// /// The last name for this user. /// + [JsonProperty(PropertyName = "last_name")] public string LastName { get; set; } /// /// Date this user last logged in. /// + [JsonProperty(PropertyName = "last_login_date")] public DateTime? LastLoginDate { get; set; } /// /// The email address required for this user. /// + [JsonProperty(PropertyName = "email")] public string Email { get; set; } /// /// The set-able, but never readable, password. /// + [JsonProperty(PropertyName = "password")] public string Password { get; set; } /// /// True if this user is system admin. /// + [JsonProperty(PropertyName = "is_sys_admin")] public bool? IsSysAdmin { get; set; } /// /// True if this user is active for use. /// + [JsonProperty(PropertyName = "is_active")] public bool? IsActive { get; set; } /// /// Phone number for this user. /// + [JsonProperty(PropertyName = "phone")] public string Phone { get; set; } /// /// Security question for this user. /// + [JsonProperty(PropertyName = "security_question")] public string SecurityQuestion { get; set; } /// /// Security answer for this user. /// + [JsonProperty(PropertyName = "security_answer")] public string SecurityAnswer { get; set; } /// /// Confirm code for this user. /// + [JsonProperty(PropertyName = "confirm_code")] public string ConfirmCode { get; set; } /// /// The id of the default launched app for this user. /// + [JsonProperty(PropertyName = "default_app_id")] public int DefaultAppId { get; set; } /// /// Remember token for this user. /// + [JsonProperty(PropertyName = "remember_token")] public string RememberToken { get; set; } /// /// Adldap for this user. /// + [JsonProperty(PropertyName = "adldap")] public string Adldap { get; set; } /// /// OAuth provider for this user. /// + [JsonProperty(PropertyName = "oauth_provider")] public string OauthProvider { get; set; } /// /// Date this user was created. /// + [JsonProperty(PropertyName = "created_date")] public DateTime? CreatedDate { get; set; } /// /// User Id of who created this user. /// + [JsonProperty(PropertyName = "created_by_id")] public int? CreatedById { get; set; } /// /// Date this user was last modified. /// + [JsonProperty(PropertyName = "last_modified_date")] public DateTime? LastModifiedDate { get; set; } /// /// User Id of who last modified this user. /// + [JsonProperty(PropertyName = "last_modified_by_id")] public int? LastModifiedById { get; set; } /// diff --git a/DreamFactory/Model/User/Login.cs b/DreamFactory/Model/User/Login.cs index e62e81d..543c498 100644 --- a/DreamFactory/Model/User/Login.cs +++ b/DreamFactory/Model/User/Login.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.User { + using Newtonsoft.Json; + /// /// Login. /// @@ -8,16 +10,19 @@ public class Login /// /// e-mail. /// + [JsonProperty(PropertyName = "email")] public string Email { get; set; } - + /// /// Password. /// + [JsonProperty(PropertyName = "password")] public string Password { get; set; } /// /// Duration of the session, Defaults to 0, which means until browser is closed. /// + [JsonProperty(PropertyName = "duration")] public int? Duration { get; set; } } } diff --git a/DreamFactory/Model/User/PasswordRequest.cs b/DreamFactory/Model/User/PasswordRequest.cs index ca1da08..18771a1 100644 --- a/DreamFactory/Model/User/PasswordRequest.cs +++ b/DreamFactory/Model/User/PasswordRequest.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.User { + using Newtonsoft.Json; + /// /// PasswordRequest. /// @@ -8,26 +10,31 @@ public class PasswordRequest /// /// Old password to validate change during a session. /// + [JsonProperty(PropertyName = "old_password")] public string OldPassword { get; set; } /// /// New password to be set. /// + [JsonProperty(PropertyName = "new_password")] public string NewPassword { get; set; } /// /// User's email to be used with code to validate email confirmation. /// + [JsonProperty(PropertyName = "email")] public string Email { get; set; } /// /// Code required with new_password when using email confirmation. /// + [JsonProperty(PropertyName = "code")] public string Code { get; set; } /// /// Code required with new_password when using email confirmation. /// + [JsonProperty(PropertyName = "security_answer")] public string SecurityAnswer { get; set; } } } diff --git a/DreamFactory/Model/User/PasswordResponse.cs b/DreamFactory/Model/User/PasswordResponse.cs index c04ebef..9fe0b46 100644 --- a/DreamFactory/Model/User/PasswordResponse.cs +++ b/DreamFactory/Model/User/PasswordResponse.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.User { + using Newtonsoft.Json; + /// /// PasswordResponse. /// @@ -8,11 +10,13 @@ public class PasswordResponse /// /// User's security question, returned on reset request when no email confirmation required. /// + [JsonProperty(PropertyName = "security_question")] public string SecurityQuestion { get; set; } /// /// True if password updated or reset request granted via email confirmation. /// + [JsonProperty(PropertyName = "success")] public bool? Success { get; set; } } } diff --git a/DreamFactory/Model/User/ProfileRequest.cs b/DreamFactory/Model/User/ProfileRequest.cs index 1fb62a5..f06f808 100644 --- a/DreamFactory/Model/User/ProfileRequest.cs +++ b/DreamFactory/Model/User/ProfileRequest.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.User { + using Newtonsoft.Json; + /// /// ProfileRequest /// @@ -8,41 +10,49 @@ public class ProfileRequest /// /// Email address of the current user. /// + [JsonProperty(PropertyName = "email")] public string Email { get; set; } /// /// First name of the current user. /// + [JsonProperty(PropertyName = "first_name")] public string FirstName { get; set; } /// /// Last name of the current user. /// + [JsonProperty(PropertyName = "last_name")] public string LastName { get; set; } /// /// Full display name of the current user. /// + [JsonProperty(PropertyName = "display_name")] public string DisplayName { get; set; } /// /// Phone number. /// + [JsonProperty(PropertyName = "phone")] public string Phone { get; set; } /// /// Question to be answered to initiate password reset. /// + [JsonProperty(PropertyName = "security_question")] public string SecurityQuestion { get; set; } /// /// Id of the application to be launched at login. /// + [JsonProperty(PropertyName = "default_app_id")] public int? DefaultAppId { get; set; } /// /// Answer to the security question. /// - public string SecurityAnswer { get; set; } + [JsonProperty(PropertyName = "security_answer")] + public string SecurityAnswer { get; set; } } } \ No newline at end of file diff --git a/DreamFactory/Model/User/ProfileResponse.cs b/DreamFactory/Model/User/ProfileResponse.cs index a42dcca..f3aece0 100644 --- a/DreamFactory/Model/User/ProfileResponse.cs +++ b/DreamFactory/Model/User/ProfileResponse.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.User { + using Newtonsoft.Json; + /// /// ProfileResponse. /// @@ -8,36 +10,43 @@ public class ProfileResponse /// /// Email address of the current user. /// + [JsonProperty(PropertyName = "email")] public string Email { get; set; } /// /// First name of the current user. /// + [JsonProperty(PropertyName = "first_name")] public string FirstName { get; set; } /// /// Last name of the current user. /// + [JsonProperty(PropertyName = "last_name")] public string LastName { get; set; } /// /// Full display name of the current user. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Phone number. /// + [JsonProperty(PropertyName = "phone")] public string Phone { get; set; } /// /// Question to be answered to initiate password reset. /// + [JsonProperty(PropertyName = "security_question")] public string SecurityQuestion { get; set; } /// /// Id of the application to be launched at login. /// + [JsonProperty(PropertyName = "default_app_id")] public int? DefaultAppId { get; set; } } } diff --git a/DreamFactory/Model/User/ProfileUpdateResponse.cs b/DreamFactory/Model/User/ProfileUpdateResponse.cs index d9e6791..b2c6879 100644 --- a/DreamFactory/Model/User/ProfileUpdateResponse.cs +++ b/DreamFactory/Model/User/ProfileUpdateResponse.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.User { + using Newtonsoft.Json; + /// /// ProfileUpdateResponse. /// @@ -8,6 +10,7 @@ public class ProfileUpdateResponse /// /// Indicator whether updating profile was successful. /// + [JsonProperty(PropertyName = "success")] public bool? Success { get; set; } } } diff --git a/DreamFactory/Model/User/Register.cs b/DreamFactory/Model/User/Register.cs index 50be5a1..137b9a6 100644 --- a/DreamFactory/Model/User/Register.cs +++ b/DreamFactory/Model/User/Register.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.User { + using Newtonsoft.Json; + /// /// Register (new user). /// @@ -8,31 +10,37 @@ public class Register /// /// Email address of the new user. /// + [JsonProperty(PropertyName = "email")] public string Email { get; set; } /// /// First name of the new user. /// + [JsonProperty(PropertyName = "first_name")] public string FirstName { get; set; } /// /// Last name of the new user. /// + [JsonProperty(PropertyName = "last_name")] public string LastName { get; set; } /// /// Full display name of the new user. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Password for the new user. /// + [JsonProperty(PropertyName = "new_password")] public string NewPassword { get; set; } /// /// Code required with new_password when using email confirmation. /// + [JsonProperty(PropertyName = "code")] public string Code { get; set; } } } \ No newline at end of file diff --git a/DreamFactory/Model/User/RegisterResponse.cs b/DreamFactory/Model/User/RegisterResponse.cs index 489a08f..1c56655 100644 --- a/DreamFactory/Model/User/RegisterResponse.cs +++ b/DreamFactory/Model/User/RegisterResponse.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.User { + using Newtonsoft.Json; + /// /// Register response. /// @@ -9,6 +11,7 @@ public class RegisterResponse : SuccessResponse /// Token for the current session, used in X-DreamFactory-Session-Token header for API requests. /// SessionToken has value only if request had parameter login set to true. /// + [JsonProperty(PropertyName = "session_token")] public string SessionToken { get; set; } } } diff --git a/DreamFactory/Model/User/Session.cs b/DreamFactory/Model/User/Session.cs index e387268..683c22a 100644 --- a/DreamFactory/Model/User/Session.cs +++ b/DreamFactory/Model/User/Session.cs @@ -1,6 +1,7 @@ namespace DreamFactory.Model.User { using global::System.Collections.Generic; + using Newtonsoft.Json; /// /// Session. @@ -10,61 +11,73 @@ public class Session /// /// Identifier for the current user. /// + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// /// Email address of the current user. /// + [JsonProperty(PropertyName = "email")] public string Email { get; set; } /// /// Name of the current user. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// First name of the current user. /// + [JsonProperty(PropertyName = "first_name")] public string FirstName { get; set; } /// /// Last name of the current user. /// + [JsonProperty(PropertyName = "last_name")] public string LastName { get; set; } /// /// Is the current user a system administrator. /// + [JsonProperty(PropertyName = "is_sys_admin")] public bool? IsSysAdmin { get; set; } /// /// Name of the role to which the current user is assigned. /// + [JsonProperty(PropertyName = "role")] public string Role { get; set; } /// /// Date timestamp of the last login for the current user. /// + [JsonProperty(PropertyName = "last_login_date")] public string LastLoginDate { get; set; } /// /// App groups and the containing apps. /// + [JsonProperty(PropertyName = "app_groups")] public List AppGroups { get; set; } /// /// Apps that are not in any app groups. /// + [JsonProperty(PropertyName = "no_group_apps")] public List NoGroupApps { get; set; } - + /// /// Id for the current session, used in X-DreamFactory-Session-Token header for API requests. /// + [JsonProperty(PropertyName = "session_id")] public string SessionId { get; set; } /// /// Token for the current session, used in X-DreamFactory-Session-Token header for API requests. /// + [JsonProperty(PropertyName = "session_token")] public string SessionToken { get; set; } } } \ No newline at end of file diff --git a/DreamFactory/Model/User/SessionApp.cs b/DreamFactory/Model/User/SessionApp.cs index c2c82f9..85b4b5e 100644 --- a/DreamFactory/Model/User/SessionApp.cs +++ b/DreamFactory/Model/User/SessionApp.cs @@ -1,5 +1,7 @@ namespace DreamFactory.Model.User { + using Newtonsoft.Json; + /// /// SessionApp. /// @@ -8,46 +10,55 @@ public class SessionApp /// /// Id of the application. /// + [JsonProperty(PropertyName = "id")] public int? Id { get; set; } /// /// Displayed name of the application. /// + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Description of the application. /// + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Does this application exist on a separate server. /// + [JsonProperty(PropertyName = "is_url_external")] public bool? IsUrlExternal { get; set; } /// /// URL at which this app can be accessed. /// + [JsonProperty(PropertyName = "launch_url")] public string LaunchUrl { get; set; } /// /// True if the application requires full screen to run. /// + [JsonProperty(PropertyName = "requires_fullscreen")] public bool? RequiresFullscreen { get; set; } /// /// True allows the full screen toggle widget to be displayed. /// + [JsonProperty(PropertyName = "allow_fullscreen_toggle")] public bool? AllowFullscreenToggle { get; set; } /// /// Where the full screen toggle widget is to be displayed, defaults to top. /// + [JsonProperty(PropertyName = "toggle_location")] public string ToggleLocation { get; set; } /// /// True if this app is set to launch by default at sign in. /// + [JsonProperty(PropertyName = "is_default")] public bool? IsDefault { get; set; } } } diff --git a/DreamFactory/Properties/AssemblyInfo.cs b/DreamFactory/Properties/AssemblyInfo.cs index 01be77b..0057d48 100644 --- a/DreamFactory/Properties/AssemblyInfo.cs +++ b/DreamFactory/Properties/AssemblyInfo.cs @@ -25,6 +25,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.2.*")] +[assembly: AssemblyVersion("2.0.3.*")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: InternalsVisibleTo("DreamFactory.Tests")] diff --git a/DreamFactory/Rest/RestContext.cs b/DreamFactory/Rest/RestContext.cs index 9bbc80a..dcb98cf 100644 --- a/DreamFactory/Rest/RestContext.cs +++ b/DreamFactory/Rest/RestContext.cs @@ -21,7 +21,7 @@ public class RestContext : IRestContext /// Application name. /// Application API key. /// REST API version to use. - public RestContext(string baseAddress, string applicationName, string applicationApiKey, RestApiVersion apiVersion = RestApiVersion.V1) + public RestContext(string baseAddress, string applicationName, string applicationApiKey, RestApiVersion apiVersion = RestApiVersion.V2) : this(baseAddress, applicationName, applicationApiKey, null, new UnirestHttpFacade(), new JsonContentSerializer(), apiVersion) { } @@ -34,7 +34,7 @@ public RestContext(string baseAddress, string applicationName, string applicatio /// Application API key. /// SessionId to be added to base headers. /// REST API version to use. - public RestContext(string baseAddress, string applicationName, string applicationApiKey, string sessionId, RestApiVersion apiVersion = RestApiVersion.V1) + public RestContext(string baseAddress, string applicationName, string applicationApiKey, string sessionId, RestApiVersion apiVersion = RestApiVersion.V2) : this(baseAddress, applicationName, applicationApiKey, sessionId, new UnirestHttpFacade(), new JsonContentSerializer(), apiVersion) { } @@ -49,7 +49,7 @@ public RestContext(string baseAddress, string applicationName, string applicatio /// User defined instance of . /// User defined instance of . /// REST API version to use. - public RestContext(string baseAddress, string applicationName, string applicationApiKey, string sessionId, IHttpFacade httpFacade, IContentSerializer serializer, RestApiVersion apiVersion = RestApiVersion.V1) + public RestContext(string baseAddress, string applicationName, string applicationApiKey, string sessionId, IHttpFacade httpFacade, IContentSerializer serializer, RestApiVersion apiVersion = RestApiVersion.V2) { HttpUtils.CheckUrlString(baseAddress); diff --git a/DreamFactory/Serialization/IPropertyNameResolver.cs b/DreamFactory/Serialization/IPropertyNameResolver.cs deleted file mode 100644 index 1a93200..0000000 --- a/DreamFactory/Serialization/IPropertyNameResolver.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace DreamFactory.Serialization -{ - /// - /// Implementation of a property name resolver class. - /// - public interface IPropertyNameResolver - { - /// - /// For a given name of the property returns resolved property name. - /// - /// Name of the property. - /// Resolved property name. - string Resolve(string propertyName); - } -} \ No newline at end of file diff --git a/DreamFactory/Serialization/JsonContentSerializer.cs b/DreamFactory/Serialization/JsonContentSerializer.cs index 1627358..2952036 100644 --- a/DreamFactory/Serialization/JsonContentSerializer.cs +++ b/DreamFactory/Serialization/JsonContentSerializer.cs @@ -17,8 +17,7 @@ public JsonContentSerializer() { settings = new JsonSerializerSettings { - NullValueHandling = NullValueHandling.Ignore, - ContractResolver = new SnakeCaseContractResolver() + NullValueHandling = NullValueHandling.Ignore }; } diff --git a/DreamFactory/Serialization/SnakeCaseContractResolver.cs b/DreamFactory/Serialization/SnakeCaseContractResolver.cs deleted file mode 100644 index 300f12f..0000000 --- a/DreamFactory/Serialization/SnakeCaseContractResolver.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace DreamFactory.Serialization -{ - using Newtonsoft.Json.Serialization; - - /// - /// Underscore separated, lower case property name contract resolver class. - /// - public class SnakeCaseContractResolver : DefaultContractResolver - { - /// - /// Resolves the name of the property. - /// - /// Name of the property to be resolved. - /// - /// Resolved name of the property. - /// - protected override string ResolvePropertyName(string propertyName) - { - IPropertyNameResolver resolver = new SnakeCasePropertyNameResolver(); - return resolver.Resolve(propertyName); - } - } -} diff --git a/DreamFactory/Serialization/SnakeCasePropertyNameResolver.cs b/DreamFactory/Serialization/SnakeCasePropertyNameResolver.cs deleted file mode 100644 index d486fa1..0000000 --- a/DreamFactory/Serialization/SnakeCasePropertyNameResolver.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace DreamFactory.Serialization -{ - using System.Collections.Generic; - using System.Text; - - /// - public class SnakeCasePropertyNameResolver : IPropertyNameResolver - { - /// - public string Resolve(string propertyName) - { - var parts = new List(); - var currentWord = new StringBuilder(); - - foreach (var c in propertyName) - { - if (char.IsUpper(c) && currentWord.Length > 0) - { - parts.Add(currentWord.ToString()); - currentWord.Clear(); - } - currentWord.Append(char.ToLower(c)); - } - - if (currentWord.Length > 0) - { - parts.Add(currentWord.ToString()); - } - - return string.Join("_", parts.ToArray()); - } - } -} diff --git a/DreamFactoryNet.nuspec b/DreamFactoryNet.nuspec index f226109..b8078e5 100644 --- a/DreamFactoryNet.nuspec +++ b/DreamFactoryNet.nuspec @@ -2,7 +2,7 @@ DreamFactoryNet - 2.0.2 + 2.0.3 DreamFactory DreamFactory.com https://raw.githubusercontent.com/dreamfactorysoftware/.net-sdk/master/favicon_32x32.png diff --git a/README.md b/README.md index 84cceb0..9c9dadd 100644 --- a/README.md +++ b/README.md @@ -214,7 +214,7 @@ Specify service name for creating an interface to a named service: The API supports pluggable serialization. This SDK comes with the default `JsonContentSerializer` which is using [Json.NET](http://www.newtonsoft.com/json). To use your custom serializer, consider using the other `RestContext` constructor accepting a user-defined `IContentSerializer` instance. -By default `JsonContentSerializer` uses `SnakeCaseContractResolver` to resolve property names which means it allows you to use pascal-cased convention in your code and change the names on serialization to follow snake-cased convention (ex MyProperty to my_property). To override this behavior you will have to provide your own `DefaultContractResolver` and plug it into `JsonContentSerializer`. +By default Json.NET resolves property names as they are defined in the class unless specified otherwise with JsonPropertyAttribute. #### SQL query parameters