/* ========================================================================
* Copyright (c) 2005-2021 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* The complete license agreement can be found here:
* http://opcfoundation.org/License/MIT/1.00/
* ======================================================================*/
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Opc.Ua.Cloud.Client.Models
{
///
/// Lic info
///
public enum License
{
///
/// MIT License
///
MIT,
///
/// Apache License 2.0
///
ApacheLicense20,
///
/// Custom License
///
Custom
}
///
/// Namespace metadata for a UA Information Model
///
public class UANameSpaceMetadata
{
/// Gets or sets the title.
/// The title.
[JsonRequired]
[JsonProperty("title")]
public string Title { get; set; }
/// Gets or sets the license.
/// The license.
[JsonProperty("license")]
public string License { get; set; }
/// Gets or sets the copyright text.
/// The copyright text.
[JsonRequired]
[JsonProperty("copyrightText")]
public string CopyrightText { get; set; }
/// Gets or sets the description.
/// The description.
[JsonRequired]
[JsonProperty("description")]
public string Description { get; set; }
///
/// Link to additional documentation, specifications, GitHub, etc.
/// For example, If the address space is based on a standard or official UA Information Model, this links to the standard or the OPC specification URL.
///
[JsonProperty("documentationUrl")]
public Uri DocumentationUrl { get; set; }
/// Gets or sets the icon URL.
/// The icon URL.
[JsonProperty("iconUrl")]
public Uri IconUrl { get; set; }
/// Gets or sets the license URL.
/// The license URL.
[JsonProperty("licenseUrl")]
public Uri LicenseUrl { get; set; }
/// Gets or sets the key words.
/// The key words.
[JsonProperty("keywords")]
public string[] Keywords { get; set; }
/// Gets or sets the purchasing information URL.
/// The purchasing information URL.
[JsonProperty("purchasingInformationUrl")]
public Uri PurchasingInformationUrl { get; set; }
/// Gets or sets the release notes URL.
/// The release notes URL.
[JsonProperty("releaseNotesUrl")]
public Uri ReleaseNotesUrl { get; set; }
/// Gets or sets the release notes URL.
/// The release notes URL.
[JsonProperty("testSpecificationUrl")]
public Uri TestSpecificationUrl { get; set; }
///
/// Supported ISO language codes
///
[JsonProperty("supportedLocales")]
public string[] SupportedLocales { get; set; }
///
/// Default constructor
///
public UANameSpaceMetadata()
{
Title = string.Empty;
License = null;
CopyrightText = string.Empty;
Description = string.Empty;
DocumentationUrl = null;
IconUrl = null;
LicenseUrl = null;
Keywords = Array.Empty();
PurchasingInformationUrl = null;
ReleaseNotesUrl = null;
TestSpecificationUrl = null;
SupportedLocales = Array.Empty();
}
}
///
/// The full namespace
///
public class UANameSpace : UANameSpaceMetadata
{
///
/// Default constructor
///
public UANameSpace()
{
CreationTime = null;
NumberOfDownloads = 0;
Nodeset = new Nodeset();
}
///
/// The nodeset for this namespace
///
[JsonRequired]
public Nodeset Nodeset { get; set; }
///
/// The time the nodeset was uploaded to the cloud library
///
[JsonProperty("creationTime")]
public DateTime? CreationTime { get; set; }
///
/// Number of downloads of the nodeset
///
public uint NumberOfDownloads { get; set; }
}
/// Nodeset Class
public class Nodeset
{
/// Initializes a new instance of the class.
public Nodeset()
{
NodesetXml = string.Empty;
Identifier = 0;
NamespaceUri = null;
Version = string.Empty;
PublicationDate = DateTime.MinValue;
LastModifiedDate = DateTime.MinValue;
RequiredModels = new List();
}
/// Gets or sets the nodeset XML.
/// The nodeset XML.
[JsonProperty("nodesetXml")]
public string NodesetXml { get; set; }
/// Gets or sets the identifier.
/// The identifier.
[JsonProperty("identifier")]
public uint Identifier { get; set; }
/// Gets or sets the namespace URI.
/// The namespace URI.
[JsonProperty("namespaceUri")]
public Uri NamespaceUri { get; set; }
/// Gets or sets the version.
/// The version.
[JsonProperty("version")]
public string Version { get; set; }
/// Gets or sets the publication date.
/// The publication date.
[JsonProperty("publicationDate")]
public DateTime PublicationDate { get; set; }
/// Gets or sets the last modified date.
/// The last modified date.
[JsonProperty("lastModifiedDate")]
public DateTime LastModifiedDate { get; set; }
///
/// Nodesets that this nodeset depends on
///
[JsonProperty("requiredModels")]
public List RequiredModels { get; set; }
}
///
/// Contains information about dependencies of a nodeset
///
public class RequiredModelInfo
{
///
/// The namespace URI of the dependency
///
public string NamespaceUri { get; set; }
///
/// The minimum required publication date of the dependency
///
public DateTime? PublicationDate { get; set; }
///
/// The informational version of the dependency
///
public string Version { get; set; }
///
/// The best match currently available in the cloud library. null if no match (no nodeset for this namespace uri or only node sets with older publication dates).
///
public Nodeset AvailableModel { get; set; }
}
}