Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PackageVersion" /> class.
        /// </summary>
        /// <param name="name">Package name. Make it descriptive and helpful ;) (required).</param>
        /// <param name="tag">The tag of the package (required).</param>
        /// <param name="url">url (required).</param>
        /// <param name="created">created (required).</param>
        /// <param name="digest">digest (required).</param>
        /// <param name="annotations">An optional dictionary to add annotations to inputs. These annotations will be used by the client side libraries..</param>
        /// <param name="appVersion">The version of the application code underlying the manifest.</param>
        /// <param name="keywords">A list of keywords to search the package by.</param>
        /// <param name="maintainers">A list of maintainers for the package.</param>
        /// <param name="home">The URL of this package&#39;s home page.</param>
        /// <param name="sources">A list of URLs to source code for this project.</param>
        /// <param name="icon">A URL to an SVG or PNG image to be used as an icon.</param>
        /// <param name="deprecated">Whether this package is deprecated.</param>
        /// <param name="description">A description of what this package does.</param>
        /// <param name="license">The license information..</param>
        /// <param name="slug">A slug of the repository name and the package name..</param>
        /// <param name="kind">The type of Queenbee package (ie: recipe or plugin) (default to &quot;&quot;).</param>
        /// <param name="readme">The README file string for this package.</param>
        /// <param name="manifest">The package Recipe or Plugin manifest.</param>
        public PackageVersion
        (
            string name, string tag, string url, DateTime created, string digest,                                                                                                                                                                                                                                                                                                                                                                     // Required parameters
            Dictionary <string, string> annotations = default, string appVersion = default, List <string> keywords = default, List <Maintainer> maintainers = default, string home = default, List <string> sources = default, string icon = default, bool deprecated = default, string description = default, License license = default, string slug = default, string kind = "", string readme = default, AnyOf <Recipe, Plugin> manifest = default // Optional parameters
        ) : base()                                                                                                                                                                                                                                                                                                                                                                                                                                    // BaseClass
        {
            // to ensure "name" is required (not null)
            this.Name = name ?? throw new ArgumentNullException("name is a required property for PackageVersion and cannot be null");
            // to ensure "tag" is required (not null)
            this.Tag = tag ?? throw new ArgumentNullException("tag is a required property for PackageVersion and cannot be null");
            // to ensure "url" is required (not null)
            this.Url     = url ?? throw new ArgumentNullException("url is a required property for PackageVersion and cannot be null");
            this.Created = created;
            // to ensure "digest" is required (not null)
            this.Digest      = digest ?? throw new ArgumentNullException("digest is a required property for PackageVersion and cannot be null");
            this.Annotations = annotations;
            this.AppVersion  = appVersion;
            this.Keywords    = keywords;
            this.Maintainers = maintainers;
            this.Home        = home;
            this.Sources     = sources;
            this.Icon        = icon;
            this.Deprecated  = deprecated;
            this.Description = description;
            this.License     = license;
            this.Slug        = slug;
            // use default value if no "kind" provided
            this.Kind     = kind ?? "";
            this.Readme   = readme;
            this.Manifest = manifest;

            // Set non-required readonly properties with defaultValue
            this.Type = "PackageVersion";
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MetaData" /> class.
        /// </summary>
        /// <param name="name">Package name. Make it descriptive and helpful ;) (required).</param>
        /// <param name="tag">The tag of the package (required).</param>
        /// <param name="annotations">An optional dictionary to add annotations to inputs. These annotations will be used by the client side libraries..</param>
        /// <param name="appVersion">The version of the application code underlying the manifest.</param>
        /// <param name="keywords">A list of keywords to search the package by.</param>
        /// <param name="maintainers">A list of maintainers for the package.</param>
        /// <param name="home">The URL of this package&#39;s home page.</param>
        /// <param name="sources">A list of URLs to source code for this project.</param>
        /// <param name="icon">A URL to an SVG or PNG image to be used as an icon.</param>
        /// <param name="deprecated">Whether this package is deprecated.</param>
        /// <param name="description">A description of what this package does.</param>
        /// <param name="license">The license information..</param>
        public MetaData
        (
            string name, string tag,                                                                                                                                                                                                                                                                                                     // Required parameters
            Dictionary <string, string> annotations = default, string appVersion = default, List <string> keywords = default, List <Maintainer> maintainers = default, string home = default, List <string> sources = default, string icon = default, bool deprecated = default, string description = default, License license = default // Optional parameters
        ) : base()                                                                                                                                                                                                                                                                                                                       // BaseClass
        {
            // to ensure "name" is required (not null)
            this.Name = name ?? throw new ArgumentNullException("name is a required property for MetaData and cannot be null");
            // to ensure "tag" is required (not null)
            this.Tag         = tag ?? throw new ArgumentNullException("tag is a required property for MetaData and cannot be null");
            this.Annotations = annotations;
            this.AppVersion  = appVersion;
            this.Keywords    = keywords;
            this.Maintainers = maintainers;
            this.Home        = home;
            this.Sources     = sources;
            this.Icon        = icon;
            this.Deprecated  = deprecated;
            this.Description = description;
            this.License     = license;

            // Set non-required readonly properties with defaultValue
            this.Type = "MetaData";
        }