/*
* 后台API
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: Admin
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter;
namespace IO.Swagger.Model
{
///
/// StockDetail
///
[DataContract]
public partial class StockDetail : IEquatable, IValidatableObject
{
///
/// Initializes a new instance of the class.
///
/// 物料编码.
/// 应该数量,如果只有一个数量,则和实际数量传同一个值.
/// 实际数量.
/// 单价.
public StockDetail(string code = default(string), double? shouldQty = default(double?), double? qty = default(double?), double? unitPrice = default(double?))
{
this.Code = code;
this.ShouldQty = shouldQty;
this.Qty = qty;
this.UnitPrice = unitPrice;
}
///
/// 物料编码
///
/// 物料编码
[DataMember(Name="code", EmitDefaultValue=false)]
public string Code { get; set; }
///
/// 应该数量,如果只有一个数量,则和实际数量传同一个值
///
/// 应该数量,如果只有一个数量,则和实际数量传同一个值
[DataMember(Name="shouldQty", EmitDefaultValue=false)]
public double? ShouldQty { get; set; }
///
/// 实际数量
///
/// 实际数量
[DataMember(Name="qty", EmitDefaultValue=false)]
public double? Qty { get; set; }
///
/// 单价
///
/// 单价
[DataMember(Name="unitPrice", EmitDefaultValue=false)]
public double? UnitPrice { get; set; }
///
/// Returns the string presentation of the object
///
/// String presentation of the object
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class StockDetail {\n");
sb.Append(" Code: ").Append(Code).Append("\n");
sb.Append(" ShouldQty: ").Append(ShouldQty).Append("\n");
sb.Append(" Qty: ").Append(Qty).Append("\n");
sb.Append(" UnitPrice: ").Append(UnitPrice).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
///
/// Returns the JSON string presentation of the object
///
/// JSON string presentation of the object
public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
///
/// Returns true if objects are equal
///
/// Object to be compared
/// Boolean
public override bool Equals(object input)
{
return this.Equals(input as StockDetail);
}
///
/// Returns true if StockDetail instances are equal
///
/// Instance of StockDetail to be compared
/// Boolean
public bool Equals(StockDetail input)
{
if (input == null)
return false;
return
(
this.Code == input.Code ||
(this.Code != null &&
this.Code.Equals(input.Code))
) &&
(
this.ShouldQty == input.ShouldQty ||
(this.ShouldQty != null &&
this.ShouldQty.Equals(input.ShouldQty))
) &&
(
this.Qty == input.Qty ||
(this.Qty != null &&
this.Qty.Equals(input.Qty))
) &&
(
this.UnitPrice == input.UnitPrice ||
(this.UnitPrice != null &&
this.UnitPrice.Equals(input.UnitPrice))
);
}
///
/// Gets the hash code
///
/// Hash code
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.Code != null)
hashCode = hashCode * 59 + this.Code.GetHashCode();
if (this.ShouldQty != null)
hashCode = hashCode * 59 + this.ShouldQty.GetHashCode();
if (this.Qty != null)
hashCode = hashCode * 59 + this.Qty.GetHashCode();
if (this.UnitPrice != null)
hashCode = hashCode * 59 + this.UnitPrice.GetHashCode();
return hashCode;
}
}
///
/// To validate all properties of the instance
///
/// Validation context
/// Validation Result
IEnumerable IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}