/* 
 * 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: forge.help@autodesk.com
 * 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
{
    /// <summary>
    /// Advanced options for &#x60;iges&#x60; type.
    /// </summary>
    [DataContract]
    public partial class JobIgesOutputPayloadAdvanced :  IEquatable<JobIgesOutputPayloadAdvanced>, IJobPayloadItemAdvanced
    {
        /// <summary>
        /// Possible values are `bounded`, `trimmed` and `wireframe`. By default it is set to bounded surface.
        /// </summary>
        /// <value>Possible values are `bounded`, `trimmed` and `wireframe`. By default it is set to bounded surface.</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum SurfaceTypeEnum
        {
            
            /// <summary>
            /// Enum Bounded for "bounded"
            /// </summary>
            [EnumMember(Value = "bounded")]
            Bounded,
            
            /// <summary>
            /// Enum Trimmed for "trimmed"
            /// </summary>
            [EnumMember(Value = "trimmed")]
            Trimmed,
            
            /// <summary>
            /// Enum Wireframe for "wireframe"
            /// </summary>
            [EnumMember(Value = "wireframe")]
            Wireframe
        }

        /// <summary>
        /// Export the sheet body to IGES. `open`, `shell`, `surface` or `wireframe`. By default, it is set to `surface`.
        /// </summary>
        /// <value>Export the sheet body to IGES. `open`, `shell`, `surface` or `wireframe`. By default, it is set to `surface`.</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum SheetTypeEnum
        {
            
            /// <summary>
            /// Enum Open for "open"
            /// </summary>
            [EnumMember(Value = "open")]
            Open,
            
            /// <summary>
            /// Enum Surface for "surface"
            /// </summary>
            [EnumMember(Value = "surface")]
            Surface,
            
            /// <summary>
            /// Enum Shell for "shell"
            /// </summary>
            [EnumMember(Value = "shell")]
            Shell,
            
            /// <summary>
            /// Enum Wireframe for "wireframe"
            /// </summary>
            [EnumMember(Value = "wireframe")]
            Wireframe
        }

        /// <summary>
        /// Export the solid body to IGES `solid`, `surface` or `wireframe`. By default, it is set to `solid`.
        /// </summary>
        /// <value>Export the solid body to IGES `solid`, `surface` or `wireframe`. By default, it is set to `solid`.</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum SolidTypeEnum
        {
            
            /// <summary>
            /// Enum Solid for "solid"
            /// </summary>
            [EnumMember(Value = "solid")]
            Solid,
            
            /// <summary>
            /// Enum Surface for "surface"
            /// </summary>
            [EnumMember(Value = "surface")]
            Surface,
            
            /// <summary>
            /// Enum Wireframe for "wireframe"
            /// </summary>
            [EnumMember(Value = "wireframe")]
            Wireframe
        }

        /// <summary>
        /// Possible values are `bounded`, `trimmed` and `wireframe`. By default it is set to bounded surface.
        /// </summary>
        /// <value>Possible values are `bounded`, `trimmed` and `wireframe`. By default it is set to bounded surface.</value>
        [DataMember(Name="surfaceType", EmitDefaultValue=false)]
        public SurfaceTypeEnum? SurfaceType { get; set; }

        /// <summary>
        /// Export the sheet body to IGES. `open`, `shell`, `surface` or `wireframe`. By default, it is set to `surface`.
        /// </summary>
        /// <value>Export the sheet body to IGES. `open`, `shell`, `surface` or `wireframe`. By default, it is set to `surface`.</value>
        [DataMember(Name="sheetType", EmitDefaultValue=false)]
        public SheetTypeEnum? SheetType { get; set; }

        /// <summary>
        /// Export the solid body to IGES `solid`, `surface` or `wireframe`. By default, it is set to `solid`.
        /// </summary>
        /// <value>Export the solid body to IGES `solid`, `surface` or `wireframe`. By default, it is set to `solid`.</value>
        [DataMember(Name="solidType", EmitDefaultValue=false)]
        public SolidTypeEnum? SolidType { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="JobIgesOutputPayloadAdvanced" /> class.
        /// </summary>
        /// <param name="Tolerance">Possible values are between &#x60;0&#x60; and &#x60;1&#x60;. By default it is set at 0.001. (default to 0.001F).</param>
        /// <param name="SurfaceType">Possible values are &#x60;bounded&#x60;, &#x60;trimmed&#x60; and &#x60;wireframe&#x60;. By default it is set to bounded surface. (default to &quot;bounded&quot;).</param>
        /// <param name="SheetType">Export the sheet body to IGES. &#x60;open&#x60;, &#x60;shell&#x60;, &#x60;surface&#x60; or &#x60;wireframe&#x60;. By default, it is set to &#x60;surface&#x60;. (default to &quot;surface&quot;).</param>
        /// <param name="SolidType">Export the solid body to IGES &#x60;solid&#x60;, &#x60;surface&#x60; or &#x60;wireframe&#x60;. By default, it is set to &#x60;solid&#x60;. (default to &quot;solid&quot;).</param>
        public JobIgesOutputPayloadAdvanced(float? Tolerance = null, SurfaceTypeEnum? SurfaceType = null, SheetTypeEnum? SheetType = null, SolidTypeEnum? SolidType = null)
        {
            // use default value if no "Tolerance" provided
            if (Tolerance == null)
            {
                this.Tolerance = 0.001F;
            }
            else
            {
                this.Tolerance = Tolerance;
            }
            // use default value if no "SurfaceType" provided
            if (SurfaceType == null)
            {
                this.SurfaceType = (SurfaceTypeEnum)Enum.Parse(typeof(SurfaceTypeEnum), "bounded", true);
            }
            else
            {
                this.SurfaceType = SurfaceType;
            }
            // use default value if no "SheetType" provided
            if (SheetType == null)
            {
                this.SheetType = (SheetTypeEnum)Enum.Parse(typeof(SheetTypeEnum), "surface", true);
            }
            else
            {
                this.SheetType = SheetType;
            }
            // use default value if no "SolidType" provided
            if (SolidType == null)
            {
                this.SolidType = (SolidTypeEnum)Enum.Parse(typeof(SolidTypeEnum), "solid", true);
            }
            else
            {
                this.SolidType = SolidType;
            }
        }
        
        /// <summary>
        /// Possible values are between &#x60;0&#x60; and &#x60;1&#x60;. By default it is set at 0.001.
        /// </summary>
        /// <value>Possible values are between &#x60;0&#x60; and &#x60;1&#x60;. By default it is set at 0.001.</value>
        [DataMember(Name="tolerance", EmitDefaultValue=false)]
        public float? Tolerance { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            var sb = new StringBuilder();
            sb.Append("class JobIgesOutputPayloadAdvanced {\n");
            sb.Append("  Tolerance: ").Append(Tolerance).Append("\n");
            sb.Append("  SurfaceType: ").Append(SurfaceType).Append("\n");
            sb.Append("  SheetType: ").Append(SheetType).Append("\n");
            sb.Append("  SolidType: ").Append(SolidType).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }
  
        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public string ToJson()
        {
            return JsonConvert.SerializeObject(this, Formatting.Indented);
        }

        /// <summary>
        /// Returns true if objects are equal
        /// </summary>
        /// <param name="obj">Object to be compared</param>
        /// <returns>Boolean</returns>
        public override bool Equals(object obj)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            return this.Equals(obj as JobIgesOutputPayloadAdvanced);
        }

        /// <summary>
        /// Returns true if JobIgesOutputPayloadAdvanced instances are equal
        /// </summary>
        /// <param name="other">Instance of JobIgesOutputPayloadAdvanced to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(JobIgesOutputPayloadAdvanced other)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            if (other == null)
                return false;

            return 
                (
                    this.Tolerance == other.Tolerance ||
                    this.Tolerance != null &&
                    this.Tolerance.Equals(other.Tolerance)
                ) && 
                (
                    this.SurfaceType == other.SurfaceType ||
                    this.SurfaceType != null &&
                    this.SurfaceType.Equals(other.SurfaceType)
                ) && 
                (
                    this.SheetType == other.SheetType ||
                    this.SheetType != null &&
                    this.SheetType.Equals(other.SheetType)
                ) && 
                (
                    this.SolidType == other.SolidType ||
                    this.SolidType != null &&
                    this.SolidType.Equals(other.SolidType)
                );
        }

        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        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.Tolerance != null)
                    hash = hash * 59 + this.Tolerance.GetHashCode();
                if (this.SurfaceType != null)
                    hash = hash * 59 + this.SurfaceType.GetHashCode();
                if (this.SheetType != null)
                    hash = hash * 59 + this.SheetType.GetHashCode();
                if (this.SolidType != null)
                    hash = hash * 59 + this.SolidType.GetHashCode();
                return hash;
            }
        }
    }

}

