Repository: gopcua/opcua
Pull request #155 (2019-03-27 08:03:58)

Make AttributeID a type and add String() method for all enums
This patch improves the enums as follows:

* Rename `Type` to `TypeID` for the built-in types and make it a typed enum type.
* Goify `TypeID` names `TypeIDGUID`, `TypeIDXMLElement`, `TypeIDNodeID` and `TypeIDExtendedNodeID`
* Make `AttributeID` a type and have the code generator use it for all `AttributeID` fields instead of `uint32`
* Add `String()` method for all enums with golang.org/x/tools/cmd/stringer



Patch:
diff --git a/client.go b/client.go
index 9f899d2..93c5cfb 100644
--- a/client.go
+++ b/client.go
@@ -82,7 +82,7 @@ func (c *Client) Read(req *ua.ReadRequest) (*ua.ReadResponse, error) {
 		rc := &ua.ReadValueID{}
 		*rc = *rv
 		if rc.AttributeID == 0 {
-			rc.AttributeID = ua.IntegerIDValue
+			rc.AttributeID = ua.AttributeIDValue
 		}
 		if rc.DataEncoding == nil {
 			rc.DataEncoding = &ua.QualifiedName{}
diff --git a/cmd/service/main.go b/cmd/service/main.go
index 6090019..7f55be9 100644
--- a/cmd/service/main.go
+++ b/cmd/service/main.go
@@ -159,6 +159,9 @@ func ExtObjects(dict *TypeDictionary) []Type {
 				Name: goname.Format(f.Name),
 				Type: goFieldType(f),
 			}
+			if of.Name == "AttributeID" {
+				of.Type = "AttributeID"
+			}
 			o.Fields = append(o.Fields, of)
 		}
 
diff --git a/examples/write/write.go b/examples/write/write.go
index 19c076a..3ff7a19 100644
--- a/examples/write/write.go
+++ b/examples/write/write.go
@@ -41,7 +41,7 @@ func main() {
 		NodesToWrite: []*ua.WriteValue{
 			&ua.WriteValue{
 				NodeID:      id,
-				AttributeID: ua.IntegerIDValue,
+				AttributeID: ua.AttributeIDValue,
 				Value: &ua.DataValue{
 					EncodingMask: ua.DataValueValue,
 					Value:        v,
diff --git a/generate.sh b/generate.sh
index eef4847..2e53eac 100755
--- a/generate.sh
+++ b/generate.sh
@@ -4,3 +4,16 @@ rm -f */*_gen.go
 go run cmd/id/main.go
 go run cmd/status/main.go
 go run cmd/service/*.go
+
+# install stringer if not installed already
+command -v stringer || go get -u golang.org/x/tools/cmd/stringer
+
+# find all enum types
+enums=$(grep -w type ua/enums*.go | awk '{print $2;}' | paste -sd, -)
+
+# generate enum string method
+(cd ua && stringer -type $enums -output enums_strings_gen.go)
+echo "Wrote ua/enums_strings_gen.go"
+
+# remove golang.org/x/tools/cmd/stringer from list of dependencies
+go mod tidy
diff --git a/node.go b/node.go
index ba66fb2..152d7a4 100644
--- a/node.go
+++ b/node.go
@@ -16,9 +16,13 @@ type Node struct {
 	c *Client
 }
 
+func (n *Node) String() string {
+	return n.ID.String()
+}
+
 // NodeClass returns the node class attribute.
 func (n *Node) NodeClass() (ua.NodeClass, error) {
-	v, err := n.Attribute(ua.IntegerIDNodeClass)
+	v, err := n.Attribute(ua.AttributeIDNodeClass)
 	if err != nil {
 		return 0, err
 	}
@@ -27,7 +31,7 @@ func (n *Node) NodeClass() (ua.NodeClass, error) {
 
 // BrowseName returns the browse name of the node.
 func (n *Node) BrowseName() (*ua.QualifiedName, error) {
-	v, err := n.Attribute(ua.IntegerIDBrowseName)
+	v, err := n.Attribute(ua.AttributeIDBrowseName)
 	if err != nil {
 		return nil, err
 	}
@@ -36,7 +40,7 @@ func (n *Node) BrowseName() (*ua.QualifiedName, error) {
 
 // DisplayName returns the display name of the node.
 func (n *Node) DisplayName() (*ua.LocalizedText, error) {
-	v, err := n.Attribute(ua.IntegerIDDisplayName)
+	v, err := n.Attribute(ua.AttributeIDDisplayName)
 	if err != nil {
 		return nil, err
 	}
@@ -45,11 +49,11 @@ func (n *Node) DisplayName() (*ua.LocalizedText, error) {
 
 // Value returns the value of the node.
 func (n *Node) Value() (*ua.Variant, error) {
-	return n.Attribute(ua.IntegerIDValue)
+	return n.Attribute(ua.AttributeIDValue)
 }
 
 // Attribute returns the attribute of the node. with the given id.
-func (n *Node) Attribute(attrID uint32) (*ua.Variant, error) {
+func (n *Node) Attribute(attrID ua.AttributeID) (*ua.Variant, error) {
 	rv := &ua.ReadValueID{NodeID: n.ID, AttributeID: attrID}
 	req := &ua.ReadRequest{NodesToRead: []*ua.ReadValueID{rv}}
 	res, err := n.c.Read(req)
diff --git a/ua/enums.go b/ua/enums.go
index e8a024f..c406c8e 100644
--- a/ua/enums.go
+++ b/ua/enums.go
@@ -10,71 +10,75 @@ const (
 	NodeClassAll NodeClass = 0xff
 )
 
-// IntegerID is a UInt32 that is used as an identifier, such as a handle.
-// All values, except for 0, are valid.
-//
-// Specification: Part 4, 7.14
-// type IntegerID uint32
-
 // Identifiers assigned to Attributes.
 //
 // Specification: Part 6, A.1
+type AttributeID uint32
+
 const (
-	IntegerIDInvalid = iota
-	IntegerIDNodeID
-	IntegerIDNodeClass
-	IntegerIDBrowseName
-	IntegerIDDisplayName
-	IntegerIDDescription
-	IntegerIDWriteMask
-	IntegerIDUserWriteMask
-	IntegerIDIsAbstract
-	IntegerIDSymmetric
-	IntegerIDInverseName
-	IntegerIDContainsNoLoops
-	IntegerIDEventNotifier
-	IntegerIDValue
-	IntegerIDDataType
-	IntegerIDValueRank
-	IntegerIDArrayDimensions
-	IntegerIDAccessLevel
-	IntegerIDUserAccessLevel
-	IntegerIDMinimumSamplingInterval
-	IntegerIDHistorizing
-	IntegerIDExecutable
-	IntegerIDUserExecutable
-	IntegerIDDataTypeDefinition
-	IntegerIDRolePermissions
-	IntegerIDUserRolePermissions
-	IntegerIDAccessRestrictions
-	IntegerIDAccessLevelEx
+	AttributeIDInvalid                 AttributeID = 0
+	AttributeIDNodeID                  AttributeID = 1
+	AttributeIDNodeClass               AttributeID = 2
+	AttributeIDBrowseName              AttributeID = 3
+	AttributeIDDisplayName             AttributeID = 4
+	AttributeIDDescription             AttributeID = 5
+	AttributeIDWriteMask               AttributeID = 6
+	AttributeIDUserWriteMask           AttributeID = 7
+	AttributeIDIsAbstract              AttributeID = 8
+	AttributeIDSymmetric               AttributeID = 9
+	AttributeIDInverseName             AttributeID = 10
+	AttributeIDContainsNoLoops         AttributeID = 11
+	AttributeIDEventNotifier           AttributeID = 12
+	AttributeIDValue                   AttributeID = 13
+	AttributeIDDataType                AttributeID = 14
+	AttributeIDValueRank               AttributeID = 15
+	AttributeIDArrayDimensions         AttributeID = 16
+	AttributeIDAccessLevel             AttributeID = 17
+	AttributeIDUserAccessLevel         AttributeID = 18
+	AttributeIDMinimumSamplingInterval AttributeID = 19
+	AttributeIDHistorizing             AttributeID = 20
+	AttributeIDExecutable              AttributeID = 21
+	AttributeIDUserExecutable          AttributeID = 22
+	AttributeIDDataTypeDefinition      AttributeID = 23
+	AttributeIDRolePermissions         AttributeID = 24
+	AttributeIDUserRolePermissions     AttributeID = 25
+	AttributeIDAccessRestrictions      AttributeID = 26
+	AttributeIDAccessLevelEx           AttributeID = 27
 )
 
-// datatypes
+// Built-in type identifiers.
+//
+// All OPC UA DataEncodings are based on rules that are defined for a standard
+// set of built-in types. These built-in types are then used to construct
+// structures, arrays and messages.
+//
+// Specification: Part 6, 5.1.2
+type TypeID byte
+
 const (
-	TypeBoolean         = 1
-	TypeSByte           = 2
-	TypeByte            = 3
-	TypeInt16           = 4
-	TypeUint16          = 5
-	TypeInt32           = 6
-	TypeUint32          = 7
-	TypeInt64           = 8
-	TypeUint64          = 9
-	TypeFloat           = 10
-	TypeDouble          = 11
-	TypeString          = 12
-	TypeDateTime        = 13
-	TypeGuid            = 14
-	TypeByteString      = 15
-	TypeXmlElement      = 16
-	TypeNodeId          = 17
-	TypeExpandedNodeId  = 18
-	TypeStatusCode      = 19
-	TypeQualifiedName   = 20
-	TypeLocalizedText   = 21
-	TypeExtensionObject = 22
-	TypeDataValue       = 23
-	TypeVariant         = 24
-	TypeDiagnosticInfo  = 25
+	TypeIDBoolean         TypeID = 1
+	TypeIDSByte           TypeID = 2
+	TypeIDByte            TypeID = 3
+	TypeIDInt16           TypeID = 4
+	TypeIDUint16          TypeID = 5
+	TypeIDInt32           TypeID = 6
+	TypeIDUint32          TypeID = 7
+	TypeIDInt64           TypeID = 8
+	TypeIDUint64          TypeID = 9
+	TypeIDFloat           TypeID = 10
+	TypeIDDouble          TypeID = 11
+	TypeIDString          TypeID = 12
+	TypeIDDateTime        TypeID = 13
+	TypeIDGUID            TypeID = 14
+	TypeIDByteString      TypeID = 15
+	TypeIDXMLElement      TypeID = 16
+	TypeIDNodeID          TypeID = 17
+	TypeIDExpandedNodeID  TypeID = 18
+	TypeIDStatusCode      TypeID = 19
+	TypeIDQualifiedName   TypeID = 20
+	TypeIDLocalizedText   TypeID = 21
+	TypeIDExtensionObject TypeID = 22
+	TypeIDDataValue       TypeID = 23
+	TypeIDVariant         TypeID = 24
+	TypeIDDiagnosticInfo  TypeID = 25
 )
diff --git a/ua/enums_strings_gen.go b/ua/enums_strings_gen.go
new file mode 100644
index 0000000..c91177c
--- /dev/null
+++ b/ua/enums_strings_gen.go
@@ -0,0 +1,1401 @@
+// Code generated by "stringer -type AttributeID,NodeIDType,NamingRuleType,OpenFileMode,IdentityCriteriaType,TrustListMasks,PubSubState,DataSetFieldFlags,DataSetFieldContentMask,OverrideValueHandling,DataSetOrderingType,UADPNetworkMessageContentMask,UADPDataSetMessageContentMask,JSONNetworkMessageContentMask,JSONDataSetMessageContentMask,BrokerTransportQoS,DiagnosticsLevel,PubSubDiagnosticsCounterClassification,IDType,NodeClass,PermissionType,AccessLevelType,AccessLevelExType,EventNotifierType,StructureType,ApplicationType,MessageSecurityMode,UserTokenType,SecurityTokenRequestType,NodeAttributesMask,AttributeWriteMask,BrowseDirection,BrowseResultMask,FilterOperator,TimestampsToReturn,HistoryUpdateType,PerformUpdateType,MonitoringMode,DataChangeTrigger,DeadbandType,RedundancySupport,ServerState,ModelChangeStructureVerbMask,AxisScaleEnumeration,ExceptionDeviationFormat -output enums_strings_gen.go"; DO NOT EDIT.
+
+package ua
+
+import "strconv"
+
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[AttributeIDInvalid-0]
+	_ = x[AttributeIDNodeID-1]
+	_ = x[AttributeIDNodeClass-2]
+	_ = x[AttributeIDBrowseName-3]
+	_ = x[AttributeIDDisplayName-4]
+	_ = x[AttributeIDDescription-5]
+	_ = x[AttributeIDWriteMask-6]
+	_ = x[AttributeIDUserWriteMask-7]
+	_ = x[AttributeIDIsAbstract-8]
+	_ = x[AttributeIDSymmetric-9]
+	_ = x[AttributeIDInverseName-10]
+	_ = x[AttributeIDContainsNoLoops-11]
+	_ = x[AttributeIDEventNotifier-12]
+	_ = x[AttributeIDValue-13]
+	_ = x[AttributeIDDataType-14]
+	_ = x[AttributeIDValueRank-15]
+	_ = x[AttributeIDArrayDimensions-16]
+	_ = x[AttributeIDAccessLevel-17]
+	_ = x[AttributeIDUserAccessLevel-18]
+	_ = x[AttributeIDMinimumSamplingInterval-19]
+	_ = x[AttributeIDHistorizing-20]
+	_ = x[AttributeIDExecutable-21]
+	_ = x[AttributeIDUserExecutable-22]
+	_ = x[AttributeIDDataTypeDefinition-23]
+	_ = x[AttributeIDRolePermissions-24]
+	_ = x[AttributeIDUserRolePermissions-25]
+	_ = x[AttributeIDAccessRestrictions-26]
+	_ = x[AttributeIDAccessLevelEx-27]
+}
+
+const _AttributeID_name = "AttributeIDInvalidAttributeIDNodeIDAttributeIDNodeClassAttributeIDBrowseNameAttributeIDDisplayNameAttributeIDDescriptionAttributeIDWriteMaskAttributeIDUserWriteMaskAttributeIDIsAbstractAttributeIDSymmetricAttributeIDInverseNameAttributeIDContainsNoLoopsAttributeIDEventNotifierAttributeIDValueAttributeIDDataTypeAttributeIDValueRankAttributeIDArrayDimensionsAttributeIDAccessLevelAttributeIDUserAccessLevelAttributeIDMinimumSamplingIntervalAttributeIDHistorizingAttributeIDExecutableAttributeIDUserExecutableAttributeIDDataTypeDefinitionAttributeIDRolePermissionsAttributeIDUserRolePermissionsAttributeIDAccessRestrictionsAttributeIDAccessLevelEx"
+
+var _AttributeID_index = [...]uint16{0, 18, 35, 55, 76, 98, 120, 140, 164, 185, 205, 227, 253, 277, 293, 312, 332, 358, 380, 406, 440, 462, 483, 508, 537, 563, 593, 622, 646}
+
+func (i AttributeID) String() string {
+	if i >= AttributeID(len(_AttributeID_index)-1) {
+		return "AttributeID(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _AttributeID_name[_AttributeID_index[i]:_AttributeID_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[NodeIDTypeTwoByte-0]
+	_ = x[NodeIDTypeFourByte-1]
+	_ = x[NodeIDTypeNumeric-2]
+	_ = x[NodeIDTypeString-3]
+	_ = x[NodeIDTypeGUID-4]
+	_ = x[NodeIDTypeByteString-5]
+}
+
+const _NodeIDType_name = "NodeIDTypeTwoByteNodeIDTypeFourByteNodeIDTypeNumericNodeIDTypeStringNodeIDTypeGUIDNodeIDTypeByteString"
+
+var _NodeIDType_index = [...]uint8{0, 17, 35, 52, 68, 82, 102}
+
+func (i NodeIDType) String() string {
+	if i >= NodeIDType(len(_NodeIDType_index)-1) {
+		return "NodeIDType(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _NodeIDType_name[_NodeIDType_index[i]:_NodeIDType_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[NamingRuleTypeMandatory-1]
+	_ = x[NamingRuleTypeOptional-2]
+	_ = x[NamingRuleTypeConstraint-3]
+}
+
+const _NamingRuleType_name = "NamingRuleTypeMandatoryNamingRuleTypeOptionalNamingRuleTypeConstraint"
+
+var _NamingRuleType_index = [...]uint8{0, 23, 45, 69}
+
+func (i NamingRuleType) String() string {
+	i -= 1
+	if i >= NamingRuleType(len(_NamingRuleType_index)-1) {
+		return "NamingRuleType(" + strconv.FormatInt(int64(i+1), 10) + ")"
+	}
+	return _NamingRuleType_name[_NamingRuleType_index[i]:_NamingRuleType_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[OpenFileModeRead-1]
+	_ = x[OpenFileModeWrite-2]
+	_ = x[OpenFileModeEraseExisting-4]
+	_ = x[OpenFileModeAppend-8]
+}
+
+const (
+	_OpenFileMode_name_0 = "OpenFileModeReadOpenFileModeWrite"
+	_OpenFileMode_name_1 = "OpenFileModeEraseExisting"
+	_OpenFileMode_name_2 = "OpenFileModeAppend"
+)
+
+var (
+	_OpenFileMode_index_0 = [...]uint8{0, 16, 33}
+)
+
+func (i OpenFileMode) String() string {
+	switch {
+	case 1 <= i && i <= 2:
+		i -= 1
+		return _OpenFileMode_name_0[_OpenFileMode_index_0[i]:_OpenFileMode_index_0[i+1]]
+	case i == 4:
+		return _OpenFileMode_name_1
+	case i == 8:
+		return _OpenFileMode_name_2
+	default:
+		return "OpenFileMode(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[IdentityCriteriaTypeUserName-1]
+	_ = x[IdentityCriteriaTypeThumbprint-2]
+	_ = x[IdentityCriteriaTypeRole-3]
+	_ = x[IdentityCriteriaTypeGroupID-4]
+	_ = x[IdentityCriteriaTypeAnonymous-5]
+	_ = x[IdentityCriteriaTypeAuthenticatedUser-6]
+}
+
+const _IdentityCriteriaType_name = "IdentityCriteriaTypeUserNameIdentityCriteriaTypeThumbprintIdentityCriteriaTypeRoleIdentityCriteriaTypeGroupIDIdentityCriteriaTypeAnonymousIdentityCriteriaTypeAuthenticatedUser"
+
+var _IdentityCriteriaType_index = [...]uint8{0, 28, 58, 82, 109, 138, 175}
+
+func (i IdentityCriteriaType) String() string {
+	i -= 1
+	if i >= IdentityCriteriaType(len(_IdentityCriteriaType_index)-1) {
+		return "IdentityCriteriaType(" + strconv.FormatInt(int64(i+1), 10) + ")"
+	}
+	return _IdentityCriteriaType_name[_IdentityCriteriaType_index[i]:_IdentityCriteriaType_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[TrustListMasksNone-0]
+	_ = x[TrustListMasksTrustedCertificates-1]
+	_ = x[TrustListMasksTrustedCrls-2]
+	_ = x[TrustListMasksIssuerCertificates-4]
+	_ = x[TrustListMasksIssuerCrls-8]
+	_ = x[TrustListMasksAll-15]
+}
+
+const (
+	_TrustListMasks_name_0 = "TrustListMasksNoneTrustListMasksTrustedCertificatesTrustListMasksTrustedCrls"
+	_TrustListMasks_name_1 = "TrustListMasksIssuerCertificates"
+	_TrustListMasks_name_2 = "TrustListMasksIssuerCrls"
+	_TrustListMasks_name_3 = "TrustListMasksAll"
+)
+
+var (
+	_TrustListMasks_index_0 = [...]uint8{0, 18, 51, 76}
+)
+
+func (i TrustListMasks) String() string {
+	switch {
+	case 0 <= i && i <= 2:
+		return _TrustListMasks_name_0[_TrustListMasks_index_0[i]:_TrustListMasks_index_0[i+1]]
+	case i == 4:
+		return _TrustListMasks_name_1
+	case i == 8:
+		return _TrustListMasks_name_2
+	case i == 15:
+		return _TrustListMasks_name_3
+	default:
+		return "TrustListMasks(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[PubSubStateDisabled-0]
+	_ = x[PubSubStatePaused-1]
+	_ = x[PubSubStateOperational-2]
+	_ = x[PubSubStateError-3]
+}
+
+const _PubSubState_name = "PubSubStateDisabledPubSubStatePausedPubSubStateOperationalPubSubStateError"
+
+var _PubSubState_index = [...]uint8{0, 19, 36, 58, 74}
+
+func (i PubSubState) String() string {
+	if i >= PubSubState(len(_PubSubState_index)-1) {
+		return "PubSubState(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _PubSubState_name[_PubSubState_index[i]:_PubSubState_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[DataSetFieldFlagsNone-0]
+	_ = x[DataSetFieldFlagsPromotedField-1]
+}
+
+const _DataSetFieldFlags_name = "DataSetFieldFlagsNoneDataSetFieldFlagsPromotedField"
+
+var _DataSetFieldFlags_index = [...]uint8{0, 21, 51}
+
+func (i DataSetFieldFlags) String() string {
+	if i >= DataSetFieldFlags(len(_DataSetFieldFlags_index)-1) {
+		return "DataSetFieldFlags(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _DataSetFieldFlags_name[_DataSetFieldFlags_index[i]:_DataSetFieldFlags_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[DataSetFieldContentMaskNone-0]
+	_ = x[DataSetFieldContentMaskStatusCode-1]
+	_ = x[DataSetFieldContentMaskSourceTimestamp-2]
+	_ = x[DataSetFieldContentMaskServerTimestamp-4]
+	_ = x[DataSetFieldContentMaskSourcePicoSeconds-8]
+	_ = x[DataSetFieldContentMaskServerPicoSeconds-16]
+	_ = x[DataSetFieldContentMaskRawData-32]
+}
+
+const (
+	_DataSetFieldContentMask_name_0 = "DataSetFieldContentMaskNoneDataSetFieldContentMaskStatusCodeDataSetFieldContentMaskSourceTimestamp"
+	_DataSetFieldContentMask_name_1 = "DataSetFieldContentMaskServerTimestamp"
+	_DataSetFieldContentMask_name_2 = "DataSetFieldContentMaskSourcePicoSeconds"
+	_DataSetFieldContentMask_name_3 = "DataSetFieldContentMaskServerPicoSeconds"
+	_DataSetFieldContentMask_name_4 = "DataSetFieldContentMaskRawData"
+)
+
+var (
+	_DataSetFieldContentMask_index_0 = [...]uint8{0, 27, 60, 98}
+)
+
+func (i DataSetFieldContentMask) String() string {
+	switch {
+	case 0 <= i && i <= 2:
+		return _DataSetFieldContentMask_name_0[_DataSetFieldContentMask_index_0[i]:_DataSetFieldContentMask_index_0[i+1]]
+	case i == 4:
+		return _DataSetFieldContentMask_name_1
+	case i == 8:
+		return _DataSetFieldContentMask_name_2
+	case i == 16:
+		return _DataSetFieldContentMask_name_3
+	case i == 32:
+		return _DataSetFieldContentMask_name_4
+	default:
+		return "DataSetFieldContentMask(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[OverrideValueHandlingDisabled-0]
+	_ = x[OverrideValueHandlingLastUsableValue-1]
+	_ = x[OverrideValueHandlingOverrideValue-2]
+}
+
+const _OverrideValueHandling_name = "OverrideValueHandlingDisabledOverrideValueHandlingLastUsableValueOverrideValueHandlingOverrideValue"
+
+var _OverrideValueHandling_index = [...]uint8{0, 29, 65, 99}
+
+func (i OverrideValueHandling) String() string {
+	if i >= OverrideValueHandling(len(_OverrideValueHandling_index)-1) {
+		return "OverrideValueHandling(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _OverrideValueHandling_name[_OverrideValueHandling_index[i]:_OverrideValueHandling_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[DataSetOrderingTypeUndefined-0]
+	_ = x[DataSetOrderingTypeAscendingWriterID-1]
+	_ = x[DataSetOrderingTypeAscendingWriterIDSingle-2]
+}
+
+const _DataSetOrderingType_name = "DataSetOrderingTypeUndefinedDataSetOrderingTypeAscendingWriterIDDataSetOrderingTypeAscendingWriterIDSingle"
+
+var _DataSetOrderingType_index = [...]uint8{0, 28, 64, 106}
+
+func (i DataSetOrderingType) String() string {
+	if i >= DataSetOrderingType(len(_DataSetOrderingType_index)-1) {
+		return "DataSetOrderingType(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _DataSetOrderingType_name[_DataSetOrderingType_index[i]:_DataSetOrderingType_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[UADPNetworkMessageContentMaskNone-0]
+	_ = x[UADPNetworkMessageContentMaskPublisherID-1]
+	_ = x[UADPNetworkMessageContentMaskGroupHeader-2]
+	_ = x[UADPNetworkMessageContentMaskWriterGroupID-4]
+	_ = x[UADPNetworkMessageContentMaskGroupVersion-8]
+	_ = x[UADPNetworkMessageContentMaskNetworkMessageNumber-16]
+	_ = x[UADPNetworkMessageContentMaskSequenceNumber-32]
+	_ = x[UADPNetworkMessageContentMaskPayloadHeader-64]
+	_ = x[UADPNetworkMessageContentMaskTimestamp-128]
+	_ = x[UADPNetworkMessageContentMaskPicoSeconds-256]
+	_ = x[UADPNetworkMessageContentMaskDataSetClassID-512]
+	_ = x[UADPNetworkMessageContentMaskPromotedFields-1024]
+}
+
+const (
+	_UADPNetworkMessageContentMask_name_0 = "UADPNetworkMessageContentMaskNoneUADPNetworkMessageContentMaskPublisherIDUADPNetworkMessageContentMaskGroupHeader"
+	_UADPNetworkMessageContentMask_name_1 = "UADPNetworkMessageContentMaskWriterGroupID"
+	_UADPNetworkMessageContentMask_name_2 = "UADPNetworkMessageContentMaskGroupVersion"
+	_UADPNetworkMessageContentMask_name_3 = "UADPNetworkMessageContentMaskNetworkMessageNumber"
+	_UADPNetworkMessageContentMask_name_4 = "UADPNetworkMessageContentMaskSequenceNumber"
+	_UADPNetworkMessageContentMask_name_5 = "UADPNetworkMessageContentMaskPayloadHeader"
+	_UADPNetworkMessageContentMask_name_6 = "UADPNetworkMessageContentMaskTimestamp"
+	_UADPNetworkMessageContentMask_name_7 = "UADPNetworkMessageContentMaskPicoSeconds"
+	_UADPNetworkMessageContentMask_name_8 = "UADPNetworkMessageContentMaskDataSetClassID"
+	_UADPNetworkMessageContentMask_name_9 = "UADPNetworkMessageContentMaskPromotedFields"
+)
+
+var (
+	_UADPNetworkMessageContentMask_index_0 = [...]uint8{0, 33, 73, 113}
+)
+
+func (i UADPNetworkMessageContentMask) String() string {
+	switch {
+	case 0 <= i && i <= 2:
+		return _UADPNetworkMessageContentMask_name_0[_UADPNetworkMessageContentMask_index_0[i]:_UADPNetworkMessageContentMask_index_0[i+1]]
+	case i == 4:
+		return _UADPNetworkMessageContentMask_name_1
+	case i == 8:
+		return _UADPNetworkMessageContentMask_name_2
+	case i == 16:
+		return _UADPNetworkMessageContentMask_name_3
+	case i == 32:
+		return _UADPNetworkMessageContentMask_name_4
+	case i == 64:
+		return _UADPNetworkMessageContentMask_name_5
+	case i == 128:
+		return _UADPNetworkMessageContentMask_name_6
+	case i == 256:
+		return _UADPNetworkMessageContentMask_name_7
+	case i == 512:
+		return _UADPNetworkMessageContentMask_name_8
+	case i == 1024:
+		return _UADPNetworkMessageContentMask_name_9
+	default:
+		return "UADPNetworkMessageContentMask(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[UADPDataSetMessageContentMaskNone-0]
+	_ = x[UADPDataSetMessageContentMaskTimestamp-1]
+	_ = x[UADPDataSetMessageContentMaskPicoSeconds-2]
+	_ = x[UADPDataSetMessageContentMaskStatus-4]
+	_ = x[UADPDataSetMessageContentMaskMajorVersion-8]
+	_ = x[UADPDataSetMessageContentMaskMinorVersion-16]
+	_ = x[UADPDataSetMessageContentMaskSequenceNumber-32]
+}
+
+const (
+	_UADPDataSetMessageContentMask_name_0 = "UADPDataSetMessageContentMaskNoneUADPDataSetMessageContentMaskTimestampUADPDataSetMessageContentMaskPicoSeconds"
+	_UADPDataSetMessageContentMask_name_1 = "UADPDataSetMessageContentMaskStatus"
+	_UADPDataSetMessageContentMask_name_2 = "UADPDataSetMessageContentMaskMajorVersion"
+	_UADPDataSetMessageContentMask_name_3 = "UADPDataSetMessageContentMaskMinorVersion"
+	_UADPDataSetMessageContentMask_name_4 = "UADPDataSetMessageContentMaskSequenceNumber"
+)
+
+var (
+	_UADPDataSetMessageContentMask_index_0 = [...]uint8{0, 33, 71, 111}
+)
+
+func (i UADPDataSetMessageContentMask) String() string {
+	switch {
+	case 0 <= i && i <= 2:
+		return _UADPDataSetMessageContentMask_name_0[_UADPDataSetMessageContentMask_index_0[i]:_UADPDataSetMessageContentMask_index_0[i+1]]
+	case i == 4:
+		return _UADPDataSetMessageContentMask_name_1
+	case i == 8:
+		return _UADPDataSetMessageContentMask_name_2
+	case i == 16:
+		return _UADPDataSetMessageContentMask_name_3
+	case i == 32:
+		return _UADPDataSetMessageContentMask_name_4
+	default:
+		return "UADPDataSetMessageContentMask(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[JSONNetworkMessageContentMaskNone-0]
+	_ = x[JSONNetworkMessageContentMaskNetworkMessageHeader-1]
+	_ = x[JSONNetworkMessageContentMaskDataSetMessageHeader-2]
+	_ = x[JSONNetworkMessageContentMaskSingleDataSetMessage-4]
+	_ = x[JSONNetworkMessageContentMaskPublisherID-8]
+	_ = x[JSONNetworkMessageContentMaskDataSetClassID-16]
+	_ = x[JSONNetworkMessageContentMaskReplyTo-32]
+}
+
+const (
+	_JSONNetworkMessageContentMask_name_0 = "JSONNetworkMessageContentMaskNoneJSONNetworkMessageContentMaskNetworkMessageHeaderJSONNetworkMessageContentMaskDataSetMessageHeader"
+	_JSONNetworkMessageContentMask_name_1 = "JSONNetworkMessageContentMaskSingleDataSetMessage"
+	_JSONNetworkMessageContentMask_name_2 = "JSONNetworkMessageContentMaskPublisherID"
+	_JSONNetworkMessageContentMask_name_3 = "JSONNetworkMessageContentMaskDataSetClassID"
+	_JSONNetworkMessageContentMask_name_4 = "JSONNetworkMessageContentMaskReplyTo"
+)
+
+var (
+	_JSONNetworkMessageContentMask_index_0 = [...]uint8{0, 33, 82, 131}
+)
+
+func (i JSONNetworkMessageContentMask) String() string {
+	switch {
+	case 0 <= i && i <= 2:
+		return _JSONNetworkMessageContentMask_name_0[_JSONNetworkMessageContentMask_index_0[i]:_JSONNetworkMessageContentMask_index_0[i+1]]
+	case i == 4:
+		return _JSONNetworkMessageContentMask_name_1
+	case i == 8:
+		return _JSONNetworkMessageContentMask_name_2
+	case i == 16:
+		return _JSONNetworkMessageContentMask_name_3
+	case i == 32:
+		return _JSONNetworkMessageContentMask_name_4
+	default:
+		return "JSONNetworkMessageContentMask(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[JSONDataSetMessageContentMaskNone-0]
+	_ = x[JSONDataSetMessageContentMaskDataSetWriterID-1]
+	_ = x[JSONDataSetMessageContentMaskMetaDataVersion-2]
+	_ = x[JSONDataSetMessageContentMaskSequenceNumber-4]
+	_ = x[JSONDataSetMessageContentMaskTimestamp-8]
+	_ = x[JSONDataSetMessageContentMaskStatus-16]
+}
+
+const (
+	_JSONDataSetMessageContentMask_name_0 = "JSONDataSetMessageContentMaskNoneJSONDataSetMessageContentMaskDataSetWriterIDJSONDataSetMessageContentMaskMetaDataVersion"
+	_JSONDataSetMessageContentMask_name_1 = "JSONDataSetMessageContentMaskSequenceNumber"
+	_JSONDataSetMessageContentMask_name_2 = "JSONDataSetMessageContentMaskTimestamp"
+	_JSONDataSetMessageContentMask_name_3 = "JSONDataSetMessageContentMaskStatus"
+)
+
+var (
+	_JSONDataSetMessageContentMask_index_0 = [...]uint8{0, 33, 77, 121}
+)
+
+func (i JSONDataSetMessageContentMask) String() string {
+	switch {
+	case 0 <= i && i <= 2:
+		return _JSONDataSetMessageContentMask_name_0[_JSONDataSetMessageContentMask_index_0[i]:_JSONDataSetMessageContentMask_index_0[i+1]]
+	case i == 4:
+		return _JSONDataSetMessageContentMask_name_1
+	case i == 8:
+		return _JSONDataSetMessageContentMask_name_2
+	case i == 16:
+		return _JSONDataSetMessageContentMask_name_3
+	default:
+		return "JSONDataSetMessageContentMask(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[BrokerTransportQoSNotSpecified-0]
+	_ = x[BrokerTransportQoSBestEffort-1]
+	_ = x[BrokerTransportQoSAtLeastOnce-2]
+	_ = x[BrokerTransportQoSAtMostOnce-3]
+	_ = x[BrokerTransportQoSExactlyOnce-4]
+}
+
+const _BrokerTransportQoS_name = "BrokerTransportQoSNotSpecifiedBrokerTransportQoSBestEffortBrokerTransportQoSAtLeastOnceBrokerTransportQoSAtMostOnceBrokerTransportQoSExactlyOnce"
+
+var _BrokerTransportQoS_index = [...]uint8{0, 30, 58, 87, 115, 144}
+
+func (i BrokerTransportQoS) String() string {
+	if i >= BrokerTransportQoS(len(_BrokerTransportQoS_index)-1) {
+		return "BrokerTransportQoS(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _BrokerTransportQoS_name[_BrokerTransportQoS_index[i]:_BrokerTransportQoS_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[DiagnosticsLevelBasic-0]
+	_ = x[DiagnosticsLevelAdvanced-1]
+	_ = x[DiagnosticsLevelInfo-2]
+	_ = x[DiagnosticsLevelLog-3]
+	_ = x[DiagnosticsLevelDebug-4]
+}
+
+const _DiagnosticsLevel_name = "DiagnosticsLevelBasicDiagnosticsLevelAdvancedDiagnosticsLevelInfoDiagnosticsLevelLogDiagnosticsLevelDebug"
+
+var _DiagnosticsLevel_index = [...]uint8{0, 21, 45, 65, 84, 105}
+
+func (i DiagnosticsLevel) String() string {
+	if i >= DiagnosticsLevel(len(_DiagnosticsLevel_index)-1) {
+		return "DiagnosticsLevel(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _DiagnosticsLevel_name[_DiagnosticsLevel_index[i]:_DiagnosticsLevel_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[PubSubDiagnosticsCounterClassificationInformation-0]
+	_ = x[PubSubDiagnosticsCounterClassificationError-1]
+}
+
+const _PubSubDiagnosticsCounterClassification_name = "PubSubDiagnosticsCounterClassificationInformationPubSubDiagnosticsCounterClassificationError"
+
+var _PubSubDiagnosticsCounterClassification_index = [...]uint8{0, 49, 92}
+
+func (i PubSubDiagnosticsCounterClassification) String() string {
+	if i >= PubSubDiagnosticsCounterClassification(len(_PubSubDiagnosticsCounterClassification_index)-1) {
+		return "PubSubDiagnosticsCounterClassification(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _PubSubDiagnosticsCounterClassification_name[_PubSubDiagnosticsCounterClassification_index[i]:_PubSubDiagnosticsCounterClassification_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[IDTypeNumeric-0]
+	_ = x[IDTypeString-1]
+	_ = x[IDTypeGUID-2]
+	_ = x[IDTypeOpaque-3]
+}
+
+const _IDType_name = "IDTypeNumericIDTypeStringIDTypeGUIDIDTypeOpaque"
+
+var _IDType_index = [...]uint8{0, 13, 25, 35, 47}
+
+func (i IDType) String() string {
+	if i >= IDType(len(_IDType_index)-1) {
+		return "IDType(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _IDType_name[_IDType_index[i]:_IDType_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[NodeClassAll-255]
+	_ = x[NodeClassUnspecified-0]
+	_ = x[NodeClassObject-1]
+	_ = x[NodeClassVariable-2]
+	_ = x[NodeClassMethod-4]
+	_ = x[NodeClassObjectType-8]
+	_ = x[NodeClassVariableType-16]
+	_ = x[NodeClassReferenceType-32]
+	_ = x[NodeClassDataType-64]
+	_ = x[NodeClassView-128]
+}
+
+const (
+	_NodeClass_name_0 = "NodeClassUnspecifiedNodeClassObjectNodeClassVariable"
+	_NodeClass_name_1 = "NodeClassMethod"
+	_NodeClass_name_2 = "NodeClassObjectType"
+	_NodeClass_name_3 = "NodeClassVariableType"
+	_NodeClass_name_4 = "NodeClassReferenceType"
+	_NodeClass_name_5 = "NodeClassDataType"
+	_NodeClass_name_6 = "NodeClassView"
+	_NodeClass_name_7 = "NodeClassAll"
+)
+
+var (
+	_NodeClass_index_0 = [...]uint8{0, 20, 35, 52}
+)
+
+func (i NodeClass) String() string {
+	switch {
+	case 0 <= i && i <= 2:
+		return _NodeClass_name_0[_NodeClass_index_0[i]:_NodeClass_index_0[i+1]]
+	case i == 4:
+		return _NodeClass_name_1
+	case i == 8:
+		return _NodeClass_name_2
+	case i == 16:
+		return _NodeClass_name_3
+	case i == 32:
+		return _NodeClass_name_4
+	case i == 64:
+		return _NodeClass_name_5
+	case i == 128:
+		return _NodeClass_name_6
+	case i == 255:
+		return _NodeClass_name_7
+	default:
+		return "NodeClass(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[PermissionTypeNone-0]
+	_ = x[PermissionTypeBrowse-1]
+	_ = x[PermissionTypeReadRolePermissions-2]
+	_ = x[PermissionTypeWriteAttribute-4]
+	_ = x[PermissionTypeWriteRolePermissions-8]
+	_ = x[PermissionTypeWriteHistorizing-16]
+	_ = x[PermissionTypeRead-32]
+	_ = x[PermissionTypeWrite-64]
+	_ = x[PermissionTypeReadHistory-128]
+	_ = x[PermissionTypeInsertHistory-256]
+	_ = x[PermissionTypeModifyHistory-512]
+	_ = x[PermissionTypeDeleteHistory-1024]
+	_ = x[PermissionTypeReceiveEvents-2048]
+	_ = x[PermissionTypeCall-4096]
+	_ = x[PermissionTypeAddReference-8192]
+	_ = x[PermissionTypeRemoveReference-16384]
+	_ = x[PermissionTypeDeleteNode-32768]
+	_ = x[PermissionTypeAddNode-65536]
+}
+
+const _PermissionType_name = "PermissionTypeNonePermissionTypeBrowsePermissionTypeReadRolePermissionsPermissionTypeWriteAttributePermissionTypeWriteRolePermissionsPermissionTypeWriteHistorizingPermissionTypeReadPermissionTypeWritePermissionTypeReadHistoryPermissionTypeInsertHistoryPermissionTypeModifyHistoryPermissionTypeDeleteHistoryPermissionTypeReceiveEventsPermissionTypeCallPermissionTypeAddReferencePermissionTypeRemoveReferencePermissionTypeDeleteNodePermissionTypeAddNode"
+
+var _PermissionType_map = map[PermissionType]string{
+	0:     _PermissionType_name[0:18],
+	1:     _PermissionType_name[18:38],
+	2:     _PermissionType_name[38:71],
+	4:     _PermissionType_name[71:99],
+	8:     _PermissionType_name[99:133],
+	16:    _PermissionType_name[133:163],
+	32:    _PermissionType_name[163:181],
+	64:    _PermissionType_name[181:200],
+	128:   _PermissionType_name[200:225],
+	256:   _PermissionType_name[225:252],
+	512:   _PermissionType_name[252:279],
+	1024:  _PermissionType_name[279:306],
+	2048:  _PermissionType_name[306:333],
+	4096:  _PermissionType_name[333:351],
+	8192:  _PermissionType_name[351:377],
+	16384: _PermissionType_name[377:406],
+	32768: _PermissionType_name[406:430],
+	65536: _PermissionType_name[430:451],
+}
+
+func (i PermissionType) String() string {
+	if str, ok := _PermissionType_map[i]; ok {
+		return str
+	}
+	return "PermissionType(" + strconv.FormatInt(int64(i), 10) + ")"
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[AccessLevelTypeNone-0]
+	_ = x[AccessLevelTypeCurrentRead-1]
+	_ = x[AccessLevelTypeCurrentWrite-2]
+	_ = x[AccessLevelTypeHistoryRead-4]
+	_ = x[AccessLevelTypeHistoryWrite-8]
+	_ = x[AccessLevelTypeSemanticChange-16]
+	_ = x[AccessLevelTypeStatusWrite-32]
+	_ = x[AccessLevelTypeTimestampWrite-64]
+}
+
+const (
+	_AccessLevelType_name_0 = "AccessLevelTypeNoneAccessLevelTypeCurrentReadAccessLevelTypeCurrentWrite"
+	_AccessLevelType_name_1 = "AccessLevelTypeHistoryRead"
+	_AccessLevelType_name_2 = "AccessLevelTypeHistoryWrite"
+	_AccessLevelType_name_3 = "AccessLevelTypeSemanticChange"
+	_AccessLevelType_name_4 = "AccessLevelTypeStatusWrite"
+	_AccessLevelType_name_5 = "AccessLevelTypeTimestampWrite"
+)
+
+var (
+	_AccessLevelType_index_0 = [...]uint8{0, 19, 45, 72}
+)
+
+func (i AccessLevelType) String() string {
+	switch {
+	case 0 <= i && i <= 2:
+		return _AccessLevelType_name_0[_AccessLevelType_index_0[i]:_AccessLevelType_index_0[i+1]]
+	case i == 4:
+		return _AccessLevelType_name_1
+	case i == 8:
+		return _AccessLevelType_name_2
+	case i == 16:
+		return _AccessLevelType_name_3
+	case i == 32:
+		return _AccessLevelType_name_4
+	case i == 64:
+		return _AccessLevelType_name_5
+	default:
+		return "AccessLevelType(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[AccessLevelExTypeNone-0]
+	_ = x[AccessLevelExTypeCurrentRead-1]
+	_ = x[AccessLevelExTypeCurrentWrite-2]
+	_ = x[AccessLevelExTypeHistoryRead-4]
+	_ = x[AccessLevelExTypeHistoryWrite-8]
+	_ = x[AccessLevelExTypeSemanticChange-16]
+	_ = x[AccessLevelExTypeStatusWrite-32]
+	_ = x[AccessLevelExTypeTimestampWrite-64]
+	_ = x[AccessLevelExTypeNonatomicRead-256]
+	_ = x[AccessLevelExTypeNonatomicWrite-512]
+	_ = x[AccessLevelExTypeWriteFullArrayOnly-1024]
+}
+
+const (
+	_AccessLevelExType_name_0 = "AccessLevelExTypeNoneAccessLevelExTypeCurrentReadAccessLevelExTypeCurrentWrite"
+	_AccessLevelExType_name_1 = "AccessLevelExTypeHistoryRead"
+	_AccessLevelExType_name_2 = "AccessLevelExTypeHistoryWrite"
+	_AccessLevelExType_name_3 = "AccessLevelExTypeSemanticChange"
+	_AccessLevelExType_name_4 = "AccessLevelExTypeStatusWrite"
+	_AccessLevelExType_name_5 = "AccessLevelExTypeTimestampWrite"
+	_AccessLevelExType_name_6 = "AccessLevelExTypeNonatomicRead"
+	_AccessLevelExType_name_7 = "AccessLevelExTypeNonatomicWrite"
+	_AccessLevelExType_name_8 = "AccessLevelExTypeWriteFullArrayOnly"
+)
+
+var (
+	_AccessLevelExType_index_0 = [...]uint8{0, 21, 49, 78}
+)
+
+func (i AccessLevelExType) String() string {
+	switch {
+	case 0 <= i && i <= 2:
+		return _AccessLevelExType_name_0[_AccessLevelExType_index_0[i]:_AccessLevelExType_index_0[i+1]]
+	case i == 4:
+		return _AccessLevelExType_name_1
+	case i == 8:
+		return _AccessLevelExType_name_2
+	case i == 16:
+		return _AccessLevelExType_name_3
+	case i == 32:
+		return _AccessLevelExType_name_4
+	case i == 64:
+		return _AccessLevelExType_name_5
+	case i == 256:
+		return _AccessLevelExType_name_6
+	case i == 512:
+		return _AccessLevelExType_name_7
+	case i == 1024:
+		return _AccessLevelExType_name_8
+	default:
+		return "AccessLevelExType(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[EventNotifierTypeNone-0]
+	_ = x[EventNotifierTypeSubscribeToEvents-1]
+	_ = x[EventNotifierTypeHistoryRead-4]
+	_ = x[EventNotifierTypeHistoryWrite-8]
+}
+
+const (
+	_EventNotifierType_name_0 = "EventNotifierTypeNoneEventNotifierTypeSubscribeToEvents"
+	_EventNotifierType_name_1 = "EventNotifierTypeHistoryRead"
+	_EventNotifierType_name_2 = "EventNotifierTypeHistoryWrite"
+)
+
+var (
+	_EventNotifierType_index_0 = [...]uint8{0, 21, 55}
+)
+
+func (i EventNotifierType) String() string {
+	switch {
+	case 0 <= i && i <= 1:
+		return _EventNotifierType_name_0[_EventNotifierType_index_0[i]:_EventNotifierType_index_0[i+1]]
+	case i == 4:
+		return _EventNotifierType_name_1
+	case i == 8:
+		return _EventNotifierType_name_2
+	default:
+		return "EventNotifierType(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[StructureTypeStructure-0]
+	_ = x[StructureTypeStructureWithOptionalFields-1]
+	_ = x[StructureTypeUnion-2]
+}
+
+const _StructureType_name = "StructureTypeStructureStructureTypeStructureWithOptionalFieldsStructureTypeUnion"
+
+var _StructureType_index = [...]uint8{0, 22, 62, 80}
+
+func (i StructureType) String() string {
+	if i >= StructureType(len(_StructureType_index)-1) {
+		return "StructureType(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _StructureType_name[_StructureType_index[i]:_StructureType_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[ApplicationTypeServer-0]
+	_ = x[ApplicationTypeClient-1]
+	_ = x[ApplicationTypeClientAndServer-2]
+	_ = x[ApplicationTypeDiscoveryServer-3]
+}
+
+const _ApplicationType_name = "ApplicationTypeServerApplicationTypeClientApplicationTypeClientAndServerApplicationTypeDiscoveryServer"
+
+var _ApplicationType_index = [...]uint8{0, 21, 42, 72, 102}
+
+func (i ApplicationType) String() string {
+	if i >= ApplicationType(len(_ApplicationType_index)-1) {
+		return "ApplicationType(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _ApplicationType_name[_ApplicationType_index[i]:_ApplicationType_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[MessageSecurityModeInvalid-0]
+	_ = x[MessageSecurityModeNone-1]
+	_ = x[MessageSecurityModeSign-2]
+	_ = x[MessageSecurityModeSignAndEncrypt-3]
+}
+
+const _MessageSecurityMode_name = "MessageSecurityModeInvalidMessageSecurityModeNoneMessageSecurityModeSignMessageSecurityModeSignAndEncrypt"
+
+var _MessageSecurityMode_index = [...]uint8{0, 26, 49, 72, 105}
+
+func (i MessageSecurityMode) String() string {
+	if i >= MessageSecurityMode(len(_MessageSecurityMode_index)-1) {
+		return "MessageSecurityMode(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _MessageSecurityMode_name[_MessageSecurityMode_index[i]:_MessageSecurityMode_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[UserTokenTypeAnonymous-0]
+	_ = x[UserTokenTypeUserName-1]
+	_ = x[UserTokenTypeCertificate-2]
+	_ = x[UserTokenTypeIssuedToken-3]
+}
+
+const _UserTokenType_name = "UserTokenTypeAnonymousUserTokenTypeUserNameUserTokenTypeCertificateUserTokenTypeIssuedToken"
+
+var _UserTokenType_index = [...]uint8{0, 22, 43, 67, 91}
+
+func (i UserTokenType) String() string {
+	if i >= UserTokenType(len(_UserTokenType_index)-1) {
+		return "UserTokenType(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _UserTokenType_name[_UserTokenType_index[i]:_UserTokenType_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[SecurityTokenRequestTypeIssue-0]
+	_ = x[SecurityTokenRequestTypeRenew-1]
+}
+
+const _SecurityTokenRequestType_name = "SecurityTokenRequestTypeIssueSecurityTokenRequestTypeRenew"
+
+var _SecurityTokenRequestType_index = [...]uint8{0, 29, 58}
+
+func (i SecurityTokenRequestType) String() string {
+	if i >= SecurityTokenRequestType(len(_SecurityTokenRequestType_index)-1) {
+		return "SecurityTokenRequestType(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _SecurityTokenRequestType_name[_SecurityTokenRequestType_index[i]:_SecurityTokenRequestType_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[NodeAttributesMaskNone-0]
+	_ = x[NodeAttributesMaskAccessLevel-1]
+	_ = x[NodeAttributesMaskArrayDimensions-2]
+	_ = x[NodeAttributesMaskBrowseName-4]
+	_ = x[NodeAttributesMaskContainsNoLoops-8]
+	_ = x[NodeAttributesMaskDataType-16]
+	_ = x[NodeAttributesMaskDescription-32]
+	_ = x[NodeAttributesMaskDisplayName-64]
+	_ = x[NodeAttributesMaskEventNotifier-128]
+	_ = x[NodeAttributesMaskExecutable-256]
+	_ = x[NodeAttributesMaskHistorizing-512]
+	_ = x[NodeAttributesMaskInverseName-1024]
+	_ = x[NodeAttributesMaskIsAbstract-2048]
+	_ = x[NodeAttributesMaskMinimumSamplingInterval-4096]
+	_ = x[NodeAttributesMaskNodeClass-8192]
+	_ = x[NodeAttributesMaskNodeID-16384]
+	_ = x[NodeAttributesMaskSymmetric-32768]
+	_ = x[NodeAttributesMaskUserAccessLevel-65536]
+	_ = x[NodeAttributesMaskUserExecutable-131072]
+	_ = x[NodeAttributesMaskUserWriteMask-262144]
+	_ = x[NodeAttributesMaskValueRank-524288]
+	_ = x[NodeAttributesMaskWriteMask-1048576]
+	_ = x[NodeAttributesMaskValue-2097152]
+	_ = x[NodeAttributesMaskDataTypeDefinition-4194304]
+	_ = x[NodeAttributesMaskRolePermissions-8388608]
+	_ = x[NodeAttributesMaskAccessRestrictions-16777216]
+	_ = x[NodeAttributesMaskAll-33554431]
+	_ = x[NodeAttributesMaskBaseNode-26501220]
+	_ = x[NodeAttributesMaskObject-26501348]
+	_ = x[NodeAttributesMaskObjectType-26503268]
+	_ = x[NodeAttributesMaskVariable-26571383]
+	_ = x[NodeAttributesMaskVariableType-28600438]
+	_ = x[NodeAttributesMaskMethod-26632548]
+	_ = x[NodeAttributesMaskReferenceType-26537060]
+	_ = x[NodeAttributesMaskView-26501356]
+}
+
+const _NodeAttributesMask_name = "NodeAttributesMaskNoneNodeAttributesMaskAccessLevelNodeAttributesMaskArrayDimensionsNodeAttributesMaskBrowseNameNodeAttributesMaskContainsNoLoopsNodeAttributesMaskDataTypeNodeAttributesMaskDescriptionNodeAttributesMaskDisplayNameNodeAttributesMaskEventNotifierNodeAttributesMaskExecutableNodeAttributesMaskHistorizingNodeAttributesMaskInverseNameNodeAttributesMaskIsAbstractNodeAttributesMaskMinimumSamplingIntervalNodeAttributesMaskNodeClassNodeAttributesMaskNodeIDNodeAttributesMaskSymmetricNodeAttributesMaskUserAccessLevelNodeAttributesMaskUserExecutableNodeAttributesMaskUserWriteMaskNodeAttributesMaskValueRankNodeAttributesMaskWriteMaskNodeAttributesMaskValueNodeAttributesMaskDataTypeDefinitionNodeAttributesMaskRolePermissionsNodeAttributesMaskAccessRestrictionsNodeAttributesMaskBaseNodeNodeAttributesMaskObjectNodeAttributesMaskViewNodeAttributesMaskObjectTypeNodeAttributesMaskReferenceTypeNodeAttributesMaskVariableNodeAttributesMaskMethodNodeAttributesMaskVariableTypeNodeAttributesMaskAll"
+
+var _NodeAttributesMask_map = map[NodeAttributesMask]string{
+	0:        _NodeAttributesMask_name[0:22],
+	1:        _NodeAttributesMask_name[22:51],
+	2:        _NodeAttributesMask_name[51:84],
+	4:        _NodeAttributesMask_name[84:112],
+	8:        _NodeAttributesMask_name[112:145],
+	16:       _NodeAttributesMask_name[145:171],
+	32:       _NodeAttributesMask_name[171:200],
+	64:       _NodeAttributesMask_name[200:229],
+	128:      _NodeAttributesMask_name[229:260],
+	256:      _NodeAttributesMask_name[260:288],
+	512:      _NodeAttributesMask_name[288:317],
+	1024:     _NodeAttributesMask_name[317:346],
+	2048:     _NodeAttributesMask_name[346:374],
+	4096:     _NodeAttributesMask_name[374:415],
+	8192:     _NodeAttributesMask_name[415:442],
+	16384:    _NodeAttributesMask_name[442:466],
+	32768:    _NodeAttributesMask_name[466:493],
+	65536:    _NodeAttributesMask_name[493:526],
+	131072:   _NodeAttributesMask_name[526:558],
+	262144:   _NodeAttributesMask_name[558:589],
+	524288:   _NodeAttributesMask_name[589:616],
+	1048576:  _NodeAttributesMask_name[616:643],
+	2097152:  _NodeAttributesMask_name[643:666],
+	4194304:  _NodeAttributesMask_name[666:702],
+	8388608:  _NodeAttributesMask_name[702:735],
+	16777216: _NodeAttributesMask_name[735:771],
+	26501220: _NodeAttributesMask_name[771:797],
+	26501348: _NodeAttributesMask_name[797:821],
+	26501356: _NodeAttributesMask_name[821:843],
+	26503268: _NodeAttributesMask_name[843:871],
+	26537060: _NodeAttributesMask_name[871:902],
+	26571383: _NodeAttributesMask_name[902:928],
+	26632548: _NodeAttributesMask_name[928:952],
+	28600438: _NodeAttributesMask_name[952:982],
+	33554431: _NodeAttributesMask_name[982:1003],
+}
+
+func (i NodeAttributesMask) String() string {
+	if str, ok := _NodeAttributesMask_map[i]; ok {
+		return str
+	}
+	return "NodeAttributesMask(" + strconv.FormatInt(int64(i), 10) + ")"
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[AttributeWriteMaskNone-0]
+	_ = x[AttributeWriteMaskAccessLevel-1]
+	_ = x[AttributeWriteMaskArrayDimensions-2]
+	_ = x[AttributeWriteMaskBrowseName-4]
+	_ = x[AttributeWriteMaskContainsNoLoops-8]
+	_ = x[AttributeWriteMaskDataType-16]
+	_ = x[AttributeWriteMaskDescription-32]
+	_ = x[AttributeWriteMaskDisplayName-64]
+	_ = x[AttributeWriteMaskEventNotifier-128]
+	_ = x[AttributeWriteMaskExecutable-256]
+	_ = x[AttributeWriteMaskHistorizing-512]
+	_ = x[AttributeWriteMaskInverseName-1024]
+	_ = x[AttributeWriteMaskIsAbstract-2048]
+	_ = x[AttributeWriteMaskMinimumSamplingInterval-4096]
+	_ = x[AttributeWriteMaskNodeClass-8192]
+	_ = x[AttributeWriteMaskNodeID-16384]
+	_ = x[AttributeWriteMaskSymmetric-32768]
+	_ = x[AttributeWriteMaskUserAccessLevel-65536]
+	_ = x[AttributeWriteMaskUserExecutable-131072]
+	_ = x[AttributeWriteMaskUserWriteMask-262144]
+	_ = x[AttributeWriteMaskValueRank-524288]
+	_ = x[AttributeWriteMaskWriteMask-1048576]
+	_ = x[AttributeWriteMaskValueForVariableType-2097152]
+	_ = x[AttributeWriteMaskDataTypeDefinition-4194304]
+	_ = x[AttributeWriteMaskRolePermissions-8388608]
+	_ = x[AttributeWriteMaskAccessRestrictions-16777216]
+	_ = x[AttributeWriteMaskAccessLevelEx-33554432]
+}
+
+const _AttributeWriteMask_name = "AttributeWriteMaskNoneAttributeWriteMaskAccessLevelAttributeWriteMaskArrayDimensionsAttributeWriteMaskBrowseNameAttributeWriteMaskContainsNoLoopsAttributeWriteMaskDataTypeAttributeWriteMaskDescriptionAttributeWriteMaskDisplayNameAttributeWriteMaskEventNotifierAttributeWriteMaskExecutableAttributeWriteMaskHistorizingAttributeWriteMaskInverseNameAttributeWriteMaskIsAbstractAttributeWriteMaskMinimumSamplingIntervalAttributeWriteMaskNodeClassAttributeWriteMaskNodeIDAttributeWriteMaskSymmetricAttributeWriteMaskUserAccessLevelAttributeWriteMaskUserExecutableAttributeWriteMaskUserWriteMaskAttributeWriteMaskValueRankAttributeWriteMaskWriteMaskAttributeWriteMaskValueForVariableTypeAttributeWriteMaskDataTypeDefinitionAttributeWriteMaskRolePermissionsAttributeWriteMaskAccessRestrictionsAttributeWriteMaskAccessLevelEx"
+
+var _AttributeWriteMask_map = map[AttributeWriteMask]string{
+	0:        _AttributeWriteMask_name[0:22],
+	1:        _AttributeWriteMask_name[22:51],
+	2:        _AttributeWriteMask_name[51:84],
+	4:        _AttributeWriteMask_name[84:112],
+	8:        _AttributeWriteMask_name[112:145],
+	16:       _AttributeWriteMask_name[145:171],
+	32:       _AttributeWriteMask_name[171:200],
+	64:       _AttributeWriteMask_name[200:229],
+	128:      _AttributeWriteMask_name[229:260],
+	256:      _AttributeWriteMask_name[260:288],
+	512:      _AttributeWriteMask_name[288:317],
+	1024:     _AttributeWriteMask_name[317:346],
+	2048:     _AttributeWriteMask_name[346:374],
+	4096:     _AttributeWriteMask_name[374:415],
+	8192:     _AttributeWriteMask_name[415:442],
+	16384:    _AttributeWriteMask_name[442:466],
+	32768:    _AttributeWriteMask_name[466:493],
+	65536:    _AttributeWriteMask_name[493:526],
+	131072:   _AttributeWriteMask_name[526:558],
+	262144:   _AttributeWriteMask_name[558:589],
+	524288:   _AttributeWriteMask_name[589:616],
+	1048576:  _AttributeWriteMask_name[616:643],
+	2097152:  _AttributeWriteMask_name[643:681],
+	4194304:  _AttributeWriteMask_name[681:717],
+	8388608:  _AttributeWriteMask_name[717:750],
+	16777216: _AttributeWriteMask_name[750:786],
+	33554432: _AttributeWriteMask_name[786:817],
+}
+
+func (i AttributeWriteMask) String() string {
+	if str, ok := _AttributeWriteMask_map[i]; ok {
+		return str
+	}
+	return "AttributeWriteMask(" + strconv.FormatInt(int64(i), 10) + ")"
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[BrowseDirectionForward-0]
+	_ = x[BrowseDirectionInverse-1]
+	_ = x[BrowseDirectionBoth-2]
+	_ = x[BrowseDirectionInvalid-3]
+}
+
+const _BrowseDirection_name = "BrowseDirectionForwardBrowseDirectionInverseBrowseDirectionBothBrowseDirectionInvalid"
+
+var _BrowseDirection_index = [...]uint8{0, 22, 44, 63, 85}
+
+func (i BrowseDirection) String() string {
+	if i >= BrowseDirection(len(_BrowseDirection_index)-1) {
+		return "BrowseDirection(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _BrowseDirection_name[_BrowseDirection_index[i]:_BrowseDirection_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[BrowseResultMaskNone-0]
+	_ = x[BrowseResultMaskReferenceTypeID-1]
+	_ = x[BrowseResultMaskIsForward-2]
+	_ = x[BrowseResultMaskNodeClass-4]
+	_ = x[BrowseResultMaskBrowseName-8]
+	_ = x[BrowseResultMaskDisplayName-16]
+	_ = x[BrowseResultMaskTypeDefinition-32]
+	_ = x[BrowseResultMaskAll-63]
+	_ = x[BrowseResultMaskReferenceTypeInfo-3]
+	_ = x[BrowseResultMaskTargetInfo-60]
+}
+
+const (
+	_BrowseResultMask_name_0 = "BrowseResultMaskNoneBrowseResultMaskReferenceTypeIDBrowseResultMaskIsForwardBrowseResultMaskReferenceTypeInfoBrowseResultMaskNodeClass"
+	_BrowseResultMask_name_1 = "BrowseResultMaskBrowseName"
+	_BrowseResultMask_name_2 = "BrowseResultMaskDisplayName"
+	_BrowseResultMask_name_3 = "BrowseResultMaskTypeDefinition"
+	_BrowseResultMask_name_4 = "BrowseResultMaskTargetInfo"
+	_BrowseResultMask_name_5 = "BrowseResultMaskAll"
+)
+
+var (
+	_BrowseResultMask_index_0 = [...]uint8{0, 20, 51, 76, 109, 134}
+)
+
+func (i BrowseResultMask) String() string {
+	switch {
+	case 0 <= i && i <= 4:
+		return _BrowseResultMask_name_0[_BrowseResultMask_index_0[i]:_BrowseResultMask_index_0[i+1]]
+	case i == 8:
+		return _BrowseResultMask_name_1
+	case i == 16:
+		return _BrowseResultMask_name_2
+	case i == 32:
+		return _BrowseResultMask_name_3
+	case i == 60:
+		return _BrowseResultMask_name_4
+	case i == 63:
+		return _BrowseResultMask_name_5
+	default:
+		return "BrowseResultMask(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[FilterOperatorEquals-0]
+	_ = x[FilterOperatorIsNull-1]
+	_ = x[FilterOperatorGreaterThan-2]
+	_ = x[FilterOperatorLessThan-3]
+	_ = x[FilterOperatorGreaterThanOrEqual-4]
+	_ = x[FilterOperatorLessThanOrEqual-5]
+	_ = x[FilterOperatorLike-6]
+	_ = x[FilterOperatorNot-7]
+	_ = x[FilterOperatorBetween-8]
+	_ = x[FilterOperatorInList-9]
+	_ = x[FilterOperatorAnd-10]
+	_ = x[FilterOperatorOr-11]
+	_ = x[FilterOperatorCast-12]
+	_ = x[FilterOperatorInView-13]
+	_ = x[FilterOperatorOfType-14]
+	_ = x[FilterOperatorRelatedTo-15]
+	_ = x[FilterOperatorBitwiseAnd-16]
+	_ = x[FilterOperatorBitwiseOr-17]
+}
+
+const _FilterOperator_name = "FilterOperatorEqualsFilterOperatorIsNullFilterOperatorGreaterThanFilterOperatorLessThanFilterOperatorGreaterThanOrEqualFilterOperatorLessThanOrEqualFilterOperatorLikeFilterOperatorNotFilterOperatorBetweenFilterOperatorInListFilterOperatorAndFilterOperatorOrFilterOperatorCastFilterOperatorInViewFilterOperatorOfTypeFilterOperatorRelatedToFilterOperatorBitwiseAndFilterOperatorBitwiseOr"
+
+var _FilterOperator_index = [...]uint16{0, 20, 40, 65, 87, 119, 148, 166, 183, 204, 224, 241, 257, 275, 295, 315, 338, 362, 385}
+
+func (i FilterOperator) String() string {
+	if i >= FilterOperator(len(_FilterOperator_index)-1) {
+		return "FilterOperator(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _FilterOperator_name[_FilterOperator_index[i]:_FilterOperator_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[TimestampsToReturnSource-0]
+	_ = x[TimestampsToReturnServer-1]
+	_ = x[TimestampsToReturnBoth-2]
+	_ = x[TimestampsToReturnNeither-3]
+	_ = x[TimestampsToReturnInvalid-4]
+}
+
+const _TimestampsToReturn_name = "TimestampsToReturnSourceTimestampsToReturnServerTimestampsToReturnBothTimestampsToReturnNeitherTimestampsToReturnInvalid"
+
+var _TimestampsToReturn_index = [...]uint8{0, 24, 48, 70, 95, 120}
+
+func (i TimestampsToReturn) String() string {
+	if i >= TimestampsToReturn(len(_TimestampsToReturn_index)-1) {
+		return "TimestampsToReturn(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _TimestampsToReturn_name[_TimestampsToReturn_index[i]:_TimestampsToReturn_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[HistoryUpdateTypeInsert-1]
+	_ = x[HistoryUpdateTypeReplace-2]
+	_ = x[HistoryUpdateTypeUpdate-3]
+	_ = x[HistoryUpdateTypeDelete-4]
+}
+
+const _HistoryUpdateType_name = "HistoryUpdateTypeInsertHistoryUpdateTypeReplaceHistoryUpdateTypeUpdateHistoryUpdateTypeDelete"
+
+var _HistoryUpdateType_index = [...]uint8{0, 23, 47, 70, 93}
+
+func (i HistoryUpdateType) String() string {
+	i -= 1
+	if i >= HistoryUpdateType(len(_HistoryUpdateType_index)-1) {
+		return "HistoryUpdateType(" + strconv.FormatInt(int64(i+1), 10) + ")"
+	}
+	return _HistoryUpdateType_name[_HistoryUpdateType_index[i]:_HistoryUpdateType_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[PerformUpdateTypeInsert-1]
+	_ = x[PerformUpdateTypeReplace-2]
+	_ = x[PerformUpdateTypeUpdate-3]
+	_ = x[PerformUpdateTypeRemove-4]
+}
+
+const _PerformUpdateType_name = "PerformUpdateTypeInsertPerformUpdateTypeReplacePerformUpdateTypeUpdatePerformUpdateTypeRemove"
+
+var _PerformUpdateType_index = [...]uint8{0, 23, 47, 70, 93}
+
+func (i PerformUpdateType) String() string {
+	i -= 1
+	if i >= PerformUpdateType(len(_PerformUpdateType_index)-1) {
+		return "PerformUpdateType(" + strconv.FormatInt(int64(i+1), 10) + ")"
+	}
+	return _PerformUpdateType_name[_PerformUpdateType_index[i]:_PerformUpdateType_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[MonitoringModeDisabled-0]
+	_ = x[MonitoringModeSampling-1]
+	_ = x[MonitoringModeReporting-2]
+}
+
+const _MonitoringMode_name = "MonitoringModeDisabledMonitoringModeSamplingMonitoringModeReporting"
+
+var _MonitoringMode_index = [...]uint8{0, 22, 44, 67}
+
+func (i MonitoringMode) String() string {
+	if i >= MonitoringMode(len(_MonitoringMode_index)-1) {
+		return "MonitoringMode(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _MonitoringMode_name[_MonitoringMode_index[i]:_MonitoringMode_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[DataChangeTriggerStatus-0]
+	_ = x[DataChangeTriggerStatusValue-1]
+	_ = x[DataChangeTriggerStatusValueTimestamp-2]
+}
+
+const _DataChangeTrigger_name = "DataChangeTriggerStatusDataChangeTriggerStatusValueDataChangeTriggerStatusValueTimestamp"
+
+var _DataChangeTrigger_index = [...]uint8{0, 23, 51, 88}
+
+func (i DataChangeTrigger) String() string {
+	if i >= DataChangeTrigger(len(_DataChangeTrigger_index)-1) {
+		return "DataChangeTrigger(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _DataChangeTrigger_name[_DataChangeTrigger_index[i]:_DataChangeTrigger_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[DeadbandTypeNone-0]
+	_ = x[DeadbandTypeAbsolute-1]
+	_ = x[DeadbandTypePercent-2]
+}
+
+const _DeadbandType_name = "DeadbandTypeNoneDeadbandTypeAbsoluteDeadbandTypePercent"
+
+var _DeadbandType_index = [...]uint8{0, 16, 36, 55}
+
+func (i DeadbandType) String() string {
+	if i >= DeadbandType(len(_DeadbandType_index)-1) {
+		return "DeadbandType(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _DeadbandType_name[_DeadbandType_index[i]:_DeadbandType_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[RedundancySupportNone-0]
+	_ = x[RedundancySupportCold-1]
+	_ = x[RedundancySupportWarm-2]
+	_ = x[RedundancySupportHot-3]
+	_ = x[RedundancySupportTransparent-4]
+	_ = x[RedundancySupportHotAndMirrored-5]
+}
+
+const _RedundancySupport_name = "RedundancySupportNoneRedundancySupportColdRedundancySupportWarmRedundancySupportHotRedundancySupportTransparentRedundancySupportHotAndMirrored"
+
+var _RedundancySupport_index = [...]uint8{0, 21, 42, 63, 83, 111, 142}
+
+func (i RedundancySupport) String() string {
+	if i >= RedundancySupport(len(_RedundancySupport_index)-1) {
+		return "RedundancySupport(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _RedundancySupport_name[_RedundancySupport_index[i]:_RedundancySupport_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[ServerStateRunning-0]
+	_ = x[ServerStateFailed-1]
+	_ = x[ServerStateNoConfiguration-2]
+	_ = x[ServerStateSuspended-3]
+	_ = x[ServerStateShutdown-4]
+	_ = x[ServerStateTest-5]
+	_ = x[ServerStateCommunicationFault-6]
+	_ = x[ServerStateUnknown-7]
+}
+
+const _ServerState_name = "ServerStateRunningServerStateFailedServerStateNoConfigurationServerStateSuspendedServerStateShutdownServerStateTestServerStateCommunicationFaultServerStateUnknown"
+
+var _ServerState_index = [...]uint8{0, 18, 35, 61, 81, 100, 115, 144, 162}
+
+func (i ServerState) String() string {
+	if i >= ServerState(len(_ServerState_index)-1) {
+		return "ServerState(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _ServerState_name[_ServerState_index[i]:_ServerState_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[ModelChangeStructureVerbMaskNodeAdded-1]
+	_ = x[ModelChangeStructureVerbMaskNodeDeleted-2]
+	_ = x[ModelChangeStructureVerbMaskReferenceAdded-4]
+	_ = x[ModelChangeStructureVerbMaskReferenceDeleted-8]
+	_ = x[ModelChangeStructureVerbMaskDataTypeChanged-16]
+}
+
+const (
+	_ModelChangeStructureVerbMask_name_0 = "ModelChangeStructureVerbMaskNodeAddedModelChangeStructureVerbMaskNodeDeleted"
+	_ModelChangeStructureVerbMask_name_1 = "ModelChangeStructureVerbMaskReferenceAdded"
+	_ModelChangeStructureVerbMask_name_2 = "ModelChangeStructureVerbMaskReferenceDeleted"
+	_ModelChangeStructureVerbMask_name_3 = "ModelChangeStructureVerbMaskDataTypeChanged"
+)
+
+var (
+	_ModelChangeStructureVerbMask_index_0 = [...]uint8{0, 37, 76}
+)
+
+func (i ModelChangeStructureVerbMask) String() string {
+	switch {
+	case 1 <= i && i <= 2:
+		i -= 1
+		return _ModelChangeStructureVerbMask_name_0[_ModelChangeStructureVerbMask_index_0[i]:_ModelChangeStructureVerbMask_index_0[i+1]]
+	case i == 4:
+		return _ModelChangeStructureVerbMask_name_1
+	case i == 8:
+		return _ModelChangeStructureVerbMask_name_2
+	case i == 16:
+		return _ModelChangeStructureVerbMask_name_3
+	default:
+		return "ModelChangeStructureVerbMask(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[AxisScaleEnumerationLinear-0]
+	_ = x[AxisScaleEnumerationLog-1]
+	_ = x[AxisScaleEnumerationLn-2]
+}
+
+const _AxisScaleEnumeration_name = "AxisScaleEnumerationLinearAxisScaleEnumerationLogAxisScaleEnumerationLn"
+
+var _AxisScaleEnumeration_index = [...]uint8{0, 26, 49, 71}
+
+func (i AxisScaleEnumeration) String() string {
+	if i >= AxisScaleEnumeration(len(_AxisScaleEnumeration_index)-1) {
+		return "AxisScaleEnumeration(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _AxisScaleEnumeration_name[_AxisScaleEnumeration_index[i]:_AxisScaleEnumeration_index[i+1]]
+}
+func _() {
+	// An "invalid array index" compiler error signifies that the constant values have changed.
+	// Re-run the stringer command to generate them again.
+	var x [1]struct{}
+	_ = x[ExceptionDeviationFormatAbsoluteValue-0]
+	_ = x[ExceptionDeviationFormatPercentOfValue-1]
+	_ = x[ExceptionDeviationFormatPercentOfRange-2]
+	_ = x[ExceptionDeviationFormatPercentOfEURange-3]
+	_ = x[ExceptionDeviationFormatUnknown-4]
+}
+
+const _ExceptionDeviationFormat_name = "ExceptionDeviationFormatAbsoluteValueExceptionDeviationFormatPercentOfValueExceptionDeviationFormatPercentOfRangeExceptionDeviationFormatPercentOfEURangeExceptionDeviationFormatUnknown"
+
+var _ExceptionDeviationFormat_index = [...]uint8{0, 37, 75, 113, 153, 184}
+
+func (i ExceptionDeviationFormat) String() string {
+	if i >= ExceptionDeviationFormat(len(_ExceptionDeviationFormat_index)-1) {
+		return "ExceptionDeviationFormat(" + strconv.FormatInt(int64(i), 10) + ")"
+	}
+	return _ExceptionDeviationFormat_name[_ExceptionDeviationFormat_index[i]:_ExceptionDeviationFormat_index[i+1]]
+}
diff --git a/ua/extobjs_gen.go b/ua/extobjs_gen.go
index 6fb164d..12d073c 100644
--- a/ua/extobjs_gen.go
+++ b/ua/extobjs_gen.go
@@ -129,7 +129,7 @@ type PublishedDataSetDataType struct {
 
 type PublishedVariableDataType struct {
 	PublishedVariable    *NodeID
-	AttributeID          uint32
+	AttributeID          AttributeID
 	SamplingIntervalHint float64
 	DeadbandType         uint32
 	DeadbandValue        float64
@@ -251,7 +251,7 @@ type FieldTargetDataType struct {
 	DataSetFieldID        *GUID
 	ReceiverIndexRange    string
 	TargetNodeID          *NodeID
-	AttributeID           uint32
+	AttributeID           AttributeID
 	WriteIndexRange       string
 	OverrideValueHandling OverrideValueHandling
 	OverrideValue         *Variant
@@ -958,7 +958,7 @@ type ViewAttributes struct {
 }
 
 type GenericAttributeValue struct {
-	AttributeID uint32
+	AttributeID AttributeID
 	Value       *Variant
 }
 
@@ -1178,7 +1178,7 @@ type EndpointConfiguration struct {
 
 type QueryDataDescription struct {
 	RelativePath *RelativePath
-	AttributeID  uint32
+	AttributeID  AttributeID
 	IndexRange   string
 }
 
@@ -1222,14 +1222,14 @@ type AttributeOperand struct {
 	NodeID      *NodeID
 	Alias       string
 	BrowsePath  *RelativePath
-	AttributeID uint32
+	AttributeID AttributeID
 	IndexRange  string
 }
 
 type SimpleAttributeOperand struct {
 	TypeDefinitionID *NodeID
 	BrowsePath       []*QualifiedName
-	AttributeID      uint32
+	AttributeID      AttributeID
 	IndexRange       string
 }
 
@@ -1282,7 +1282,7 @@ type QueryNextResponse struct {
 
 type ReadValueID struct {
 	NodeID       *NodeID
-	AttributeID  uint32
+	AttributeID  AttributeID
 	IndexRange   string
 	DataEncoding *QualifiedName
 }
@@ -1376,7 +1376,7 @@ type HistoryReadResponse struct {
 
 type WriteValue struct {
 	NodeID      *NodeID
-	AttributeID uint32
+	AttributeID AttributeID
 	IndexRange  string
 	Value       *DataValue
 }
diff --git a/ua/service.go b/ua/service.go
index 1d9e53d..d638283 100644
--- a/ua/service.go
+++ b/ua/service.go
@@ -28,7 +28,7 @@ func register(typeID uint16, v interface{}) {
 	serviceTypeID[typ] = typeID
 }
 
-func TypeID(v interface{}) uint16 {
+func ServiceTypeID(v interface{}) uint16 {
 	return serviceTypeID[reflect.TypeOf(v)]
 }
 
diff --git a/ua/status_gen.go b/ua/status_gen.go
index c5d1d1a..87a34f3 100644
--- a/ua/status_gen.go
+++ b/ua/status_gen.go
@@ -13,7 +13,7 @@ type StatusCode uint32
 
 func (n StatusCode) Error() string {
 	if d, ok := StatusCodes[n]; ok {
-		return fmt.Sprintf("%s: %s (0x%X)", d.Name, d.Text, uint32(n))
+		return fmt.Sprintf("%s %s (0x%X)", d.Text, d.Name, uint32(n))
 	}
 	return fmt.Sprintf("0x%X", uint32(n))
 }
diff --git a/ua/variant.go b/ua/variant.go
index 5587947..e6be9d5 100644
--- a/ua/variant.go
+++ b/ua/variant.go
@@ -64,8 +64,13 @@ func MustVariant(v interface{}) *Variant {
 	return va
 }
 
-func (m *Variant) TypeID() byte {
-	return m.EncodingMask & 0x3f
+// Type returns the type id of the value.
+func (m *Variant) Type() TypeID {
+	return TypeID(m.EncodingMask & 0x3f)
+}
+
+func (m *Variant) setType(t TypeID) {
+	m.EncodingMask = byte(t & 0x3f)
 }
 
 func (m *Variant) Has(mask byte) bool {
@@ -85,74 +90,73 @@ func (m *Variant) Decode(b []byte) (int, error) {
 
 	values := make([]interface{}, elems)
 	for i := 0; i < elems; i++ {
-		mask := m.EncodingMask & 0x3f
-		switch mask {
-		case TypeBoolean:
+		switch m.Type() {
+		case TypeIDBoolean:
 			values[i] = buf.ReadBool()
-		case TypeSByte:
+		case TypeIDSByte:
 			values[i] = buf.ReadInt8()
-		case TypeByte:
+		case TypeIDByte:
 			values[i] = buf.ReadByte()
-		case TypeInt16:
+		case TypeIDInt16:
 			values[i] = buf.ReadInt16()
-		case TypeUint16:
+		case TypeIDUint16:
 			values[i] = buf.ReadUint16()
-		case TypeInt32:
+		case TypeIDInt32:
 			values[i] = buf.ReadInt32()
-		case TypeUint32:
+		case TypeIDUint32:
 			values[i] = buf.ReadUint32()
-		case TypeInt64:
+		case TypeIDInt64:
 			values[i] = buf.ReadInt64()
-		case TypeUint64:
+		case TypeIDUint64:
 			values[i] = buf.ReadUint64()
-		case TypeFloat:
+		case TypeIDFloat:
 			values[i] = buf.ReadFloat32()
-		case TypeDouble:
+		case TypeIDDouble:
 			values[i] = buf.ReadFloat64()
-		case TypeString:
+		case TypeIDString:
 			values[i] = buf.ReadString()
-		case TypeDateTime:
+		case TypeIDDateTime:
 			values[i] = buf.ReadTime()
-		case TypeGuid:
+		case TypeIDGUID:
 			v := new(GUID)
 			buf.ReadStruct(v)
 			values[i] = v
-		case TypeByteString:
+		case TypeIDByteString:
 			values[i] = buf.ReadBytes()
-		case TypeXmlElement:
+		case TypeIDXMLElement:
 			values[i] = XmlElement(buf.ReadString())
-		case TypeNodeId:
+		case TypeIDNodeID:
 			v := new(NodeID)
 			buf.ReadStruct(v)
 			values[i] = v
-		case TypeExpandedNodeId:
+		case TypeIDExpandedNodeID:
 			v := new(ExpandedNodeID)
 			buf.ReadStruct(v)
 			values[i] = v
-		case TypeStatusCode:
+		case TypeIDStatusCode:
 			values[i] = StatusCode(buf.ReadUint32())
-		case TypeQualifiedName:
+		case TypeIDQualifiedName:
 			v := new(QualifiedName)
 			buf.ReadStruct(v)
 			values[i] = v
-		case TypeLocalizedText:
+		case TypeIDLocalizedText:
 			v := new(LocalizedText)
 			buf.ReadStruct(v)
 			values[i] = v
-		case TypeExtensionObject:
+		case TypeIDExtensionObject:
 			v := new(ExtensionObject)
 			buf.ReadStruct(v)
 			values[i] = v
-		case TypeDataValue:
+		case TypeIDDataValue:
 			v := new(DataValue)
 			buf.ReadStruct(v)
 			values[i] = v
-		case TypeVariant:
+		case TypeIDVariant:
 			// todo(fs): limit recursion depth to 100
 			v := new(Variant)
 			buf.ReadStruct(v)
 			values[i] = v
-		case TypeDiagnosticInfo:
+		case TypeIDDiagnosticInfo:
 			// todo(fs): limit recursion depth to 100
 			v := new(DiagnosticInfo)
 			buf.ReadStruct(v)
@@ -251,55 +255,55 @@ func (m *Variant) Encode() ([]byte, error) {
 func (m *Variant) Set(v interface{}) error {
 	switch v.(type) {
 	case bool:
-		m.EncodingMask = TypeBoolean
+		m.setType(TypeIDBoolean)
 	case int8:
-		m.EncodingMask = TypeSByte
+		m.setType(TypeIDSByte)
 	case byte:
-		m.EncodingMask = TypeByte
+		m.setType(TypeIDByte)
 	case int16:
-		m.EncodingMask = TypeInt16
+		m.setType(TypeIDInt16)
 	case uint16:
-		m.EncodingMask = TypeUint16
+		m.setType(TypeIDUint16)
 	case int32:
-		m.EncodingMask = TypeInt32
+		m.setType(TypeIDInt32)
 	case uint32:
-		m.EncodingMask = TypeUint32
+		m.setType(TypeIDUint32)
 	case int64:
-		m.EncodingMask = TypeInt64
+		m.setType(TypeIDInt64)
 	case uint64:
-		m.EncodingMask = TypeUint64
+		m.setType(TypeIDUint64)
 	case float32:
-		m.EncodingMask = TypeFloat
+		m.setType(TypeIDFloat)
 	case float64:
-		m.EncodingMask = TypeDouble
+		m.setType(TypeIDDouble)
 	case string:
-		m.EncodingMask = TypeString
+		m.setType(TypeIDString)
 	case time.Time:
-		m.EncodingMask = TypeDateTime
+		m.setType(TypeIDDateTime)
 	case *GUID:
-		m.EncodingMask = TypeGuid
+		m.setType(TypeIDGUID)
 	case []byte:
-		m.EncodingMask = TypeByteString
+		m.setType(TypeIDByteString)
 	case XmlElement:
-		m.EncodingMask = TypeXmlElement
+		m.setType(TypeIDXMLElement)
 	case *NodeID:
-		m.EncodingMask = TypeNodeId
+		m.setType(TypeIDNodeID)
 	case *ExpandedNodeID:
-		m.EncodingMask = TypeExpandedNodeId
+		m.setType(TypeIDExpandedNodeID)
 	case StatusCode:
-		m.EncodingMask = TypeStatusCode
+		m.setType(TypeIDStatusCode)
 	case *QualifiedName:
-		m.EncodingMask = TypeQualifiedName
+		m.setType(TypeIDQualifiedName)
 	case *LocalizedText:
-		m.EncodingMask = TypeLocalizedText
+		m.setType(TypeIDLocalizedText)
 	case *ExtensionObject:
-		m.EncodingMask = TypeExtensionObject
+		m.setType(TypeIDExtensionObject)
 	case *DataValue:
-		m.EncodingMask = TypeDataValue
+		m.setType(TypeIDDataValue)
 	case *Variant:
-		m.EncodingMask = TypeVariant
+		m.setType(TypeIDVariant)
 	case *DiagnosticInfo:
-		m.EncodingMask = TypeDiagnosticInfo
+		m.setType(TypeIDDiagnosticInfo)
 	default:
 		return fmt.Errorf("opcua: cannot set variant to %T", v)
 	}
@@ -308,12 +312,12 @@ func (m *Variant) Set(v interface{}) error {
 }
 
 func (m *Variant) String() string {
-	switch m.TypeID() {
-	case TypeString:
+	switch m.Type() {
+	case TypeIDString:
 		return m.Value.(string)
-	case TypeLocalizedText:
+	case TypeIDLocalizedText:
 		return m.Value.(*LocalizedText).Text
-	case TypeQualifiedName:
+	case TypeIDQualifiedName:
 		return m.Value.(*QualifiedName).Name
 	default:
 		return fmt.Sprintf("%v", m.Value)
@@ -321,8 +325,8 @@ func (m *Variant) String() string {
 }
 
 func (m *Variant) Bool() bool {
-	switch m.TypeID() {
-	case TypeBoolean:
+	switch m.Type() {
+	case TypeIDBoolean:
 		return m.Value.(bool)
 	default:
 		return false
@@ -330,10 +334,10 @@ func (m *Variant) Bool() bool {
 }
 
 func (m *Variant) Float() float64 {
-	switch m.TypeID() {
-	case TypeFloat:
+	switch m.Type() {
+	case TypeIDFloat:
 		return float64(m.Value.(float32))
-	case TypeDouble:
+	case TypeIDDouble:
 		return m.Value.(float64)
 	default:
 		return 0
@@ -341,14 +345,14 @@ func (m *Variant) Float() float64 {
 }
 
 func (m *Variant) Int() int64 {
-	switch m.TypeID() {
-	case TypeSByte:
+	switch m.Type() {
+	case TypeIDSByte:
 		return int64(m.Value.(int8))
-	case TypeUint16:
+	case TypeIDUint16:
 		return int64(m.Value.(int16))
-	case TypeUint32:
+	case TypeIDUint32:
 		return int64(m.Value.(int32))
-	case TypeUint64:
+	case TypeIDUint64:
 		return m.Value.(int64)
 	default:
 		return 0
@@ -356,14 +360,14 @@ func (m *Variant) Int() int64 {
 }
 
 func (m *Variant) Uint() uint64 {
-	switch m.TypeID() {
-	case TypeByte:
+	switch m.Type() {
+	case TypeIDByte:
 		return uint64(m.Value.(byte))
-	case TypeUint16:
+	case TypeIDUint16:
 		return uint64(m.Value.(uint16))
-	case TypeUint32:
+	case TypeIDUint32:
 		return uint64(m.Value.(uint32))
-	case TypeUint64:
+	case TypeIDUint64:
 		return m.Value.(uint64)
 	default:
 		return 0
@@ -371,8 +375,8 @@ func (m *Variant) Uint() uint64 {
 }
 
 func (m *Variant) Time() time.Time {
-	switch m.TypeID() {
-	case TypeDateTime:
+	switch m.Type() {
+	case TypeIDDateTime:
 		return m.Value.(time.Time)
 	default:
 		return time.Time{}
diff --git a/uasc/secure_channel.go b/uasc/secure_channel.go
index e39b550..6dd1497 100644
--- a/uasc/secure_channel.go
+++ b/uasc/secure_channel.go
@@ -155,7 +155,7 @@ func (s *SecureChannel) Send(svc interface{}, h func(interface{}) error) error {
 // SendAsync sends the service request and returns a channel which will receive the
 // response when it arrives.
 func (s *SecureChannel) SendAsync(svc interface{}) (resp chan Response, err error) {
-	typeID := ua.TypeID(svc)
+	typeID := ua.ServiceTypeID(svc)
 	if typeID == 0 {
 		return nil, fmt.Errorf("unknown service %T. Did you call register?", svc)
 	}


Test patch:
diff --git a/ua/read_request_test.go b/ua/read_request_test.go
index ef6b8a5..90a0bed 100644
--- a/ua/read_request_test.go
+++ b/ua/read_request_test.go
@@ -28,7 +28,7 @@ func TestReadRequest(t *testing.T) {
 				NodesToRead: []*ReadValueID{
 					&ReadValueID{
 						NodeID:       NewFourByteNodeID(0, 2256),
-						AttributeID:  IntegerIDValue,
+						AttributeID:  AttributeIDValue,
 						DataEncoding: &QualifiedName{},
 					},
 				},
diff --git a/ua/read_value_id_test.go b/ua/read_value_id_test.go
index 6e8be0f..945dc2e 100644
--- a/ua/read_value_id_test.go
+++ b/ua/read_value_id_test.go
@@ -14,7 +14,7 @@ func TestReadValueID(t *testing.T) {
 			Name: "Normal",
 			Struct: &ReadValueID{
 				NodeID:       NewFourByteNodeID(0, 2256),
-				AttributeID:  IntegerIDValue,
+				AttributeID:  AttributeIDValue,
 				DataEncoding: &QualifiedName{},
 			},
 			Bytes: []byte{
@@ -50,17 +50,17 @@ func TestReadValueIDArray(t *testing.T) {
 			Struct: []*ReadValueID{
 				&ReadValueID{
 					NodeID:       NewStringNodeID(1, "Temperature"),
-					AttributeID:  IntegerIDNodeClass,
+					AttributeID:  AttributeIDNodeClass,
 					DataEncoding: &QualifiedName{},
 				},
 				&ReadValueID{
 					NodeID:       NewStringNodeID(1, "Temperature"),
-					AttributeID:  IntegerIDBrowseName,
+					AttributeID:  AttributeIDBrowseName,
 					DataEncoding: &QualifiedName{},
 				},
 				&ReadValueID{
 					NodeID:       NewStringNodeID(1, "Temperature"),
-					AttributeID:  IntegerIDDisplayName,
+					AttributeID:  AttributeIDDisplayName,
 					DataEncoding: &QualifiedName{},
 				},
 			},
diff --git a/ua/write_request_test.go b/ua/write_request_test.go
index 6dbab61..4c945e4 100644
--- a/ua/write_request_test.go
+++ b/ua/write_request_test.go
@@ -26,7 +26,7 @@ func TestWriteRequest(t *testing.T) {
 				NodesToWrite: []*WriteValue{
 					&WriteValue{
 						NodeID:      NewFourByteNodeID(0, 2256),
-						AttributeID: IntegerIDValue,
+						AttributeID: AttributeIDValue,
 						Value: &DataValue{
 							EncodingMask:    DataValueValue | DataValueSourceTimestamp | DataValueServerTimestamp,
 							Value:           MustVariant(float32(2.50017)),
@@ -84,7 +84,7 @@ func TestWriteRequest(t *testing.T) {
 				NodesToWrite: []*WriteValue{
 					&WriteValue{
 						NodeID:      NewFourByteNodeID(0, 2256),
-						AttributeID: IntegerIDValue,
+						AttributeID: AttributeIDValue,
 						Value: &DataValue{
 							EncodingMask:    DataValueValue | DataValueSourceTimestamp | DataValueServerTimestamp,
 							Value:           MustVariant(float32(2.50017)),
@@ -94,7 +94,7 @@ func TestWriteRequest(t *testing.T) {
 					},
 					&WriteValue{
 						NodeID:      NewFourByteNodeID(0, 2256),
-						AttributeID: IntegerIDValue,
+						AttributeID: AttributeIDValue,
 						Value: &DataValue{
 							EncodingMask:    DataValueValue | DataValueSourceTimestamp | DataValueServerTimestamp,
 							Value:           MustVariant(float32(2.50017)),
diff --git a/ua/write_value_test.go b/ua/write_value_test.go
index 3906b03..918ba8a 100644
--- a/ua/write_value_test.go
+++ b/ua/write_value_test.go
@@ -15,7 +15,7 @@ func TestWriteValue(t *testing.T) {
 			Name: "normal",
 			Struct: &WriteValue{
 				NodeID:      NewFourByteNodeID(0, 2256),
-				AttributeID: IntegerIDValue,
+				AttributeID: AttributeIDValue,
 				Value: &DataValue{
 					EncodingMask:    DataValueValue | DataValueSourceTimestamp | DataValueServerTimestamp,
 					Value:           MustVariant(float32(2.50017)),
@@ -48,7 +48,7 @@ func TestWriteValueArray(t *testing.T) {
 			Struct: []*WriteValue{
 				&WriteValue{
 					NodeID:      NewFourByteNodeID(0, 2256),
-					AttributeID: IntegerIDValue,
+					AttributeID: AttributeIDValue,
 					Value: &DataValue{
 						EncodingMask:    DataValueValue | DataValueSourceTimestamp | DataValueServerTimestamp,
 						Value:           MustVariant(float32(2.50017)),
@@ -58,7 +58,7 @@ func TestWriteValueArray(t *testing.T) {
 				},
 				&WriteValue{
 					NodeID:      NewFourByteNodeID(0, 2256),
-					AttributeID: IntegerIDValue,
+					AttributeID: AttributeIDValue,
 					Value: &DataValue{
 						EncodingMask:    DataValueValue | DataValueSourceTimestamp | DataValueServerTimestamp,
 						Value:           MustVariant(float32(2.50017)),