/* 
 * TSE Cloud - CO
 *
 * This is Swagger Docs for Document WebApi Teamsystemn Enterprise Cloud, more detail at [https://swagger.io](https://swagger.io).
 *
 * OpenAPI spec version: v2025.3000
 * 
 * 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
{
    /// <summary>
    /// CG13_AGENZIE - Agenzia&lt;br&gt;Proprietà chiave:&lt;ul&gt;&lt;li&gt;&lt;b&gt;CodBanca&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Codice&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;
    /// </summary>
    [DataContract]
        public partial class AgencyCODTO :  IEquatable<AgencyCODTO>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="AgencyCODTO" /> class.
        /// </summary>
        /// <param name="codBanca">CG13_BANCA_CG12 - ABI-Banca (required).</param>
        /// <param name="codice">CG13_CODCAB - CAB agenzia (required).</param>
        /// <param name="descrizione">CG13_DESCR - Descrizione.</param>
        /// <param name="localita">CG13_LOCALITA - Localita.</param>
        /// <param name="prov">CG13_PROV - Prov.</param>
        /// <param name="bankCO">bankCO.</param>
        /// <param name="additionalData">additionalData.</param>
        /// <param name="pluginData">pluginData.</param>
        public AgencyCODTO(double? codBanca = default(double?), double? codice = default(double?), string descrizione = default(string), string localita = default(string), string prov = default(string), BankCODTO bankCO = default(BankCODTO), Dictionary<string, Object> additionalData = default(Dictionary<string, Object>), Dictionary<string, Object> pluginData = default(Dictionary<string, Object>))
        {
            // to ensure "codBanca" is required (not null)
            if (codBanca == null)
            {
                throw new InvalidDataException("codBanca is a required property for AgencyCODTO and cannot be null");
            }
            else
            {
                this.CodBanca = codBanca;
            }
            // to ensure "codice" is required (not null)
            if (codice == null)
            {
                throw new InvalidDataException("codice is a required property for AgencyCODTO and cannot be null");
            }
            else
            {
                this.Codice = codice;
            }
            this.Descrizione = descrizione;
            this.Localita = localita;
            this.Prov = prov;
            this.BankCO = bankCO;
            this.AdditionalData = additionalData;
            this.PluginData = pluginData;
        }
        
        /// <summary>
        /// CG13_BANCA_CG12 - ABI-Banca
        /// </summary>
        /// <value>CG13_BANCA_CG12 - ABI-Banca</value>
        [DataMember(Name="codBanca", EmitDefaultValue=false)]
        public double? CodBanca { get; set; }

        /// <summary>
        /// CG13_CODCAB - CAB agenzia
        /// </summary>
        /// <value>CG13_CODCAB - CAB agenzia</value>
        [DataMember(Name="codice", EmitDefaultValue=false)]
        public double? Codice { get; set; }

        /// <summary>
        /// CG13_DESCR - Descrizione
        /// </summary>
        /// <value>CG13_DESCR - Descrizione</value>
        [DataMember(Name="descrizione", EmitDefaultValue=false)]
        public string Descrizione { get; set; }

        /// <summary>
        /// CG13_LOCALITA - Localita
        /// </summary>
        /// <value>CG13_LOCALITA - Localita</value>
        [DataMember(Name="localita", EmitDefaultValue=false)]
        public string Localita { get; set; }

        /// <summary>
        /// CG13_PROV - Prov
        /// </summary>
        /// <value>CG13_PROV - Prov</value>
        [DataMember(Name="prov", EmitDefaultValue=false)]
        public string Prov { get; set; }

        /// <summary>
        /// Gets or Sets BankCO
        /// </summary>
        [DataMember(Name="bankCO", EmitDefaultValue=false)]
        public BankCODTO BankCO { get; set; }

        /// <summary>
        /// Gets or Sets AdditionalData
        /// </summary>
        [DataMember(Name="additionalData", EmitDefaultValue=false)]
        public Dictionary<string, Object> AdditionalData { get; set; }

        /// <summary>
        /// Gets or Sets PluginData
        /// </summary>
        [DataMember(Name="pluginData", EmitDefaultValue=false)]
        public Dictionary<string, Object> PluginData { 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 AgencyCODTO {\n");
            sb.Append("  CodBanca: ").Append(CodBanca).Append("\n");
            sb.Append("  Codice: ").Append(Codice).Append("\n");
            sb.Append("  Descrizione: ").Append(Descrizione).Append("\n");
            sb.Append("  Localita: ").Append(Localita).Append("\n");
            sb.Append("  Prov: ").Append(Prov).Append("\n");
            sb.Append("  BankCO: ").Append(BankCO).Append("\n");
            sb.Append("  AdditionalData: ").Append(AdditionalData).Append("\n");
            sb.Append("  PluginData: ").Append(PluginData).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 virtual string ToJson()
        {
            return JsonConvert.SerializeObject(this, Formatting.Indented);
        }

        /// <summary>
        /// Returns true if objects are equal
        /// </summary>
        /// <param name="input">Object to be compared</param>
        /// <returns>Boolean</returns>
        public override bool Equals(object input)
        {
            return this.Equals(input as AgencyCODTO);
        }

        /// <summary>
        /// Returns true if AgencyCODTO instances are equal
        /// </summary>
        /// <param name="input">Instance of AgencyCODTO to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(AgencyCODTO input)
        {
            if (input == null)
                return false;

            return 
                (
                    this.CodBanca == input.CodBanca ||
                    (this.CodBanca != null &&
                    this.CodBanca.Equals(input.CodBanca))
                ) && 
                (
                    this.Codice == input.Codice ||
                    (this.Codice != null &&
                    this.Codice.Equals(input.Codice))
                ) && 
                (
                    this.Descrizione == input.Descrizione ||
                    (this.Descrizione != null &&
                    this.Descrizione.Equals(input.Descrizione))
                ) && 
                (
                    this.Localita == input.Localita ||
                    (this.Localita != null &&
                    this.Localita.Equals(input.Localita))
                ) && 
                (
                    this.Prov == input.Prov ||
                    (this.Prov != null &&
                    this.Prov.Equals(input.Prov))
                ) && 
                (
                    this.BankCO == input.BankCO ||
                    (this.BankCO != null &&
                    this.BankCO.Equals(input.BankCO))
                ) && 
                (
                    this.AdditionalData == input.AdditionalData ||
                    this.AdditionalData != null &&
                    input.AdditionalData != null &&
                    this.AdditionalData.SequenceEqual(input.AdditionalData)
                ) && 
                (
                    this.PluginData == input.PluginData ||
                    this.PluginData != null &&
                    input.PluginData != null &&
                    this.PluginData.SequenceEqual(input.PluginData)
                );
        }

        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.CodBanca != null)
                    hashCode = hashCode * 59 + this.CodBanca.GetHashCode();
                if (this.Codice != null)
                    hashCode = hashCode * 59 + this.Codice.GetHashCode();
                if (this.Descrizione != null)
                    hashCode = hashCode * 59 + this.Descrizione.GetHashCode();
                if (this.Localita != null)
                    hashCode = hashCode * 59 + this.Localita.GetHashCode();
                if (this.Prov != null)
                    hashCode = hashCode * 59 + this.Prov.GetHashCode();
                if (this.BankCO != null)
                    hashCode = hashCode * 59 + this.BankCO.GetHashCode();
                if (this.AdditionalData != null)
                    hashCode = hashCode * 59 + this.AdditionalData.GetHashCode();
                if (this.PluginData != null)
                    hashCode = hashCode * 59 + this.PluginData.GetHashCode();
                return hashCode;
            }
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }
}
