blob: 82b7df43a63f28f53cace8c22a1402f100947637 [file] [log] [blame]
Constantin Ziesche857c7ab2020-02-25 11:24:51 +01001/*******************************************************************************
2* Copyright (c) 2020 Robert Bosch GmbH
3* Author: Constantin Ziesche (constantin.ziesche@bosch.com)
4*
5* This program and the accompanying materials are made available under the
6* terms of the Eclipse Public License 2.0 which is available at
7* http://www.eclipse.org/legal/epl-2.0
8*
9* SPDX-License-Identifier: EPL-2.0
10*******************************************************************************/
11using System.Runtime.Serialization;
12
13namespace BaSyx.Models.Core.AssetAdministrationShell.References
14{
Constantin Ziesche310d2aa2020-03-25 11:48:26 +010015 /// <summary>
16 /// A key is a reference to an element by its id.
17 /// </summary>
Constantin Ziesche857c7ab2020-02-25 11:24:51 +010018 public interface IKey
19 {
Constantin Ziesche310d2aa2020-03-25 11:48:26 +010020 /// <summary>
21 /// Denote which kind of entity is referenced. In case type = GlobalReference then the element is a global unique id.
22 /// In all other cases the key references a model element of the same or of another AAS.The name of the model element is explicitly listed.
23 /// </summary>
Constantin Ziesche857c7ab2020-02-25 11:24:51 +010024 [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "type")]
25 KeyElements Type { get; }
Constantin Ziesche310d2aa2020-03-25 11:48:26 +010026
27 /// <summary>
28 /// Type of the key value.In case of idType = idShort local shall be true.
29 /// In case type=GlobalReference idType shall not be IdShort.
30 /// </summary>
Constantin Ziesche857c7ab2020-02-25 11:24:51 +010031 [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "idType")]
32 KeyType IdType { get; }
Constantin Ziesche310d2aa2020-03-25 11:48:26 +010033
34 /// <summary>
35 /// The key value, for example an IRDI if the idType=IRDI.
36 /// </summary>
Constantin Ziesche857c7ab2020-02-25 11:24:51 +010037 [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "value")]
38 string Value { get; }
Constantin Ziesche310d2aa2020-03-25 11:48:26 +010039
40 /// <summary>
41 /// Denotes if the key references a model element of the same AAS (=true) or not (=false).
42 /// In case of local = false the key may reference a model element of another AAS or an entity outside any AAS that has a global unique id.
43 /// </summary>
Constantin Ziesche857c7ab2020-02-25 11:24:51 +010044 [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "local")]
45 bool Local { get; }
Constantin Ziesche02817f12020-08-04 21:40:43 +020046
47 /// <summary>
48 /// Returns the official string representation of a Key according to Details of Asset Administration Shell (Chapter 5.2.1)
49 /// </summary>
50 /// <returns></returns>
51 string ToStandardizedString();
Constantin Ziesche857c7ab2020-02-25 11:24:51 +010052 }
53}