csharp/Autodesk-Forge/forge-api-dotnet-client/src/Autodesk.Forge/Model/VersionAttributes.cs

Model
VersionAttributes.cs
/* 
 * Forge SDK
 *
 * The Forge Platform contains an expanding collection of web service components that can be used with Autodesk cloud-based products or your own technologies. Take advantage of Autodesk’s expertise in design and engineering.
 *
 * OpenAPI spec version: 0.1.0
 * Contact: [email protected]
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace Autodesk.Forge.Model
{
    /// 
    /// VersionAttributes
    /// 
    [DataContract]
    public partial clast VersionAttributes :  IEquatable
    {
        /// 
        /// Initializes a new instance of the  clast.
        /// 
        [JsonConstructorAttribute]
        protected VersionAttributes() { }
        /// 
        /// Initializes a new instance of the  clast.
        /// 
        /// filename used when synced to local disk (required).
        /// displayable name of the version (required).
        /// version number of this version (required).
        /// mimetype of the version`s content.
        /// file type, only present if this version represents a file.
        /// file size in bytes, only present if this version represents a file.
        /// Extension (required).
        public VersionAttributes(string Name = null, string DisplayName = null, int? VersionNumber = null, string MimeType = null, string FileType = null, long? StorageSize = null, BaseAttributesExtensionObject Extension = null)
        {
            // to ensure "Name" is required (not null)
            if (Name == null)
            {
                throw new InvalidDataException("Name is a required property for VersionAttributes and cannot be null");
            }
            else
            {
                this.Name = Name;
            }
            // to ensure "DisplayName" is required (not null)
            if (DisplayName == null)
            {
                throw new InvalidDataException("DisplayName is a required property for VersionAttributes and cannot be null");
            }
            else
            {
                this.DisplayName = DisplayName;
            }
            // to ensure "VersionNumber" is required (not null)
            if (VersionNumber == null)
            {
                throw new InvalidDataException("VersionNumber is a required property for VersionAttributes and cannot be null");
            }
            else
            {
                this.VersionNumber = VersionNumber;
            }
            // to ensure "Extension" is required (not null)
            if (Extension == null)
            {
                throw new InvalidDataException("Extension is a required property for VersionAttributes and cannot be null");
            }
            else
            {
                this.Extension = Extension;
            }
            this.MimeType = MimeType;
            this.FileType = FileType;
            this.StorageSize = StorageSize;
        }
        
        /// 
        /// filename used when synced to local disk
        /// 
        /// filename used when synced to local disk
        [DataMember(Name="name", EmitDefaultValue=false)]
        public string Name { get; set; }
        /// 
        /// displayable name of the version
        /// 
        /// displayable name of the version
        [DataMember(Name="displayName", EmitDefaultValue=false)]
        public string DisplayName { get; set; }
        /// 
        /// version number of this version
        /// 
        /// version number of this version
        [DataMember(Name="versionNumber", EmitDefaultValue=false)]
        public int? VersionNumber { get; set; }
        /// 
        /// mimetype of the version`s content
        /// 
        /// mimetype of the version`s content
        [DataMember(Name="mimeType", EmitDefaultValue=false)]
        public string MimeType { get; set; }
        /// 
        /// file type, only present if this version represents a file
        /// 
        /// file type, only present if this version represents a file
        [DataMember(Name="fileType", EmitDefaultValue=false)]
        public string FileType { get; set; }
        /// 
        /// file size in bytes, only present if this version represents a file
        /// 
        /// file size in bytes, only present if this version represents a file
        [DataMember(Name="storageSize", EmitDefaultValue=false)]
        public long? StorageSize { get; set; }
        /// 
        /// Gets or Sets Extension
        /// 
        [DataMember(Name="extension", EmitDefaultValue=false)]
        public BaseAttributesExtensionObject Extension { get; set; }
        /// 
        /// Returns the string presentation of the object
        /// 
        /// String presentation of the object
        public override string ToString()
        {
            var sb = new StringBuilder();
            sb.Append("clast VersionAttributes {\n");
            sb.Append("  Name: ").Append(Name).Append("\n");
            sb.Append("  DisplayName: ").Append(DisplayName).Append("\n");
            sb.Append("  VersionNumber: ").Append(VersionNumber).Append("\n");
            sb.Append("  MimeType: ").Append(MimeType).Append("\n");
            sb.Append("  FileType: ").Append(FileType).Append("\n");
            sb.Append("  StorageSize: ").Append(StorageSize).Append("\n");
            sb.Append("  Extension: ").Append(Extension).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }
  
        /// 
        /// Returns the JSON string presentation of the object
        /// 
        /// JSON string presentation of the object
        public string ToJson()
        {
            return JsonConvert.SerializeObject(this, Formatting.Indented);
        }

        /// 
        /// Returns true if objects are equal
        /// 
        /// Object to be compared
        /// Boolean
        public override bool Equals(object obj)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            return this.Equals(obj as VersionAttributes);
        }

        /// 
        /// Returns true if VersionAttributes instances are equal
        /// 
        /// Instance of VersionAttributes to be compared
        /// Boolean
        public bool Equals(VersionAttributes other)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            if (other == null)
                return false;

            return 
                (
                    this.Name == other.Name ||
                    this.Name != null &&
                    this.Name.Equals(other.Name)
                ) && 
                (
                    this.DisplayName == other.DisplayName ||
                    this.DisplayName != null &&
                    this.DisplayName.Equals(other.DisplayName)
                ) && 
                (
                    this.VersionNumber == other.VersionNumber ||
                    this.VersionNumber != null &&
                    this.VersionNumber.Equals(other.VersionNumber)
                ) && 
                (
                    this.MimeType == other.MimeType ||
                    this.MimeType != null &&
                    this.MimeType.Equals(other.MimeType)
                ) && 
                (
                    this.FileType == other.FileType ||
                    this.FileType != null &&
                    this.FileType.Equals(other.FileType)
                ) && 
                (
                    this.StorageSize == other.StorageSize ||
                    this.StorageSize != null &&
                    this.StorageSize.Equals(other.StorageSize)
                ) && 
                (
                    this.Extension == other.Extension ||
                    this.Extension != null &&
                    this.Extension.Equals(other.Extension)
                );
        }

        /// 
        /// Gets the hash code
        /// 
        /// Hash code
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                int hash = 41;
                // Suitable nullity checks etc, of course :)
                if (this.Name != null)
                    hash = hash * 59 + this.Name.GetHashCode();
                if (this.DisplayName != null)
                    hash = hash * 59 + this.DisplayName.GetHashCode();
                if (this.VersionNumber != null)
                    hash = hash * 59 + this.VersionNumber.GetHashCode();
                if (this.MimeType != null)
                    hash = hash * 59 + this.MimeType.GetHashCode();
                if (this.FileType != null)
                    hash = hash * 59 + this.FileType.GetHashCode();
                if (this.StorageSize != null)
                    hash = hash * 59 + this.StorageSize.GetHashCode();
                if (this.Extension != null)
                    hash = hash * 59 + this.Extension.GetHashCode();
                return hash;
            }
        }
    }

}