Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
ResourceDto.cs 17.29 KiB
/*
 * Coscine Web API (Internal Use Only)
 *
 * Coscine (short for <b>CO</b>llaborative <b>SC</b>ientific <b>IN</b>tegration <b>E</b>nvironment) is the research data management platform for your research project.
 *
 * The version of the OpenAPI document: 2.0
 * Contact: servicedesk@itc.rwth-aachen.de
 * Generated by: https://github.com/openapitools/openapi-generator.git
 */


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Coscine.ApiClient.Core.Client.OpenAPIDateConverter;

namespace Coscine.ApiClient.Core.Model
{
    /// <summary>
    /// Represents a Data Transfer Object (DTO) for resource details.
    /// </summary>
    [DataContract(Name = "ResourceDto")]
    public partial class ResourceDto : IEquatable<ResourceDto>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ResourceDto" /> class.
        /// </summary>
        /// <param name="id">Unique identifier for the resource..</param>
        /// <param name="pid">Persistent identifier for the resource..</param>
        /// <param name="type">type.</param>
        /// <param name="name">Name of the resource..</param>
        /// <param name="displayName">Display name of the resource..</param>
        /// <param name="description">Description of the resource..</param>
        /// <param name="keywords">Keywords associated with the resource..</param>
        /// <param name="license">license.</param>
        /// <param name="usageRights">Usage rights associated with the resource..</param>
        /// <param name="applicationProfile">applicationProfile.</param>
        /// <param name="fixedValues">Fixed values associated with resource manipulation.  This dictionary may contain multiple levels and is structured as follows:  Dictionary (Key: string) -&gt; Dictionary (Key: string) -&gt; List of FixedValueForResourceManipulationDto..</param>
        /// <param name="disciplines">Disciplines associated with the resource..</param>
        /// <param name="visibility">visibility.</param>
        /// <param name="dateCreated">Date when the resource was created..</param>
        /// <param name="creator">creator.</param>
        /// <param name="archived">Indicates whether the resource is archived..</param>
        public ResourceDto(Guid id = default(Guid), string pid = default(string), ResourceTypeDto type = default(ResourceTypeDto), string name = default(string), string displayName = default(string), string description = default(string), List<string> keywords = default(List<string>), LicenseDto license = default(LicenseDto), string usageRights = default(string), ApplicationProfileMinimalDto applicationProfile = default(ApplicationProfileMinimalDto), Dictionary<string, Dictionary<string, List<FixedValueForResourceManipulationDto>>> fixedValues = default(Dictionary<string, Dictionary<string, List<FixedValueForResourceManipulationDto>>>), List<DisciplineDto> disciplines = default(List<DisciplineDto>), VisibilityDto visibility = default(VisibilityDto), DateTime? dateCreated = default(DateTime?), UserMinimalDto creator = default(UserMinimalDto), bool archived = default(bool))
        {
            this.Id = id;
            this.Pid = pid;
            this.Type = type;
            this.Name = name;
            this.DisplayName = displayName;
            this.Description = description;
            this.Keywords = keywords;
            this.License = license;
            this.UsageRights = usageRights;
            this.ApplicationProfile = applicationProfile;
            this.FixedValues = fixedValues;
            this.Disciplines = disciplines;
            this.Visibility = visibility;
            this.DateCreated = dateCreated;
            this.Creator = creator;
            this.Archived = archived;
        }

        /// <summary>
        /// Unique identifier for the resource.
        /// </summary>
        /// <value>Unique identifier for the resource.</value>
        [DataMember(Name = "id", EmitDefaultValue = false)]
        public Guid Id { get; set; }

        /// <summary>
        /// Persistent identifier for the resource.
        /// </summary>
        /// <value>Persistent identifier for the resource.</value>
        [DataMember(Name = "pid", EmitDefaultValue = false)]
        public string Pid { get; set; }

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

        /// <summary>
        /// Name of the resource.
        /// </summary>
        /// <value>Name of the resource.</value>
        [DataMember(Name = "name", EmitDefaultValue = false)]
        public string Name { get; set; }

        /// <summary>
        /// Display name of the resource.
        /// </summary>
        /// <value>Display name of the resource.</value>
        [DataMember(Name = "displayName", EmitDefaultValue = false)]
        public string DisplayName { get; set; }

        /// <summary>
        /// Description of the resource.
        /// </summary>
        /// <value>Description of the resource.</value>
        [DataMember(Name = "description", EmitDefaultValue = false)]
        public string Description { get; set; }

        /// <summary>
        /// Keywords associated with the resource.
        /// </summary>
        /// <value>Keywords associated with the resource.</value>
        [DataMember(Name = "keywords", EmitDefaultValue = true)]
        public List<string> Keywords { get; set; }

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

        /// <summary>
        /// Usage rights associated with the resource.
        /// </summary>
        /// <value>Usage rights associated with the resource.</value>
        [DataMember(Name = "usageRights", EmitDefaultValue = true)]
        public string UsageRights { get; set; }

        /// <summary>
        /// Gets or Sets ApplicationProfile
        /// </summary>
        [DataMember(Name = "applicationProfile", EmitDefaultValue = false)]
        public ApplicationProfileMinimalDto ApplicationProfile { get; set; }
        /// <summary>
        /// Fixed values associated with resource manipulation.  This dictionary may contain multiple levels and is structured as follows:  Dictionary (Key: string) -&gt; Dictionary (Key: string) -&gt; List of FixedValueForResourceManipulationDto.
        /// </summary>
        /// <value>Fixed values associated with resource manipulation.  This dictionary may contain multiple levels and is structured as follows:  Dictionary (Key: string) -&gt; Dictionary (Key: string) -&gt; List of FixedValueForResourceManipulationDto.</value>
        [DataMember(Name = "fixedValues", EmitDefaultValue = false)]
        public Dictionary<string, Dictionary<string, List<FixedValueForResourceManipulationDto>>> FixedValues { get; set; }

        /// <summary>
        /// Disciplines associated with the resource.
        /// </summary>
        /// <value>Disciplines associated with the resource.</value>
        [DataMember(Name = "disciplines", EmitDefaultValue = false)]
        public List<DisciplineDto> Disciplines { get; set; }

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

        /// <summary>
        /// Date when the resource was created.
        /// </summary>
        /// <value>Date when the resource was created.</value>
        [DataMember(Name = "dateCreated", EmitDefaultValue = true)]
        public DateTime? DateCreated { get; set; }

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

        /// <summary>
        /// Indicates whether the resource is archived.
        /// </summary>
        /// <value>Indicates whether the resource is archived.</value>
        [DataMember(Name = "archived", EmitDefaultValue = true)]
        public bool Archived { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("class ResourceDto {\n");
            sb.Append("  Id: ").Append(Id).Append("\n");
            sb.Append("  Pid: ").Append(Pid).Append("\n");
            sb.Append("  Type: ").Append(Type).Append("\n");
            sb.Append("  Name: ").Append(Name).Append("\n");
            sb.Append("  DisplayName: ").Append(DisplayName).Append("\n");
            sb.Append("  Description: ").Append(Description).Append("\n");
            sb.Append("  Keywords: ").Append(Keywords).Append("\n");
            sb.Append("  License: ").Append(License).Append("\n");
            sb.Append("  UsageRights: ").Append(UsageRights).Append("\n");
            sb.Append("  ApplicationProfile: ").Append(ApplicationProfile).Append("\n");
            sb.Append("  FixedValues: ").Append(FixedValues).Append("\n");
            sb.Append("  Disciplines: ").Append(Disciplines).Append("\n");
            sb.Append("  Visibility: ").Append(Visibility).Append("\n");
            sb.Append("  DateCreated: ").Append(DateCreated).Append("\n");
            sb.Append("  Creator: ").Append(Creator).Append("\n");
            sb.Append("  Archived: ").Append(Archived).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.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 ResourceDto);
        }

        /// <summary>
        /// Returns true if ResourceDto instances are equal
        /// </summary>
        /// <param name="input">Instance of ResourceDto to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ResourceDto input)
        {
            if (input == null)
            {
                return false;
            }
            return 
                (
                    this.Id == input.Id ||
                    (this.Id != null &&
                    this.Id.Equals(input.Id))
                ) && 
                (
                    this.Pid == input.Pid ||
                    (this.Pid != null &&
                    this.Pid.Equals(input.Pid))
                ) && 
                (
                    this.Type == input.Type ||
                    (this.Type != null &&
                    this.Type.Equals(input.Type))
                ) && 
                (
                    this.Name == input.Name ||
                    (this.Name != null &&
                    this.Name.Equals(input.Name))
                ) && 
                (
                    this.DisplayName == input.DisplayName ||
                    (this.DisplayName != null &&
                    this.DisplayName.Equals(input.DisplayName))
                ) && 
                (
                    this.Description == input.Description ||
                    (this.Description != null &&
                    this.Description.Equals(input.Description))
                ) && 
                (
                    this.Keywords == input.Keywords ||
                    this.Keywords != null &&
                    input.Keywords != null &&
                    this.Keywords.SequenceEqual(input.Keywords)
                ) && 
                (
                    this.License == input.License ||
                    (this.License != null &&
                    this.License.Equals(input.License))
                ) && 
                (
                    this.UsageRights == input.UsageRights ||
                    (this.UsageRights != null &&
                    this.UsageRights.Equals(input.UsageRights))
                ) && 
                (
                    this.ApplicationProfile == input.ApplicationProfile ||
                    (this.ApplicationProfile != null &&
                    this.ApplicationProfile.Equals(input.ApplicationProfile))
                ) && 
                (
                    this.FixedValues == input.FixedValues ||
                    this.FixedValues != null &&
                    input.FixedValues != null &&
                    this.FixedValues.SequenceEqual(input.FixedValues)
                ) && 
                (
                    this.Disciplines == input.Disciplines ||
                    this.Disciplines != null &&
                    input.Disciplines != null &&
                    this.Disciplines.SequenceEqual(input.Disciplines)
                ) && 
                (
                    this.Visibility == input.Visibility ||
                    (this.Visibility != null &&
                    this.Visibility.Equals(input.Visibility))
                ) && 
                (
                    this.DateCreated == input.DateCreated ||
                    (this.DateCreated != null &&
                    this.DateCreated.Equals(input.DateCreated))
                ) && 
                (
                    this.Creator == input.Creator ||
                    (this.Creator != null &&
                    this.Creator.Equals(input.Creator))
                ) && 
                (
                    this.Archived == input.Archived ||
                    this.Archived.Equals(input.Archived)
                );
        }

        /// <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.Id != null)
                {
                    hashCode = (hashCode * 59) + this.Id.GetHashCode();
                }
                if (this.Pid != null)
                {
                    hashCode = (hashCode * 59) + this.Pid.GetHashCode();
                }
                if (this.Type != null)
                {
                    hashCode = (hashCode * 59) + this.Type.GetHashCode();
                }
                if (this.Name != null)
                {
                    hashCode = (hashCode * 59) + this.Name.GetHashCode();
                }
                if (this.DisplayName != null)
                {
                    hashCode = (hashCode * 59) + this.DisplayName.GetHashCode();
                }
                if (this.Description != null)
                {
                    hashCode = (hashCode * 59) + this.Description.GetHashCode();
                }
                if (this.Keywords != null)
                {
                    hashCode = (hashCode * 59) + this.Keywords.GetHashCode();
                }
                if (this.License != null)
                {
                    hashCode = (hashCode * 59) + this.License.GetHashCode();
                }
                if (this.UsageRights != null)
                {
                    hashCode = (hashCode * 59) + this.UsageRights.GetHashCode();
                }
                if (this.ApplicationProfile != null)
                {
                    hashCode = (hashCode * 59) + this.ApplicationProfile.GetHashCode();
                }
                if (this.FixedValues != null)
                {
                    hashCode = (hashCode * 59) + this.FixedValues.GetHashCode();
                }
                if (this.Disciplines != null)
                {
                    hashCode = (hashCode * 59) + this.Disciplines.GetHashCode();
                }
                if (this.Visibility != null)
                {
                    hashCode = (hashCode * 59) + this.Visibility.GetHashCode();
                }
                if (this.DateCreated != null)
                {
                    hashCode = (hashCode * 59) + this.DateCreated.GetHashCode();
                }
                if (this.Creator != null)
                {
                    hashCode = (hashCode * 59) + this.Creator.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.Archived.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;
        }
    }

}