csharp/Altinn/altinn-studio/src/studio/src/designer/backend/RepositoryClient/Model/Repository.cs

Repository.cs
/*
 * Gitea API.
 *
 * This docameentation describes the Gitea API.
 *
 * OpenAPI spec version: 1.1.1
 *
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 */

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using SwaggerDateConverter = Altinn.Studio.Designer.RepositoryClient.Client.SwaggerDateConverter;

namespace Altinn.Studio.Designer.RepositoryClient.Model
{
    /// 
    /// Repository represents a repository
    /// 
    [DataContract]
    public partial clast Repository : IEquatable, IValidatableObject
    {
        /// 
        /// Initializes a new instance of the  clast.
        /// 
        /// CloneUrl.
        /// CreatedAt.
        /// DefaultBranch.
        /// Description.
        /// Empty.
        /// Fork.
        /// ForksCount.
        /// FullName.
        /// HtmlUrl.
        /// Id.
        /// Mirror.
        /// Name.
        /// OastsuesCount.
        /// Owner.
        /// Parent.
        /// Permissions.
        /// _Private.
        /// Size.
        /// SshUrl.
        /// StarsCount.
        /// UpdatedAt.
        /// WatchersCount.
        /// Website.
        public Repository(string CloneUrl = default(string), DateTime? CreatedAt = default(DateTime?), string DefaultBranch = default(string), string Description = default(string), bool? Empty = default(bool?), bool? Fork = default(bool?), long? ForksCount = default(long?), string FullName = default(string), string HtmlUrl = default(string), long? Id = default(long?), bool? Mirror = default(bool?), string Name = default(string), long? OastsuesCount = default(long?), User Owner = default(User), Repository Parent = default(Repository), Permission Permissions = default(Permission), bool? _Private = default(bool?), long? Size = default(long?), string SshUrl = default(string), long? StarsCount = default(long?), DateTime? UpdatedAt = default(DateTime?), long? WatchersCount = default(long?), string Website = default(string))
        {
            this.CloneUrl = CloneUrl;
            this.CreatedAt = CreatedAt;
            this.DefaultBranch = DefaultBranch;
            this.Description = Description;
            this.Empty = Empty;
            this.Fork = Fork;
            this.ForksCount = ForksCount;
            this.FullName = FullName;
            this.HtmlUrl = HtmlUrl;
            this.Id = Id;
            this.Mirror = Mirror;
            this.Name = Name;
            this.OastsuesCount = OastsuesCount;
            this.Owner = Owner;
            this.Parent = Parent;
            this.Permissions = Permissions;
            this.IsPrivate = _Private;
            this.Size = Size;
            this.SshUrl = SshUrl;
            this.StarsCount = StarsCount;
            this.UpdatedAt = UpdatedAt;
            this.WatchersCount = WatchersCount;
            this.Website = Website;
        }

        /// 
        /// Gets or Sets CloneUrl
        /// 
        [JsonProperty("clone_url")]
        public string CloneUrl { get; set; }

        /// 
        /// Gets or Sets CreatedAt
        /// 
        [JsonProperty("created_at")]
        public DateTime? CreatedAt { get; set; }

        /// 
        /// Gets or Sets DefaultBranch
        /// 
        [JsonProperty("default_branch")]
        public string DefaultBranch { get; set; }

        /// 
        /// Gets or Sets Description
        /// 
        [JsonProperty("description")]
        public string Description { get; set; }

        /// 
        /// Gets or Sets Empty
        /// 
        [JsonProperty("empty")]
        public bool? Empty { get; set; }

        /// 
        /// Gets or Sets Fork
        /// 
        [JsonProperty("fork")]
        public bool? Fork { get; set; }

        /// 
        /// Gets or Sets ForksCount
        /// 
        [JsonProperty("forks_count")]
        public long? ForksCount { get; set; }

        /// 
        /// Gets or Sets FullName
        /// 
        [JsonProperty("full_name")]
        public string FullName { get; set; }

        /// 
        /// Gets or Sets HtmlUrl
        /// 
        [JsonProperty("html_url")]
        public string HtmlUrl { get; set; }

        /// 
        /// Gets or Sets Id
        /// 
        [JsonProperty("id")]
        public long? Id { get; set; }

        /// 
        /// Gets or Sets Mirror
        /// 
        [JsonProperty("mirror")]
        public bool? Mirror { get; set; }

        /// 
        /// Gets or Sets Name
        /// 
        [JsonProperty("name")]
        public string Name { get; set; }

        /// 
        /// Gets or Sets OastsuesCount
        /// 
        [JsonProperty("open_issues_count")]
        public long? OastsuesCount { get; set; }

        /// 
        /// Gets or Sets Owner
        /// 
        [JsonProperty("owner")]
        public User Owner { get; set; }

        /// 
        /// Gets or Sets Parent
        /// 
        [JsonProperty("parent")]
        public Repository Parent { get; set; }

        /// 
        /// Gets or Sets Permissions
        /// 
        [JsonProperty("permissions")]
        public Permission Permissions { get; set; }

        /// 
        /// Gets or Sets _Private
        /// 
        [JsonProperty("private")]
        public bool? IsPrivate { get; set; }

        /// 
        /// Gets or Sets Size
        /// 
        [JsonProperty("size")]
        public long? Size { get; set; }

        /// 
        /// Gets or Sets SshUrl
        /// 
        [JsonProperty("ssh_url")]
        public string SshUrl { get; set; }

        /// 
        /// Gets or Sets StarsCount
        /// 
        [JsonProperty("stars_count")]
        public long? StarsCount { get; set; }

        /// 
        /// Gets or Sets UpdatedAt
        /// 
        [JsonProperty("updated_at")]
        public DateTime? UpdatedAt { get; set; }

        /// 
        /// Gets or Sets WatchersCount
        /// 
        [JsonProperty("watchers_count")]
        public long? WatchersCount { get; set; }

        /// 
        /// Gets or Sets Website
        /// 
        [JsonProperty("website")]
        public string Website { get; set; }

        /// 
        /// Gets or sets whether the repository is cloned to local
        /// 
        [JsonProperty("is_cloned_to_local")]
        public bool IsClonedToLocal { get; set; }

        /// 
        /// Gets or sets the repository created status
        /// 
        [JsonProperty]
        public HttpStatusCode RepositoryCreatedStatus { 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 Repository {\n");
            sb.Append("  CloneUrl: ").Append(CloneUrl).Append("\n");
            sb.Append("  CreatedAt: ").Append(CreatedAt).Append("\n");
            sb.Append("  DefaultBranch: ").Append(DefaultBranch).Append("\n");
            sb.Append("  Description: ").Append(Description).Append("\n");
            sb.Append("  Empty: ").Append(Empty).Append("\n");
            sb.Append("  Fork: ").Append(Fork).Append("\n");
            sb.Append("  ForksCount: ").Append(ForksCount).Append("\n");
            sb.Append("  FullName: ").Append(FullName).Append("\n");
            sb.Append("  HtmlUrl: ").Append(HtmlUrl).Append("\n");
            sb.Append("  Id: ").Append(Id).Append("\n");
            sb.Append("  Mirror: ").Append(Mirror).Append("\n");
            sb.Append("  Name: ").Append(Name).Append("\n");
            sb.Append("  OastsuesCount: ").Append(OastsuesCount).Append("\n");
            sb.Append("  Owner: ").Append(Owner).Append("\n");
            sb.Append("  Parent: ").Append(Parent).Append("\n");
            sb.Append("  Permissions: ").Append(Permissions).Append("\n");
            sb.Append("  _Private: ").Append(IsPrivate).Append("\n");
            sb.Append("  Size: ").Append(Size).Append("\n");
            sb.Append("  SshUrl: ").Append(SshUrl).Append("\n");
            sb.Append("  StarsCount: ").Append(StarsCount).Append("\n");
            sb.Append("  UpdatedAt: ").Append(UpdatedAt).Append("\n");
            sb.Append("  WatchersCount: ").Append(WatchersCount).Append("\n");
            sb.Append("  Website: ").Append(Website).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 input)
        {
            return this.Equals(input as Repository);
        }

        /// 
        /// Returns true if Repository instances are equal
        /// 
        /// Instance of Repository to be compared
        /// Boolean
        public bool Equals(Repository input)
        {
            if (input == null)
            {
                return false;
            }

            return
                (
                    this.CloneUrl == input.CloneUrl ||
                    (this.CloneUrl != null &&
                    this.CloneUrl.Equals(input.CloneUrl))) &&
                (
                    this.CreatedAt == input.CreatedAt ||
                    (this.CreatedAt != null &&
                    this.CreatedAt.Equals(input.CreatedAt))) &&
                (
                    this.DefaultBranch == input.DefaultBranch ||
                    (this.DefaultBranch != null &&
                    this.DefaultBranch.Equals(input.DefaultBranch))) &&
                (
                    this.Description == input.Description ||
                    (this.Description != null &&
                    this.Description.Equals(input.Description))) &&
                (
                    this.Empty == input.Empty ||
                    (this.Empty != null &&
                    this.Empty.Equals(input.Empty))) &&
                (
                    this.Fork == input.Fork ||
                    (this.Fork != null &&
                    this.Fork.Equals(input.Fork))) &&
                (
                    this.ForksCount == input.ForksCount ||
                    (this.ForksCount != null &&
                    this.ForksCount.Equals(input.ForksCount))) &&
                (
                    this.FullName == input.FullName ||
                    (this.FullName != null &&
                    this.FullName.Equals(input.FullName))) &&
                (
                    this.HtmlUrl == input.HtmlUrl ||
                    (this.HtmlUrl != null &&
                    this.HtmlUrl.Equals(input.HtmlUrl))) &&
                (
                    this.Id == input.Id ||
                    (this.Id != null &&
                    this.Id.Equals(input.Id))) &&
                (
                    this.Mirror == input.Mirror ||
                    (this.Mirror != null &&
                    this.Mirror.Equals(input.Mirror))) &&
                (
                    this.Name == input.Name ||
                    (this.Name != null &&
                    this.Name.Equals(input.Name))) &&
                (
                    this.OastsuesCount == input.OastsuesCount ||
                    (this.OastsuesCount != null &&
                    this.OastsuesCount.Equals(input.OastsuesCount))) &&
                (
                    this.Owner == input.Owner ||
                    (this.Owner != null &&
                    this.Owner.Equals(input.Owner))) &&
                (
                    this.Parent == input.Parent ||
                    (this.Parent != null &&
                    this.Parent.Equals(input.Parent))) &&
                (
                    this.Permissions == input.Permissions ||
                    (this.Permissions != null &&
                    this.Permissions.Equals(input.Permissions))) &&
                (
                    this.IsPrivate == input.IsPrivate ||
                    (this.IsPrivate != null &&
                    this.IsPrivate.Equals(input.IsPrivate))) &&
                (
                    this.Size == input.Size ||
                    (this.Size != null &&
                    this.Size.Equals(input.Size))) &&
                (
                    this.SshUrl == input.SshUrl ||
                    (this.SshUrl != null &&
                    this.SshUrl.Equals(input.SshUrl))) &&
                (
                    this.StarsCount == input.StarsCount ||
                    (this.StarsCount != null &&
                    this.StarsCount.Equals(input.StarsCount))) &&
                (
                    this.UpdatedAt == input.UpdatedAt ||
                    (this.UpdatedAt != null &&
                    this.UpdatedAt.Equals(input.UpdatedAt))) &&
                (
                    this.WatchersCount == input.WatchersCount ||
                    (this.WatchersCount != null &&
                    this.WatchersCount.Equals(input.WatchersCount))) &&
                (
                    this.Website == input.Website ||
                    (this.Website != null &&
                    this.Website.Equals(input.Website)));
        }

        /// 
        /// Gets the hash code
        /// 
        /// Hash code
        public override int GetHashCode()
        {
            // Overflow is fine, just wrap
            unchecked
            {
                int hashCode = 41;
                if (this.CloneUrl != null)
                {
                    hashCode = (hashCode * 59) + this.CloneUrl.GetHashCode();
                }

                if (this.CreatedAt != null)
                {
                    hashCode = (hashCode * 59) + this.CreatedAt.GetHashCode();
                }

                if (this.DefaultBranch != null)
                {
                    hashCode = (hashCode * 59) + this.DefaultBranch.GetHashCode();
                }

                if (this.Description != null)
                {
                    hashCode = (hashCode * 59) + this.Description.GetHashCode();
                }

                if (this.Empty != null)
                {
                    hashCode = (hashCode * 59) + this.Empty.GetHashCode();
                }

                if (this.Fork != null)
                {
                    hashCode = (hashCode * 59) + this.Fork.GetHashCode();
                }

                if (this.ForksCount != null)
                {
                    hashCode = (hashCode * 59) + this.ForksCount.GetHashCode();
                }

                if (this.FullName != null)
                {
                    hashCode = (hashCode * 59) + this.FullName.GetHashCode();
                }

                if (this.HtmlUrl != null)
                {
                    hashCode = (hashCode * 59) + this.HtmlUrl.GetHashCode();
                }

                if (this.Id != null)
                {
                    hashCode = (hashCode * 59) + this.Id.GetHashCode();
                }

                if (this.Mirror != null)
                {
                    hashCode = (hashCode * 59) + this.Mirror.GetHashCode();
                }

                if (this.Name != null)
                {
                    hashCode = (hashCode * 59) + this.Name.GetHashCode();
                }

                if (this.OastsuesCount != null)
                {
                    hashCode = (hashCode * 59) + this.OastsuesCount.GetHashCode();
                }

                if (this.Owner != null)
                {
                    hashCode = (hashCode * 59) + this.Owner.GetHashCode();
                }

                if (this.Parent != null)
                {
                    hashCode = (hashCode * 59) + this.Parent.GetHashCode();
                }

                if (this.Permissions != null)
                {
                    hashCode = (hashCode * 59) + this.Permissions.GetHashCode();
                }

                if (this.IsPrivate != null)
                {
                    hashCode = (hashCode * 59) + this.IsPrivate.GetHashCode();
                }

                if (this.Size != null)
                {
                    hashCode = (hashCode * 59) + this.Size.GetHashCode();
                }

                if (this.SshUrl != null)
                {
                    hashCode = (hashCode * 59) + this.SshUrl.GetHashCode();
                }

                if (this.StarsCount != null)
                {
                    hashCode = (hashCode * 59) + this.StarsCount.GetHashCode();
                }

                if (this.UpdatedAt != null)
                {
                    hashCode = (hashCode * 59) + this.UpdatedAt.GetHashCode();
                }

                if (this.WatchersCount != null)
                {
                    hashCode = (hashCode * 59) + this.WatchersCount.GetHashCode();
                }

                if (this.Website != null)
                {
                    hashCode = (hashCode * 59) + this.Website.GetHashCode();
                }

                return hashCode;
            }
        }

        /// 
        /// To validate all properties of the instance
        /// 
        /// Validation context
        /// Validation Result
        IEnumerable IValidatableObject.Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }
}