Skip to main content

opcua/types/
status_codes.rs

1// OPCUA for Rust
2// SPDX-License-Identifier: MPL-2.0
3// Copyright (C) 2017-2022 Adam Lock
4
5// This file was autogenerated from Opc.Ua.StatusCodes.csv by tools/schema/gen_status_codes.js
6// DO NOT EDIT THIS FILE
7#![allow(non_upper_case_globals)]
8#![allow(unused_attributes)]
9
10use std::str::FromStr;
11
12// This file contains the machine-generated values of StatusCode. Refer to status_code.rs for the hand implemented
13// components.
14
15bitflags! {
16    pub struct StatusCode: u32 {
17        // The UPPERCASE values are bitflags. The PascalCase values are OPC UA Status codes.
18
19        // Mask for the status code section
20        const STATUS_MASK = 0xffff_0000;
21        // Mask for the bits section
22        const BIT_MASK = 0x0000_ffff;
23
24        // Flag for an error / uncertain code
25        const IS_ERROR                = 0x8000_0000;
26        const IS_UNCERTAIN            = 0x4000_0000;
27
28        // Historian bits 0:4
29        const HISTORICAL_RAW          = 0x0000_0000;
30        const HISTORICAL_CALCULATED   = 0x0000_0001;
31        const HISTORICAL_INTERPOLATED = 0x0000_0002;
32        const HISTORICAL_RESERVED     = 0x0000_0003;
33        const HISTORICAL_PARTIAL      = 0x0000_0004;
34        const HISTORICAL_EXTRA_DATA   = 0x0000_0008;
35        const HISTORICAL_MULTI_VALUE  = 0x0000_0010;
36        // Overflow bit 7
37        const OVERFLOW                = 0x0000_0080;
38        // Limit bits 8:9
39        const LIMIT_LOW               = 0x0000_0100;
40        const LIMIT_HIGH              = 0x0000_0200;
41        const LIMIT_CONSTANT          = 0x0000_0300;
42        // Info type bits 10:11
43        const LIMIT_DATA_VALUE        = 0x0000_2000;
44        // Semantics changed bit 14
45        const SEMANTICS_CHANGED       = 0x0000_4000;
46        // Semantics changed bit 15
47        const STRUCTURE_CHANGED       = 0x0000_8000;
48
49        // Actual status codes follow here
50        const Good = 0;
51        const GoodSubscriptionTransferred = 0x002D_0000;
52        const GoodCompletesAsynchronously = 0x002E_0000;
53        const GoodOverload = 0x002F_0000;
54        const GoodClamped = 0x0030_0000;
55        const GoodLocalOverride = 0x0096_0000;
56        const GoodEntryInserted = 0x00A2_0000;
57        const GoodEntryReplaced = 0x00A3_0000;
58        const GoodNoData = 0x00A5_0000;
59        const GoodMoreData = 0x00A6_0000;
60        const GoodCommunicationEvent = 0x00A7_0000;
61        const GoodShutdownEvent = 0x00A8_0000;
62        const GoodCallAgain = 0x00A9_0000;
63        const GoodNonCriticalTimeout = 0x00AA_0000;
64        const GoodResultsMayBeIncomplete = 0x00BA_0000;
65        const GoodDataIgnored = 0x00D9_0000;
66        const GoodEdited = 0x00DC_0000;
67        const GoodPostActionFailed = 0x00DD_0000;
68        const GoodDependentValueChanged = 0x00E0_0000;
69        const GoodEdited_DependentValueChanged = 0x0116_0000;
70        const GoodEdited_DominantValueChanged = 0x0117_0000;
71        const GoodEdited_DominantValueChanged_DependentValueChanged = 0x0118_0000;
72        const UncertainReferenceOutOfServer = 0x406C_0000;
73        const UncertainNoCommunicationLastUsableValue = 0x408F_0000;
74        const UncertainLastUsableValue = 0x4090_0000;
75        const UncertainSubstituteValue = 0x4091_0000;
76        const UncertainInitialValue = 0x4092_0000;
77        const UncertainSensorNotAccurate = 0x4093_0000;
78        const UncertainEngineeringUnitsExceeded = 0x4094_0000;
79        const UncertainSubNormal = 0x4095_0000;
80        const UncertainDataSubNormal = 0x40A4_0000;
81        const UncertainReferenceNotDeleted = 0x40BC_0000;
82        const UncertainNotAllNodesAvailable = 0x40C0_0000;
83        const UncertainDominantValueChanged = 0x40DE_0000;
84        const UncertainDependentValueChanged = 0x40E2_0000;
85        const BadUnexpectedError = 0x8001_0000;
86        const BadInternalError = 0x8002_0000;
87        const BadOutOfMemory = 0x8003_0000;
88        const BadResourceUnavailable = 0x8004_0000;
89        const BadCommunicationError = 0x8005_0000;
90        const BadEncodingError = 0x8006_0000;
91        const BadDecodingError = 0x8007_0000;
92        const BadEncodingLimitsExceeded = 0x8008_0000;
93        const BadUnknownResponse = 0x8009_0000;
94        const BadTimeout = 0x800A_0000;
95        const BadServiceUnsupported = 0x800B_0000;
96        const BadShutdown = 0x800C_0000;
97        const BadServerNotConnected = 0x800D_0000;
98        const BadServerHalted = 0x800E_0000;
99        const BadNothingToDo = 0x800F_0000;
100        const BadTooManyOperations = 0x8010_0000;
101        const BadDataTypeIdUnknown = 0x8011_0000;
102        const BadCertificateInvalid = 0x8012_0000;
103        const BadSecurityChecksFailed = 0x8013_0000;
104        const BadCertificateTimeInvalid = 0x8014_0000;
105        const BadCertificateIssuerTimeInvalid = 0x8015_0000;
106        const BadCertificateHostNameInvalid = 0x8016_0000;
107        const BadCertificateUriInvalid = 0x8017_0000;
108        const BadCertificateUseNotAllowed = 0x8018_0000;
109        const BadCertificateIssuerUseNotAllowed = 0x8019_0000;
110        const BadCertificateUntrusted = 0x801A_0000;
111        const BadCertificateRevocationUnknown = 0x801B_0000;
112        const BadCertificateIssuerRevocationUnknown = 0x801C_0000;
113        const BadCertificateRevoked = 0x801D_0000;
114        const BadCertificateIssuerRevoked = 0x801E_0000;
115        const BadUserAccessDenied = 0x801F_0000;
116        const BadIdentityTokenInvalid = 0x8020_0000;
117        const BadIdentityTokenRejected = 0x8021_0000;
118        const BadSecureChannelIdInvalid = 0x8022_0000;
119        const BadInvalidTimestamp = 0x8023_0000;
120        const BadNonceInvalid = 0x8024_0000;
121        const BadSessionIdInvalid = 0x8025_0000;
122        const BadSessionClosed = 0x8026_0000;
123        const BadSessionNotActivated = 0x8027_0000;
124        const BadSubscriptionIdInvalid = 0x8028_0000;
125        const BadRequestHeaderInvalid = 0x802A_0000;
126        const BadTimestampsToReturnInvalid = 0x802B_0000;
127        const BadRequestCancelledByClient = 0x802C_0000;
128        const BadNoCommunication = 0x8031_0000;
129        const BadWaitingForInitialData = 0x8032_0000;
130        const BadNodeIdInvalid = 0x8033_0000;
131        const BadNodeIdUnknown = 0x8034_0000;
132        const BadAttributeIdInvalid = 0x8035_0000;
133        const BadIndexRangeInvalid = 0x8036_0000;
134        const BadIndexRangeNoData = 0x8037_0000;
135        const BadDataEncodingInvalid = 0x8038_0000;
136        const BadDataEncodingUnsupported = 0x8039_0000;
137        const BadNotReadable = 0x803A_0000;
138        const BadNotWritable = 0x803B_0000;
139        const BadOutOfRange = 0x803C_0000;
140        const BadNotSupported = 0x803D_0000;
141        const BadNotFound = 0x803E_0000;
142        const BadObjectDeleted = 0x803F_0000;
143        const BadNotImplemented = 0x8040_0000;
144        const BadMonitoringModeInvalid = 0x8041_0000;
145        const BadMonitoredItemIdInvalid = 0x8042_0000;
146        const BadMonitoredItemFilterInvalid = 0x8043_0000;
147        const BadMonitoredItemFilterUnsupported = 0x8044_0000;
148        const BadFilterNotAllowed = 0x8045_0000;
149        const BadStructureMissing = 0x8046_0000;
150        const BadEventFilterInvalid = 0x8047_0000;
151        const BadContentFilterInvalid = 0x8048_0000;
152        const BadFilterOperandInvalid = 0x8049_0000;
153        const BadContinuationPointInvalid = 0x804A_0000;
154        const BadNoContinuationPoints = 0x804B_0000;
155        const BadReferenceTypeIdInvalid = 0x804C_0000;
156        const BadBrowseDirectionInvalid = 0x804D_0000;
157        const BadNodeNotInView = 0x804E_0000;
158        const BadServerUriInvalid = 0x804F_0000;
159        const BadServerNameMissing = 0x8050_0000;
160        const BadDiscoveryUrlMissing = 0x8051_0000;
161        const BadSempahoreFileMissing = 0x8052_0000;
162        const BadRequestTypeInvalid = 0x8053_0000;
163        const BadSecurityModeRejected = 0x8054_0000;
164        const BadSecurityPolicyRejected = 0x8055_0000;
165        const BadTooManySessions = 0x8056_0000;
166        const BadUserSignatureInvalid = 0x8057_0000;
167        const BadApplicationSignatureInvalid = 0x8058_0000;
168        const BadNoValidCertificates = 0x8059_0000;
169        const BadRequestCancelledByRequest = 0x805A_0000;
170        const BadParentNodeIdInvalid = 0x805B_0000;
171        const BadReferenceNotAllowed = 0x805C_0000;
172        const BadNodeIdRejected = 0x805D_0000;
173        const BadNodeIdExists = 0x805E_0000;
174        const BadNodeClassInvalid = 0x805F_0000;
175        const BadBrowseNameInvalid = 0x8060_0000;
176        const BadBrowseNameDuplicated = 0x8061_0000;
177        const BadNodeAttributesInvalid = 0x8062_0000;
178        const BadTypeDefinitionInvalid = 0x8063_0000;
179        const BadSourceNodeIdInvalid = 0x8064_0000;
180        const BadTargetNodeIdInvalid = 0x8065_0000;
181        const BadDuplicateReferenceNotAllowed = 0x8066_0000;
182        const BadInvalidSelfReference = 0x8067_0000;
183        const BadReferenceLocalOnly = 0x8068_0000;
184        const BadNoDeleteRights = 0x8069_0000;
185        const BadServerIndexInvalid = 0x806A_0000;
186        const BadViewIdUnknown = 0x806B_0000;
187        const BadTooManyMatches = 0x806D_0000;
188        const BadQueryTooComplex = 0x806E_0000;
189        const BadNoMatch = 0x806F_0000;
190        const BadMaxAgeInvalid = 0x8070_0000;
191        const BadHistoryOperationInvalid = 0x8071_0000;
192        const BadHistoryOperationUnsupported = 0x8072_0000;
193        const BadWriteNotSupported = 0x8073_0000;
194        const BadTypeMismatch = 0x8074_0000;
195        const BadMethodInvalid = 0x8075_0000;
196        const BadArgumentsMissing = 0x8076_0000;
197        const BadTooManySubscriptions = 0x8077_0000;
198        const BadTooManyPublishRequests = 0x8078_0000;
199        const BadNoSubscription = 0x8079_0000;
200        const BadSequenceNumberUnknown = 0x807A_0000;
201        const BadMessageNotAvailable = 0x807B_0000;
202        const BadInsufficientClientProfile = 0x807C_0000;
203        const BadTcpServerTooBusy = 0x807D_0000;
204        const BadTcpMessageTypeInvalid = 0x807E_0000;
205        const BadTcpSecureChannelUnknown = 0x807F_0000;
206        const BadTcpMessageTooLarge = 0x8080_0000;
207        const BadTcpNotEnoughResources = 0x8081_0000;
208        const BadTcpInternalError = 0x8082_0000;
209        const BadTcpEndpointUrlInvalid = 0x8083_0000;
210        const BadRequestInterrupted = 0x8084_0000;
211        const BadRequestTimeout = 0x8085_0000;
212        const BadSecureChannelClosed = 0x8086_0000;
213        const BadSecureChannelTokenUnknown = 0x8087_0000;
214        const BadSequenceNumberInvalid = 0x8088_0000;
215        const BadConfigurationError = 0x8089_0000;
216        const BadNotConnected = 0x808A_0000;
217        const BadDeviceFailure = 0x808B_0000;
218        const BadSensorFailure = 0x808C_0000;
219        const BadOutOfService = 0x808D_0000;
220        const BadDeadbandFilterInvalid = 0x808E_0000;
221        const BadRefreshInProgress = 0x8097_0000;
222        const BadConditionAlreadyDisabled = 0x8098_0000;
223        const BadConditionDisabled = 0x8099_0000;
224        const BadEventIdUnknown = 0x809A_0000;
225        const BadNoData = 0x809B_0000;
226        const BadDataLost = 0x809D_0000;
227        const BadDataUnavailable = 0x809E_0000;
228        const BadEntryExists = 0x809F_0000;
229        const BadNoEntryExists = 0x80A0_0000;
230        const BadTimestampNotSupported = 0x80A1_0000;
231        const BadInvalidArgument = 0x80AB_0000;
232        const BadConnectionRejected = 0x80AC_0000;
233        const BadDisconnect = 0x80AD_0000;
234        const BadConnectionClosed = 0x80AE_0000;
235        const BadInvalidState = 0x80AF_0000;
236        const BadEndOfStream = 0x80B0_0000;
237        const BadNoDataAvailable = 0x80B1_0000;
238        const BadWaitingForResponse = 0x80B2_0000;
239        const BadOperationAbandoned = 0x80B3_0000;
240        const BadExpectedStreamToBlock = 0x80B4_0000;
241        const BadWouldBlock = 0x80B5_0000;
242        const BadSyntaxError = 0x80B6_0000;
243        const BadMaxConnectionsReached = 0x80B7_0000;
244        const BadRequestTooLarge = 0x80B8_0000;
245        const BadResponseTooLarge = 0x80B9_0000;
246        const BadEventNotAcknowledgeable = 0x80BB_0000;
247        const BadInvalidTimestampArgument = 0x80BD_0000;
248        const BadProtocolVersionUnsupported = 0x80BE_0000;
249        const BadStateNotActive = 0x80BF_0000;
250        const BadFilterOperatorInvalid = 0x80C1_0000;
251        const BadFilterOperatorUnsupported = 0x80C2_0000;
252        const BadFilterOperandCountMismatch = 0x80C3_0000;
253        const BadFilterElementInvalid = 0x80C4_0000;
254        const BadFilterLiteralInvalid = 0x80C5_0000;
255        const BadIdentityChangeNotSupported = 0x80C6_0000;
256        const BadNotTypeDefinition = 0x80C8_0000;
257        const BadViewTimestampInvalid = 0x80C9_0000;
258        const BadViewParameterMismatch = 0x80CA_0000;
259        const BadViewVersionInvalid = 0x80CB_0000;
260        const BadConditionAlreadyEnabled = 0x80CC_0000;
261        const BadDialogNotActive = 0x80CD_0000;
262        const BadDialogResponseInvalid = 0x80CE_0000;
263        const BadConditionBranchAlreadyAcked = 0x80CF_0000;
264        const BadConditionBranchAlreadyConfirmed = 0x80D0_0000;
265        const BadConditionAlreadyShelved = 0x80D1_0000;
266        const BadConditionNotShelved = 0x80D2_0000;
267        const BadShelvingTimeOutOfRange = 0x80D3_0000;
268        const BadAggregateListMismatch = 0x80D4_0000;
269        const BadAggregateNotSupported = 0x80D5_0000;
270        const BadAggregateInvalidInputs = 0x80D6_0000;
271        const BadBoundNotFound = 0x80D7_0000;
272        const BadBoundNotSupported = 0x80D8_0000;
273        const BadAggregateConfigurationRejected = 0x80DA_0000;
274        const BadTooManyMonitoredItems = 0x80DB_0000;
275        const BadDominantValueChanged = 0x80E1_0000;
276        const BadDependentValueChanged = 0x80E3_0000;
277        const BadRequestNotAllowed = 0x80E4_0000;
278        const BadTooManyArguments = 0x80E5_0000;
279        const BadSecurityModeInsufficient = 0x80E6_0000;
280        const BadCertificateChainIncomplete = 0x810D_0000;
281        const BadLicenseExpired = 0x810E_0000;
282        const BadLicenseLimitsExceeded = 0x810F_0000;
283        const BadLicenseNotAvailable = 0x8110_0000;
284        const BadNotExecutable = 0x8111_0000;
285        const BadNumericOverflow = 0x8112_0000;
286        const BadRequestNotComplete = 0x8113_0000;
287        const BadCertificatePolicyCheckFailed = 0x8114_0000;
288        const BadAlreadyExists = 0x8115_0000;
289        const BadEdited_OutOfRange = 0x8119_0000;
290        const BadInitialValue_OutOfRange = 0x811A_0000;
291        const BadOutOfRange_DominantValueChanged = 0x811B_0000;
292        const BadEdited_OutOfRange_DominantValueChanged = 0x811C_0000;
293        const BadOutOfRange_DominantValueChanged_DependentValueChanged = 0x811D_0000;
294        const BadEdited_OutOfRange_DominantValueChanged_DependentValueChanged = 0x811E_0000;
295    }
296}
297
298impl StatusCode {
299    /// Returns the descriptive name for the status code, e.g. to put a meaningful code in a log file
300    pub fn name(self) -> &'static str {
301        match self.status() {
302            StatusCode::Good => "Good",
303            StatusCode::GoodSubscriptionTransferred => "GoodSubscriptionTransferred",
304            StatusCode::GoodCompletesAsynchronously => "GoodCompletesAsynchronously",
305            StatusCode::GoodOverload => "GoodOverload",
306            StatusCode::GoodClamped => "GoodClamped",
307            StatusCode::GoodLocalOverride => "GoodLocalOverride",
308            StatusCode::GoodEntryInserted => "GoodEntryInserted",
309            StatusCode::GoodEntryReplaced => "GoodEntryReplaced",
310            StatusCode::GoodNoData => "GoodNoData",
311            StatusCode::GoodMoreData => "GoodMoreData",
312            StatusCode::GoodCommunicationEvent => "GoodCommunicationEvent",
313            StatusCode::GoodShutdownEvent => "GoodShutdownEvent",
314            StatusCode::GoodCallAgain => "GoodCallAgain",
315            StatusCode::GoodNonCriticalTimeout => "GoodNonCriticalTimeout",
316            StatusCode::GoodResultsMayBeIncomplete => "GoodResultsMayBeIncomplete",
317            StatusCode::GoodDataIgnored => "GoodDataIgnored",
318            StatusCode::GoodEdited => "GoodEdited",
319            StatusCode::GoodPostActionFailed => "GoodPostActionFailed",
320            StatusCode::GoodDependentValueChanged => "GoodDependentValueChanged",
321            StatusCode::GoodEdited_DependentValueChanged => "GoodEdited_DependentValueChanged",
322            StatusCode::GoodEdited_DominantValueChanged => "GoodEdited_DominantValueChanged",
323            StatusCode::GoodEdited_DominantValueChanged_DependentValueChanged => {
324                "GoodEdited_DominantValueChanged_DependentValueChanged"
325            }
326            StatusCode::UncertainReferenceOutOfServer => "UncertainReferenceOutOfServer",
327            StatusCode::UncertainNoCommunicationLastUsableValue => {
328                "UncertainNoCommunicationLastUsableValue"
329            }
330            StatusCode::UncertainLastUsableValue => "UncertainLastUsableValue",
331            StatusCode::UncertainSubstituteValue => "UncertainSubstituteValue",
332            StatusCode::UncertainInitialValue => "UncertainInitialValue",
333            StatusCode::UncertainSensorNotAccurate => "UncertainSensorNotAccurate",
334            StatusCode::UncertainEngineeringUnitsExceeded => "UncertainEngineeringUnitsExceeded",
335            StatusCode::UncertainSubNormal => "UncertainSubNormal",
336            StatusCode::UncertainDataSubNormal => "UncertainDataSubNormal",
337            StatusCode::UncertainReferenceNotDeleted => "UncertainReferenceNotDeleted",
338            StatusCode::UncertainNotAllNodesAvailable => "UncertainNotAllNodesAvailable",
339            StatusCode::UncertainDominantValueChanged => "UncertainDominantValueChanged",
340            StatusCode::UncertainDependentValueChanged => "UncertainDependentValueChanged",
341            StatusCode::BadUnexpectedError => "BadUnexpectedError",
342            StatusCode::BadInternalError => "BadInternalError",
343            StatusCode::BadOutOfMemory => "BadOutOfMemory",
344            StatusCode::BadResourceUnavailable => "BadResourceUnavailable",
345            StatusCode::BadCommunicationError => "BadCommunicationError",
346            StatusCode::BadEncodingError => "BadEncodingError",
347            StatusCode::BadDecodingError => "BadDecodingError",
348            StatusCode::BadEncodingLimitsExceeded => "BadEncodingLimitsExceeded",
349            StatusCode::BadUnknownResponse => "BadUnknownResponse",
350            StatusCode::BadTimeout => "BadTimeout",
351            StatusCode::BadServiceUnsupported => "BadServiceUnsupported",
352            StatusCode::BadShutdown => "BadShutdown",
353            StatusCode::BadServerNotConnected => "BadServerNotConnected",
354            StatusCode::BadServerHalted => "BadServerHalted",
355            StatusCode::BadNothingToDo => "BadNothingToDo",
356            StatusCode::BadTooManyOperations => "BadTooManyOperations",
357            StatusCode::BadDataTypeIdUnknown => "BadDataTypeIdUnknown",
358            StatusCode::BadCertificateInvalid => "BadCertificateInvalid",
359            StatusCode::BadSecurityChecksFailed => "BadSecurityChecksFailed",
360            StatusCode::BadCertificateTimeInvalid => "BadCertificateTimeInvalid",
361            StatusCode::BadCertificateIssuerTimeInvalid => "BadCertificateIssuerTimeInvalid",
362            StatusCode::BadCertificateHostNameInvalid => "BadCertificateHostNameInvalid",
363            StatusCode::BadCertificateUriInvalid => "BadCertificateUriInvalid",
364            StatusCode::BadCertificateUseNotAllowed => "BadCertificateUseNotAllowed",
365            StatusCode::BadCertificateIssuerUseNotAllowed => "BadCertificateIssuerUseNotAllowed",
366            StatusCode::BadCertificateUntrusted => "BadCertificateUntrusted",
367            StatusCode::BadCertificateRevocationUnknown => "BadCertificateRevocationUnknown",
368            StatusCode::BadCertificateIssuerRevocationUnknown => {
369                "BadCertificateIssuerRevocationUnknown"
370            }
371            StatusCode::BadCertificateRevoked => "BadCertificateRevoked",
372            StatusCode::BadCertificateIssuerRevoked => "BadCertificateIssuerRevoked",
373            StatusCode::BadUserAccessDenied => "BadUserAccessDenied",
374            StatusCode::BadIdentityTokenInvalid => "BadIdentityTokenInvalid",
375            StatusCode::BadIdentityTokenRejected => "BadIdentityTokenRejected",
376            StatusCode::BadSecureChannelIdInvalid => "BadSecureChannelIdInvalid",
377            StatusCode::BadInvalidTimestamp => "BadInvalidTimestamp",
378            StatusCode::BadNonceInvalid => "BadNonceInvalid",
379            StatusCode::BadSessionIdInvalid => "BadSessionIdInvalid",
380            StatusCode::BadSessionClosed => "BadSessionClosed",
381            StatusCode::BadSessionNotActivated => "BadSessionNotActivated",
382            StatusCode::BadSubscriptionIdInvalid => "BadSubscriptionIdInvalid",
383            StatusCode::BadRequestHeaderInvalid => "BadRequestHeaderInvalid",
384            StatusCode::BadTimestampsToReturnInvalid => "BadTimestampsToReturnInvalid",
385            StatusCode::BadRequestCancelledByClient => "BadRequestCancelledByClient",
386            StatusCode::BadNoCommunication => "BadNoCommunication",
387            StatusCode::BadWaitingForInitialData => "BadWaitingForInitialData",
388            StatusCode::BadNodeIdInvalid => "BadNodeIdInvalid",
389            StatusCode::BadNodeIdUnknown => "BadNodeIdUnknown",
390            StatusCode::BadAttributeIdInvalid => "BadAttributeIdInvalid",
391            StatusCode::BadIndexRangeInvalid => "BadIndexRangeInvalid",
392            StatusCode::BadIndexRangeNoData => "BadIndexRangeNoData",
393            StatusCode::BadDataEncodingInvalid => "BadDataEncodingInvalid",
394            StatusCode::BadDataEncodingUnsupported => "BadDataEncodingUnsupported",
395            StatusCode::BadNotReadable => "BadNotReadable",
396            StatusCode::BadNotWritable => "BadNotWritable",
397            StatusCode::BadOutOfRange => "BadOutOfRange",
398            StatusCode::BadNotSupported => "BadNotSupported",
399            StatusCode::BadNotFound => "BadNotFound",
400            StatusCode::BadObjectDeleted => "BadObjectDeleted",
401            StatusCode::BadNotImplemented => "BadNotImplemented",
402            StatusCode::BadMonitoringModeInvalid => "BadMonitoringModeInvalid",
403            StatusCode::BadMonitoredItemIdInvalid => "BadMonitoredItemIdInvalid",
404            StatusCode::BadMonitoredItemFilterInvalid => "BadMonitoredItemFilterInvalid",
405            StatusCode::BadMonitoredItemFilterUnsupported => "BadMonitoredItemFilterUnsupported",
406            StatusCode::BadFilterNotAllowed => "BadFilterNotAllowed",
407            StatusCode::BadStructureMissing => "BadStructureMissing",
408            StatusCode::BadEventFilterInvalid => "BadEventFilterInvalid",
409            StatusCode::BadContentFilterInvalid => "BadContentFilterInvalid",
410            StatusCode::BadFilterOperandInvalid => "BadFilterOperandInvalid",
411            StatusCode::BadContinuationPointInvalid => "BadContinuationPointInvalid",
412            StatusCode::BadNoContinuationPoints => "BadNoContinuationPoints",
413            StatusCode::BadReferenceTypeIdInvalid => "BadReferenceTypeIdInvalid",
414            StatusCode::BadBrowseDirectionInvalid => "BadBrowseDirectionInvalid",
415            StatusCode::BadNodeNotInView => "BadNodeNotInView",
416            StatusCode::BadServerUriInvalid => "BadServerUriInvalid",
417            StatusCode::BadServerNameMissing => "BadServerNameMissing",
418            StatusCode::BadDiscoveryUrlMissing => "BadDiscoveryUrlMissing",
419            StatusCode::BadSempahoreFileMissing => "BadSempahoreFileMissing",
420            StatusCode::BadRequestTypeInvalid => "BadRequestTypeInvalid",
421            StatusCode::BadSecurityModeRejected => "BadSecurityModeRejected",
422            StatusCode::BadSecurityPolicyRejected => "BadSecurityPolicyRejected",
423            StatusCode::BadTooManySessions => "BadTooManySessions",
424            StatusCode::BadUserSignatureInvalid => "BadUserSignatureInvalid",
425            StatusCode::BadApplicationSignatureInvalid => "BadApplicationSignatureInvalid",
426            StatusCode::BadNoValidCertificates => "BadNoValidCertificates",
427            StatusCode::BadRequestCancelledByRequest => "BadRequestCancelledByRequest",
428            StatusCode::BadParentNodeIdInvalid => "BadParentNodeIdInvalid",
429            StatusCode::BadReferenceNotAllowed => "BadReferenceNotAllowed",
430            StatusCode::BadNodeIdRejected => "BadNodeIdRejected",
431            StatusCode::BadNodeIdExists => "BadNodeIdExists",
432            StatusCode::BadNodeClassInvalid => "BadNodeClassInvalid",
433            StatusCode::BadBrowseNameInvalid => "BadBrowseNameInvalid",
434            StatusCode::BadBrowseNameDuplicated => "BadBrowseNameDuplicated",
435            StatusCode::BadNodeAttributesInvalid => "BadNodeAttributesInvalid",
436            StatusCode::BadTypeDefinitionInvalid => "BadTypeDefinitionInvalid",
437            StatusCode::BadSourceNodeIdInvalid => "BadSourceNodeIdInvalid",
438            StatusCode::BadTargetNodeIdInvalid => "BadTargetNodeIdInvalid",
439            StatusCode::BadDuplicateReferenceNotAllowed => "BadDuplicateReferenceNotAllowed",
440            StatusCode::BadInvalidSelfReference => "BadInvalidSelfReference",
441            StatusCode::BadReferenceLocalOnly => "BadReferenceLocalOnly",
442            StatusCode::BadNoDeleteRights => "BadNoDeleteRights",
443            StatusCode::BadServerIndexInvalid => "BadServerIndexInvalid",
444            StatusCode::BadViewIdUnknown => "BadViewIdUnknown",
445            StatusCode::BadTooManyMatches => "BadTooManyMatches",
446            StatusCode::BadQueryTooComplex => "BadQueryTooComplex",
447            StatusCode::BadNoMatch => "BadNoMatch",
448            StatusCode::BadMaxAgeInvalid => "BadMaxAgeInvalid",
449            StatusCode::BadHistoryOperationInvalid => "BadHistoryOperationInvalid",
450            StatusCode::BadHistoryOperationUnsupported => "BadHistoryOperationUnsupported",
451            StatusCode::BadWriteNotSupported => "BadWriteNotSupported",
452            StatusCode::BadTypeMismatch => "BadTypeMismatch",
453            StatusCode::BadMethodInvalid => "BadMethodInvalid",
454            StatusCode::BadArgumentsMissing => "BadArgumentsMissing",
455            StatusCode::BadTooManySubscriptions => "BadTooManySubscriptions",
456            StatusCode::BadTooManyPublishRequests => "BadTooManyPublishRequests",
457            StatusCode::BadNoSubscription => "BadNoSubscription",
458            StatusCode::BadSequenceNumberUnknown => "BadSequenceNumberUnknown",
459            StatusCode::BadMessageNotAvailable => "BadMessageNotAvailable",
460            StatusCode::BadInsufficientClientProfile => "BadInsufficientClientProfile",
461            StatusCode::BadTcpServerTooBusy => "BadTcpServerTooBusy",
462            StatusCode::BadTcpMessageTypeInvalid => "BadTcpMessageTypeInvalid",
463            StatusCode::BadTcpSecureChannelUnknown => "BadTcpSecureChannelUnknown",
464            StatusCode::BadTcpMessageTooLarge => "BadTcpMessageTooLarge",
465            StatusCode::BadTcpNotEnoughResources => "BadTcpNotEnoughResources",
466            StatusCode::BadTcpInternalError => "BadTcpInternalError",
467            StatusCode::BadTcpEndpointUrlInvalid => "BadTcpEndpointUrlInvalid",
468            StatusCode::BadRequestInterrupted => "BadRequestInterrupted",
469            StatusCode::BadRequestTimeout => "BadRequestTimeout",
470            StatusCode::BadSecureChannelClosed => "BadSecureChannelClosed",
471            StatusCode::BadSecureChannelTokenUnknown => "BadSecureChannelTokenUnknown",
472            StatusCode::BadSequenceNumberInvalid => "BadSequenceNumberInvalid",
473            StatusCode::BadConfigurationError => "BadConfigurationError",
474            StatusCode::BadNotConnected => "BadNotConnected",
475            StatusCode::BadDeviceFailure => "BadDeviceFailure",
476            StatusCode::BadSensorFailure => "BadSensorFailure",
477            StatusCode::BadOutOfService => "BadOutOfService",
478            StatusCode::BadDeadbandFilterInvalid => "BadDeadbandFilterInvalid",
479            StatusCode::BadRefreshInProgress => "BadRefreshInProgress",
480            StatusCode::BadConditionAlreadyDisabled => "BadConditionAlreadyDisabled",
481            StatusCode::BadConditionDisabled => "BadConditionDisabled",
482            StatusCode::BadEventIdUnknown => "BadEventIdUnknown",
483            StatusCode::BadNoData => "BadNoData",
484            StatusCode::BadDataLost => "BadDataLost",
485            StatusCode::BadDataUnavailable => "BadDataUnavailable",
486            StatusCode::BadEntryExists => "BadEntryExists",
487            StatusCode::BadNoEntryExists => "BadNoEntryExists",
488            StatusCode::BadTimestampNotSupported => "BadTimestampNotSupported",
489            StatusCode::BadInvalidArgument => "BadInvalidArgument",
490            StatusCode::BadConnectionRejected => "BadConnectionRejected",
491            StatusCode::BadDisconnect => "BadDisconnect",
492            StatusCode::BadConnectionClosed => "BadConnectionClosed",
493            StatusCode::BadInvalidState => "BadInvalidState",
494            StatusCode::BadEndOfStream => "BadEndOfStream",
495            StatusCode::BadNoDataAvailable => "BadNoDataAvailable",
496            StatusCode::BadWaitingForResponse => "BadWaitingForResponse",
497            StatusCode::BadOperationAbandoned => "BadOperationAbandoned",
498            StatusCode::BadExpectedStreamToBlock => "BadExpectedStreamToBlock",
499            StatusCode::BadWouldBlock => "BadWouldBlock",
500            StatusCode::BadSyntaxError => "BadSyntaxError",
501            StatusCode::BadMaxConnectionsReached => "BadMaxConnectionsReached",
502            StatusCode::BadRequestTooLarge => "BadRequestTooLarge",
503            StatusCode::BadResponseTooLarge => "BadResponseTooLarge",
504            StatusCode::BadEventNotAcknowledgeable => "BadEventNotAcknowledgeable",
505            StatusCode::BadInvalidTimestampArgument => "BadInvalidTimestampArgument",
506            StatusCode::BadProtocolVersionUnsupported => "BadProtocolVersionUnsupported",
507            StatusCode::BadStateNotActive => "BadStateNotActive",
508            StatusCode::BadFilterOperatorInvalid => "BadFilterOperatorInvalid",
509            StatusCode::BadFilterOperatorUnsupported => "BadFilterOperatorUnsupported",
510            StatusCode::BadFilterOperandCountMismatch => "BadFilterOperandCountMismatch",
511            StatusCode::BadFilterElementInvalid => "BadFilterElementInvalid",
512            StatusCode::BadFilterLiteralInvalid => "BadFilterLiteralInvalid",
513            StatusCode::BadIdentityChangeNotSupported => "BadIdentityChangeNotSupported",
514            StatusCode::BadNotTypeDefinition => "BadNotTypeDefinition",
515            StatusCode::BadViewTimestampInvalid => "BadViewTimestampInvalid",
516            StatusCode::BadViewParameterMismatch => "BadViewParameterMismatch",
517            StatusCode::BadViewVersionInvalid => "BadViewVersionInvalid",
518            StatusCode::BadConditionAlreadyEnabled => "BadConditionAlreadyEnabled",
519            StatusCode::BadDialogNotActive => "BadDialogNotActive",
520            StatusCode::BadDialogResponseInvalid => "BadDialogResponseInvalid",
521            StatusCode::BadConditionBranchAlreadyAcked => "BadConditionBranchAlreadyAcked",
522            StatusCode::BadConditionBranchAlreadyConfirmed => "BadConditionBranchAlreadyConfirmed",
523            StatusCode::BadConditionAlreadyShelved => "BadConditionAlreadyShelved",
524            StatusCode::BadConditionNotShelved => "BadConditionNotShelved",
525            StatusCode::BadShelvingTimeOutOfRange => "BadShelvingTimeOutOfRange",
526            StatusCode::BadAggregateListMismatch => "BadAggregateListMismatch",
527            StatusCode::BadAggregateNotSupported => "BadAggregateNotSupported",
528            StatusCode::BadAggregateInvalidInputs => "BadAggregateInvalidInputs",
529            StatusCode::BadBoundNotFound => "BadBoundNotFound",
530            StatusCode::BadBoundNotSupported => "BadBoundNotSupported",
531            StatusCode::BadAggregateConfigurationRejected => "BadAggregateConfigurationRejected",
532            StatusCode::BadTooManyMonitoredItems => "BadTooManyMonitoredItems",
533            StatusCode::BadDominantValueChanged => "BadDominantValueChanged",
534            StatusCode::BadDependentValueChanged => "BadDependentValueChanged",
535            StatusCode::BadRequestNotAllowed => "BadRequestNotAllowed",
536            StatusCode::BadTooManyArguments => "BadTooManyArguments",
537            StatusCode::BadSecurityModeInsufficient => "BadSecurityModeInsufficient",
538            StatusCode::BadCertificateChainIncomplete => "BadCertificateChainIncomplete",
539            StatusCode::BadLicenseExpired => "BadLicenseExpired",
540            StatusCode::BadLicenseLimitsExceeded => "BadLicenseLimitsExceeded",
541            StatusCode::BadLicenseNotAvailable => "BadLicenseNotAvailable",
542            StatusCode::BadNotExecutable => "BadNotExecutable",
543            StatusCode::BadNumericOverflow => "BadNumericOverflow",
544            StatusCode::BadRequestNotComplete => "BadRequestNotComplete",
545            StatusCode::BadCertificatePolicyCheckFailed => "BadCertificatePolicyCheckFailed",
546            StatusCode::BadAlreadyExists => "BadAlreadyExists",
547            StatusCode::BadEdited_OutOfRange => "BadEdited_OutOfRange",
548            StatusCode::BadInitialValue_OutOfRange => "BadInitialValue_OutOfRange",
549            StatusCode::BadOutOfRange_DominantValueChanged => "BadOutOfRange_DominantValueChanged",
550            StatusCode::BadEdited_OutOfRange_DominantValueChanged => {
551                "BadEdited_OutOfRange_DominantValueChanged"
552            }
553            StatusCode::BadOutOfRange_DominantValueChanged_DependentValueChanged => {
554                "BadOutOfRange_DominantValueChanged_DependentValueChanged"
555            }
556            StatusCode::BadEdited_OutOfRange_DominantValueChanged_DependentValueChanged => {
557                "BadEdited_OutOfRange_DominantValueChanged_DependentValueChanged"
558            }
559            _ => "Unrecognized status code",
560        }
561    }
562
563    /// Returns the descriptive text for the status code
564    pub fn description(self) -> &'static str {
565        match self.status() {
566            StatusCode::Good => "Good",
567            StatusCode::GoodSubscriptionTransferred => "The subscription was transferred to another session.",
568            StatusCode::GoodCompletesAsynchronously => "The processing will complete asynchronously.",
569            StatusCode::GoodOverload => "Sampling has slowed down due to resource limitations.",
570            StatusCode::GoodClamped => "The value written was accepted but was clamped.",
571            StatusCode::GoodLocalOverride => "The value has been overridden.",
572            StatusCode::GoodEntryInserted => "The data or event was successfully inserted into the historical database.",
573            StatusCode::GoodEntryReplaced => "The data or event field was successfully replaced in the historical database.",
574            StatusCode::GoodNoData => "No data exists for the requested time range or event filter.",
575            StatusCode::GoodMoreData => "The data or event field was successfully replaced in the historical database.",
576            StatusCode::GoodCommunicationEvent => "The communication layer has raised an event.",
577            StatusCode::GoodShutdownEvent => "The system is shutting down.",
578            StatusCode::GoodCallAgain => "The operation is not finished and needs to be called again.",
579            StatusCode::GoodNonCriticalTimeout => "A non-critical timeout occurred.",
580            StatusCode::GoodResultsMayBeIncomplete => "The server should have followed a reference to a node in a remote server but did not. The result set may be incomplete.",
581            StatusCode::GoodDataIgnored => "The request specifies fields which are not valid for the EventType or cannot be saved by the historian.",
582            StatusCode::GoodEdited => "The value does not come from the real source and has been edited by the server.",
583            StatusCode::GoodPostActionFailed => "There was an error in execution of these post-actions.",
584            StatusCode::GoodDependentValueChanged => "A dependent value has been changed but the change has not been applied to the device.",
585            StatusCode::GoodEdited_DependentValueChanged => "It is delivered with a dominant Variable value when a dependent Variable has changed but the change has not been applied.",
586            StatusCode::GoodEdited_DominantValueChanged => "It is delivered with a dependent Variable value when a dominant Variable has changed but the change has not been applied.",
587            StatusCode::GoodEdited_DominantValueChanged_DependentValueChanged => "It is delivered with a dependent Variable value when a dominant or dependent Variable has changed but change has not been applied.",
588            StatusCode::UncertainReferenceOutOfServer => "One of the references to follow in the relative path references to a node in the address space in another server.",
589            StatusCode::UncertainNoCommunicationLastUsableValue => "Communication to the data source has failed. The variable value is the last value that had a good quality.",
590            StatusCode::UncertainLastUsableValue => "Whatever was updating this value has stopped doing so.",
591            StatusCode::UncertainSubstituteValue => "The value is an operational value that was manually overwritten.",
592            StatusCode::UncertainInitialValue => "The value is an initial value for a variable that normally receives its value from another variable.",
593            StatusCode::UncertainSensorNotAccurate => "The value is at one of the sensor limits.",
594            StatusCode::UncertainEngineeringUnitsExceeded => "The value is outside of the range of values defined for this parameter.",
595            StatusCode::UncertainSubNormal => "The value is derived from multiple sources and has less than the required number of Good sources.",
596            StatusCode::UncertainDataSubNormal => "The value is derived from multiple values and has less than the required number of Good values.",
597            StatusCode::UncertainReferenceNotDeleted => "The server was not able to delete all target references.",
598            StatusCode::UncertainNotAllNodesAvailable => "The list of references may not be complete because the underlying system is not available.",
599            StatusCode::UncertainDominantValueChanged => "The related EngineeringUnit has been changed but the Variable Value is still provided based on the previous unit.",
600            StatusCode::UncertainDependentValueChanged => "A dependent value has been changed but the change has not been applied to the device. The quality of the dominant variable is uncertain.",
601            StatusCode::BadUnexpectedError => "An unexpected error occurred.",
602            StatusCode::BadInternalError => "An internal error occurred as a result of a programming or configuration error.",
603            StatusCode::BadOutOfMemory => "Not enough memory to complete the operation.",
604            StatusCode::BadResourceUnavailable => "An operating system resource is not available.",
605            StatusCode::BadCommunicationError => "A low level communication error occurred.",
606            StatusCode::BadEncodingError => "Encoding halted because of invalid data in the objects being serialized.",
607            StatusCode::BadDecodingError => "Decoding halted because of invalid data in the stream.",
608            StatusCode::BadEncodingLimitsExceeded => "The message encoding/decoding limits imposed by the stack have been exceeded.",
609            StatusCode::BadUnknownResponse => "An unrecognized response was received from the server.",
610            StatusCode::BadTimeout => "The operation timed out.",
611            StatusCode::BadServiceUnsupported => "The server does not support the requested service.",
612            StatusCode::BadShutdown => "The operation was cancelled because the application is shutting down.",
613            StatusCode::BadServerNotConnected => "The operation could not complete because the client is not connected to the server.",
614            StatusCode::BadServerHalted => "The server has stopped and cannot process any requests.",
615            StatusCode::BadNothingToDo => "There was nothing to do because the client passed a list of operations with no elements.",
616            StatusCode::BadTooManyOperations => "The request could not be processed because it specified too many operations.",
617            StatusCode::BadDataTypeIdUnknown => "The extension object cannot be (de)serialized because the data type id is not recognized.",
618            StatusCode::BadCertificateInvalid => "The certificate provided as a parameter is not valid.",
619            StatusCode::BadSecurityChecksFailed => "An error occurred verifying security.",
620            StatusCode::BadCertificateTimeInvalid => "The certificate has expired or is not yet valid.",
621            StatusCode::BadCertificateIssuerTimeInvalid => "An issuer certificate has expired or is not yet valid.",
622            StatusCode::BadCertificateHostNameInvalid => "The HostName used to connect to a server does not match a HostName in the certificate.",
623            StatusCode::BadCertificateUriInvalid => "The URI specified in the ApplicationDescription does not match the URI in the certificate.",
624            StatusCode::BadCertificateUseNotAllowed => "The certificate may not be used for the requested operation.",
625            StatusCode::BadCertificateIssuerUseNotAllowed => "The issuer certificate may not be used for the requested operation.",
626            StatusCode::BadCertificateUntrusted => "The certificate is not trusted.",
627            StatusCode::BadCertificateRevocationUnknown => "It was not possible to determine if the certificate has been revoked.",
628            StatusCode::BadCertificateIssuerRevocationUnknown => "It was not possible to determine if the issuer certificate has been revoked.",
629            StatusCode::BadCertificateRevoked => "The certificate has been revoked.",
630            StatusCode::BadCertificateIssuerRevoked => "The issuer certificate has been revoked.",
631            StatusCode::BadUserAccessDenied => "User does not have permission to perform the requested operation.",
632            StatusCode::BadIdentityTokenInvalid => "The user identity token is not valid.",
633            StatusCode::BadIdentityTokenRejected => "The user identity token is valid but the server has rejected it.",
634            StatusCode::BadSecureChannelIdInvalid => "The specified secure channel is no longer valid.",
635            StatusCode::BadInvalidTimestamp => "The timestamp is outside the range allowed by the server.",
636            StatusCode::BadNonceInvalid => "The nonce does appear to be not a random value or it is not the correct length.",
637            StatusCode::BadSessionIdInvalid => "The session id is not valid.",
638            StatusCode::BadSessionClosed => "The session was closed by the client.",
639            StatusCode::BadSessionNotActivated => "The session cannot be used because ActivateSession has not been called.",
640            StatusCode::BadSubscriptionIdInvalid => "The subscription id is not valid.",
641            StatusCode::BadRequestHeaderInvalid => "The header for the request is missing or invalid.",
642            StatusCode::BadTimestampsToReturnInvalid => "The timestamps to return parameter is invalid.",
643            StatusCode::BadRequestCancelledByClient => "The request was cancelled by the client.",
644            StatusCode::BadNoCommunication => "Communication with the data source is defined, but not established, and there is no last known value available.",
645            StatusCode::BadWaitingForInitialData => "Waiting for the server to obtain values from the underlying data source.",
646            StatusCode::BadNodeIdInvalid => "The syntax of the node id is not valid.",
647            StatusCode::BadNodeIdUnknown => "The node id refers to a node that does not exist in the server address space.",
648            StatusCode::BadAttributeIdInvalid => "The attribute is not supported for the specified Node.",
649            StatusCode::BadIndexRangeInvalid => "The syntax of the index range parameter is invalid.",
650            StatusCode::BadIndexRangeNoData => "No data exists within the range of indexes specified.",
651            StatusCode::BadDataEncodingInvalid => "The data encoding is invalid.",
652            StatusCode::BadDataEncodingUnsupported => "The server does not support the requested data encoding for the node.",
653            StatusCode::BadNotReadable => "The access level does not allow reading or subscribing to the Node.",
654            StatusCode::BadNotWritable => "The access level does not allow writing to the Node.",
655            StatusCode::BadOutOfRange => "The value was out of range.",
656            StatusCode::BadNotSupported => "The requested operation is not supported.",
657            StatusCode::BadNotFound => "A requested item was not found or a search operation ended without success.",
658            StatusCode::BadObjectDeleted => "The object cannot be used because it has been deleted.",
659            StatusCode::BadNotImplemented => "Requested operation is not implemented.",
660            StatusCode::BadMonitoringModeInvalid => "The monitoring mode is invalid.",
661            StatusCode::BadMonitoredItemIdInvalid => "The monitoring item id does not refer to a valid monitored item.",
662            StatusCode::BadMonitoredItemFilterInvalid => "The monitored item filter parameter is not valid.",
663            StatusCode::BadMonitoredItemFilterUnsupported => "The server does not support the requested monitored item filter.",
664            StatusCode::BadFilterNotAllowed => "A monitoring filter cannot be used in combination with the attribute specified.",
665            StatusCode::BadStructureMissing => "A mandatory structured parameter was missing or null.",
666            StatusCode::BadEventFilterInvalid => "The event filter is not valid.",
667            StatusCode::BadContentFilterInvalid => "The content filter is not valid.",
668            StatusCode::BadFilterOperandInvalid => "The operand used in a content filter is not valid.",
669            StatusCode::BadContinuationPointInvalid => "The continuation point provide is longer valid.",
670            StatusCode::BadNoContinuationPoints => "The operation could not be processed because all continuation points have been allocated.",
671            StatusCode::BadReferenceTypeIdInvalid => "The reference type id does not refer to a valid reference type node.",
672            StatusCode::BadBrowseDirectionInvalid => "The browse direction is not valid.",
673            StatusCode::BadNodeNotInView => "The node is not part of the view.",
674            StatusCode::BadServerUriInvalid => "The ServerUri is not a valid URI.",
675            StatusCode::BadServerNameMissing => "No ServerName was specified.",
676            StatusCode::BadDiscoveryUrlMissing => "No DiscoveryUrl was specified.",
677            StatusCode::BadSempahoreFileMissing => "The semaphore file specified by the client is not valid.",
678            StatusCode::BadRequestTypeInvalid => "The security token request type is not valid.",
679            StatusCode::BadSecurityModeRejected => "The security mode does not meet the requirements set by the server.",
680            StatusCode::BadSecurityPolicyRejected => "The security policy does not meet the requirements set by the server.",
681            StatusCode::BadTooManySessions => "The server has reached its maximum number of sessions.",
682            StatusCode::BadUserSignatureInvalid => "The user token signature is missing or invalid.",
683            StatusCode::BadApplicationSignatureInvalid => "The signature generated with the client certificate is missing or invalid.",
684            StatusCode::BadNoValidCertificates => "The client did not provide at least one software certificate that is valid and meets the profile requirements for the server.",
685            StatusCode::BadRequestCancelledByRequest => "The request was cancelled by the client with the Cancel service.",
686            StatusCode::BadParentNodeIdInvalid => "The parent node id does not to refer to a valid node.",
687            StatusCode::BadReferenceNotAllowed => "The reference could not be created because it violates constraints imposed by the data model.",
688            StatusCode::BadNodeIdRejected => "The requested node id was reject because it was either invalid or server does not allow node ids to be specified by the client.",
689            StatusCode::BadNodeIdExists => "The requested node id is already used by another node.",
690            StatusCode::BadNodeClassInvalid => "The node class is not valid.",
691            StatusCode::BadBrowseNameInvalid => "The browse name is invalid.",
692            StatusCode::BadBrowseNameDuplicated => "The browse name is not unique among nodes that share the same relationship with the parent.",
693            StatusCode::BadNodeAttributesInvalid => "The node attributes are not valid for the node class.",
694            StatusCode::BadTypeDefinitionInvalid => "The type definition node id does not reference an appropriate type node.",
695            StatusCode::BadSourceNodeIdInvalid => "The source node id does not reference a valid node.",
696            StatusCode::BadTargetNodeIdInvalid => "The target node id does not reference a valid node.",
697            StatusCode::BadDuplicateReferenceNotAllowed => "The reference type between the nodes is already defined.",
698            StatusCode::BadInvalidSelfReference => "The server does not allow this type of self reference on this node.",
699            StatusCode::BadReferenceLocalOnly => "The reference type is not valid for a reference to a remote server.",
700            StatusCode::BadNoDeleteRights => "The server will not allow the node to be deleted.",
701            StatusCode::BadServerIndexInvalid => "The server index is not valid.",
702            StatusCode::BadViewIdUnknown => "The view id does not refer to a valid view node.",
703            StatusCode::BadTooManyMatches => "The requested operation has too many matches to return.",
704            StatusCode::BadQueryTooComplex => "The requested operation requires too many resources in the server.",
705            StatusCode::BadNoMatch => "The requested operation has no match to return.",
706            StatusCode::BadMaxAgeInvalid => "The max age parameter is invalid.",
707            StatusCode::BadHistoryOperationInvalid => "The history details parameter is not valid.",
708            StatusCode::BadHistoryOperationUnsupported => "The server does not support the requested operation.",
709            StatusCode::BadWriteNotSupported => "The server does not support writing the combination of value, status and timestamps provided.",
710            StatusCode::BadTypeMismatch => "The value supplied for the attribute is not of the same type as the attribute's value.",
711            StatusCode::BadMethodInvalid => "The method id does not refer to a method for the specified object.",
712            StatusCode::BadArgumentsMissing => "The client did not specify all of the input arguments for the method.",
713            StatusCode::BadTooManySubscriptions => "The server has reached its maximum number of subscriptions.",
714            StatusCode::BadTooManyPublishRequests => "The server has reached the maximum number of queued publish requests.",
715            StatusCode::BadNoSubscription => "There is no subscription available for this session.",
716            StatusCode::BadSequenceNumberUnknown => "The sequence number is unknown to the server.",
717            StatusCode::BadMessageNotAvailable => "The requested notification message is no longer available.",
718            StatusCode::BadInsufficientClientProfile => "The client of the current session does not support one or more Profiles that are necessary for the subscription.",
719            StatusCode::BadTcpServerTooBusy => "The server cannot process the request because it is too busy.",
720            StatusCode::BadTcpMessageTypeInvalid => "The type of the message specified in the header invalid.",
721            StatusCode::BadTcpSecureChannelUnknown => "The SecureChannelId and/or TokenId are not currently in use.",
722            StatusCode::BadTcpMessageTooLarge => "The size of the message specified in the header is too large.",
723            StatusCode::BadTcpNotEnoughResources => "There are not enough resources to process the request.",
724            StatusCode::BadTcpInternalError => "An internal error occurred.",
725            StatusCode::BadTcpEndpointUrlInvalid => "The server does not recognize the QueryString specified.",
726            StatusCode::BadRequestInterrupted => "The request could not be sent because of a network interruption.",
727            StatusCode::BadRequestTimeout => "Timeout occurred while processing the request.",
728            StatusCode::BadSecureChannelClosed => "The secure channel has been closed.",
729            StatusCode::BadSecureChannelTokenUnknown => "The token has expired or is not recognized.",
730            StatusCode::BadSequenceNumberInvalid => "The sequence number is not valid.",
731            StatusCode::BadConfigurationError => "There is a problem with the configuration that affects the usefulness of the value.",
732            StatusCode::BadNotConnected => "The variable should receive its value from another variable, but has never been configured to do so.",
733            StatusCode::BadDeviceFailure => "There has been a failure in the device/data source that generates the value that has affected the value.",
734            StatusCode::BadSensorFailure => "There has been a failure in the sensor from which the value is derived by the device/data source.",
735            StatusCode::BadOutOfService => "The source of the data is not operational.",
736            StatusCode::BadDeadbandFilterInvalid => "The deadband filter is not valid.",
737            StatusCode::BadRefreshInProgress => "This Condition refresh failed, a Condition refresh operation is already in progress.",
738            StatusCode::BadConditionAlreadyDisabled => "This condition has already been disabled.",
739            StatusCode::BadConditionDisabled => "Property not available, this condition is disabled.",
740            StatusCode::BadEventIdUnknown => "The specified event id is not recognized.",
741            StatusCode::BadNoData => "No data exists for the requested time range or event filter.",
742            StatusCode::BadDataLost => "Data is missing due to collection started/stopped/lost.",
743            StatusCode::BadDataUnavailable => "Expected data is unavailable for the requested time range due to an un-mounted volume, an off-line archive or tape, or similar reason for temporary unavailability.",
744            StatusCode::BadEntryExists => "The data or event was not successfully inserted because a matching entry exists.",
745            StatusCode::BadNoEntryExists => "The data or event was not successfully updated because no matching entry exists.",
746            StatusCode::BadTimestampNotSupported => "The client requested history using a timestamp format the server does not support (i.e requested ServerTimestamp when server only supports SourceTimestamp).",
747            StatusCode::BadInvalidArgument => "One or more arguments are invalid.",
748            StatusCode::BadConnectionRejected => "Could not establish a network connection to remote server.",
749            StatusCode::BadDisconnect => "The server has disconnected from the client.",
750            StatusCode::BadConnectionClosed => "The network connection has been closed.",
751            StatusCode::BadInvalidState => "The operation cannot be completed because the object is closed, uninitialized or in some other invalid state.",
752            StatusCode::BadEndOfStream => "Cannot move beyond end of the stream.",
753            StatusCode::BadNoDataAvailable => "No data is currently available for reading from a non-blocking stream.",
754            StatusCode::BadWaitingForResponse => "The asynchronous operation is waiting for a response.",
755            StatusCode::BadOperationAbandoned => "The asynchronous operation was abandoned by the caller.",
756            StatusCode::BadExpectedStreamToBlock => "The stream did not return all data requested (possibly because it is a non-blocking stream).",
757            StatusCode::BadWouldBlock => "Non blocking behaviour is required and the operation would block.",
758            StatusCode::BadSyntaxError => "A value had an invalid syntax.",
759            StatusCode::BadMaxConnectionsReached => "The operation could not be finished because all available connections are in use.",
760            StatusCode::BadRequestTooLarge => "The request message size exceeds limits set by the server.",
761            StatusCode::BadResponseTooLarge => "The response message size exceeds limits set by the client.",
762            StatusCode::BadEventNotAcknowledgeable => "The event cannot be acknowledged.",
763            StatusCode::BadInvalidTimestampArgument => "The defined timestamp to return was invalid.",
764            StatusCode::BadProtocolVersionUnsupported => "The applications do not have compatible protocol versions.",
765            StatusCode::BadStateNotActive => "The sub-state machine is not currently active.",
766            StatusCode::BadFilterOperatorInvalid => "An unrecognized operator was provided in a filter.",
767            StatusCode::BadFilterOperatorUnsupported => "A valid operator was provided, but the server does not provide support for this filter operator.",
768            StatusCode::BadFilterOperandCountMismatch => "The number of operands provided for the filter operator was less then expected for the operand provided.",
769            StatusCode::BadFilterElementInvalid => "The referenced element is not a valid element in the content filter.",
770            StatusCode::BadFilterLiteralInvalid => "The referenced literal is not a valid value.",
771            StatusCode::BadIdentityChangeNotSupported => "The server does not support changing the user identity assigned to the session.",
772            StatusCode::BadNotTypeDefinition => "The provided Nodeid was not a type definition nodeid.",
773            StatusCode::BadViewTimestampInvalid => "The view timestamp is not available or not supported.",
774            StatusCode::BadViewParameterMismatch => "The view parameters are not consistent with each other.",
775            StatusCode::BadViewVersionInvalid => "The view version is not available or not supported.",
776            StatusCode::BadConditionAlreadyEnabled => "This condition has already been enabled.",
777            StatusCode::BadDialogNotActive => "The dialog condition is not active.",
778            StatusCode::BadDialogResponseInvalid => "The response is not valid for the dialog.",
779            StatusCode::BadConditionBranchAlreadyAcked => "The condition branch has already been acknowledged.",
780            StatusCode::BadConditionBranchAlreadyConfirmed => "The condition branch has already been confirmed.",
781            StatusCode::BadConditionAlreadyShelved => "The condition has already been shelved.",
782            StatusCode::BadConditionNotShelved => "The condition is not currently shelved.",
783            StatusCode::BadShelvingTimeOutOfRange => "The shelving time not within an acceptable range.",
784            StatusCode::BadAggregateListMismatch => "The requested number of Aggregates does not match the requested number of NodeIds.",
785            StatusCode::BadAggregateNotSupported => "The requested Aggregate is not support by the server.",
786            StatusCode::BadAggregateInvalidInputs => "The aggregate value could not be derived due to invalid data inputs.",
787            StatusCode::BadBoundNotFound => "No data found to provide upper or lower bound value.",
788            StatusCode::BadBoundNotSupported => "The server cannot retrieve a bound for the variable.",
789            StatusCode::BadAggregateConfigurationRejected => "The aggregate configuration is not valid for specified node.",
790            StatusCode::BadTooManyMonitoredItems => "The request could not be processed because there are too many monitored items in the subscription.",
791            StatusCode::BadDominantValueChanged => "The related EngineeringUnit has been changed but this change has not been applied to the device. The Variable Value is still dependent on the previous unit but its status is currently Bad.",
792            StatusCode::BadDependentValueChanged => "A dependent value has been changed but the change has not been applied to the device. The quality of the dominant variable is Bad.",
793            StatusCode::BadRequestNotAllowed => "The request was rejected by the server because it did not meet the criteria set by the server.",
794            StatusCode::BadTooManyArguments => "Too many arguments were provided.",
795            StatusCode::BadSecurityModeInsufficient => "The operation is not permitted over the current secure channel.",
796            StatusCode::BadCertificateChainIncomplete => "The certificate chain is incomplete.",
797            StatusCode::BadLicenseExpired => "The server requires a license to operate in general or to perform a service or operation, but existing license is expired.",
798            StatusCode::BadLicenseLimitsExceeded => "The server has limits on number of allowed operations / objects, based on installed licenses, and these limits where exceeded.",
799            StatusCode::BadLicenseNotAvailable => "The server does not have a license which is required to operate in general or to perform a service or operation.",
800            StatusCode::BadNotExecutable => "The executable attribute does not allow the execution of the method.",
801            StatusCode::BadNumericOverflow => "The number was not accepted because of a numeric overflow.",
802            StatusCode::BadRequestNotComplete => "The request has not been processed by the server yet.",
803            StatusCode::BadCertificatePolicyCheckFailed => "The certificate does not meet the requirements of the security policy.",
804            StatusCode::BadAlreadyExists => "An equivalent rule already exists.",
805            StatusCode::BadEdited_OutOfRange => "It is delivered with a Variable value when Variable has changed but the value is not legal.",
806            StatusCode::BadInitialValue_OutOfRange => "It is delivered with a Variable value when a source Variable has changed but the value is not legal.",
807            StatusCode::BadOutOfRange_DominantValueChanged => "It is delivered with a dependent Variable value when a dominant Variable has changed and the value is not legal.",
808            StatusCode::BadEdited_OutOfRange_DominantValueChanged => "It is delivered with a dependent Variable value when a dominant Variable has changed, the value is not legal and the change has not been applied.",
809            StatusCode::BadOutOfRange_DominantValueChanged_DependentValueChanged => "It is delivered with a dependent Variable value when a dominant or dependent Variable has changed and the value is not legal.",
810            StatusCode::BadEdited_OutOfRange_DominantValueChanged_DependentValueChanged => "It is delivered with a dependent Variable value when a dominant or dependent Variable has changed, the value is not legal and the change has not been applied.",
811            _ => "Unrecognized status code",
812        }
813    }
814
815    /// Takes an OPC UA status code as a UInt32 and returns the matching StatusCode, assuming there is one
816    /// Note that this is lossy since any bits associated with the status code will be ignored.
817    pub fn from_u32(code: u32) -> Option<StatusCode> {
818        StatusCode::from_bits(code)
819    }
820}
821
822impl FromStr for StatusCode {
823    type Err = ();
824
825    fn from_str(s: &str) -> Result<Self, Self::Err> {
826        match s {
827            "Good" => Ok(StatusCode::Good),
828            "GoodSubscriptionTransferred" => Ok(StatusCode::GoodSubscriptionTransferred),
829            "GoodCompletesAsynchronously" => Ok(StatusCode::GoodCompletesAsynchronously),
830            "GoodOverload" => Ok(StatusCode::GoodOverload),
831            "GoodClamped" => Ok(StatusCode::GoodClamped),
832            "GoodLocalOverride" => Ok(StatusCode::GoodLocalOverride),
833            "GoodEntryInserted" => Ok(StatusCode::GoodEntryInserted),
834            "GoodEntryReplaced" => Ok(StatusCode::GoodEntryReplaced),
835            "GoodNoData" => Ok(StatusCode::GoodNoData),
836            "GoodMoreData" => Ok(StatusCode::GoodMoreData),
837            "GoodCommunicationEvent" => Ok(StatusCode::GoodCommunicationEvent),
838            "GoodShutdownEvent" => Ok(StatusCode::GoodShutdownEvent),
839            "GoodCallAgain" => Ok(StatusCode::GoodCallAgain),
840            "GoodNonCriticalTimeout" => Ok(StatusCode::GoodNonCriticalTimeout),
841            "GoodResultsMayBeIncomplete" => Ok(StatusCode::GoodResultsMayBeIncomplete),
842            "GoodDataIgnored" => Ok(StatusCode::GoodDataIgnored),
843            "GoodEdited" => Ok(StatusCode::GoodEdited),
844            "GoodPostActionFailed" => Ok(StatusCode::GoodPostActionFailed),
845            "GoodDependentValueChanged" => Ok(StatusCode::GoodDependentValueChanged),
846            "GoodEdited_DependentValueChanged" => Ok(StatusCode::GoodEdited_DependentValueChanged),
847            "GoodEdited_DominantValueChanged" => Ok(StatusCode::GoodEdited_DominantValueChanged),
848            "GoodEdited_DominantValueChanged_DependentValueChanged" => {
849                Ok(StatusCode::GoodEdited_DominantValueChanged_DependentValueChanged)
850            }
851            "UncertainReferenceOutOfServer" => Ok(StatusCode::UncertainReferenceOutOfServer),
852            "UncertainNoCommunicationLastUsableValue" => {
853                Ok(StatusCode::UncertainNoCommunicationLastUsableValue)
854            }
855            "UncertainLastUsableValue" => Ok(StatusCode::UncertainLastUsableValue),
856            "UncertainSubstituteValue" => Ok(StatusCode::UncertainSubstituteValue),
857            "UncertainInitialValue" => Ok(StatusCode::UncertainInitialValue),
858            "UncertainSensorNotAccurate" => Ok(StatusCode::UncertainSensorNotAccurate),
859            "UncertainEngineeringUnitsExceeded" => {
860                Ok(StatusCode::UncertainEngineeringUnitsExceeded)
861            }
862            "UncertainSubNormal" => Ok(StatusCode::UncertainSubNormal),
863            "UncertainDataSubNormal" => Ok(StatusCode::UncertainDataSubNormal),
864            "UncertainReferenceNotDeleted" => Ok(StatusCode::UncertainReferenceNotDeleted),
865            "UncertainNotAllNodesAvailable" => Ok(StatusCode::UncertainNotAllNodesAvailable),
866            "UncertainDominantValueChanged" => Ok(StatusCode::UncertainDominantValueChanged),
867            "UncertainDependentValueChanged" => Ok(StatusCode::UncertainDependentValueChanged),
868            "BadUnexpectedError" => Ok(StatusCode::BadUnexpectedError),
869            "BadInternalError" => Ok(StatusCode::BadInternalError),
870            "BadOutOfMemory" => Ok(StatusCode::BadOutOfMemory),
871            "BadResourceUnavailable" => Ok(StatusCode::BadResourceUnavailable),
872            "BadCommunicationError" => Ok(StatusCode::BadCommunicationError),
873            "BadEncodingError" => Ok(StatusCode::BadEncodingError),
874            "BadDecodingError" => Ok(StatusCode::BadDecodingError),
875            "BadEncodingLimitsExceeded" => Ok(StatusCode::BadEncodingLimitsExceeded),
876            "BadUnknownResponse" => Ok(StatusCode::BadUnknownResponse),
877            "BadTimeout" => Ok(StatusCode::BadTimeout),
878            "BadServiceUnsupported" => Ok(StatusCode::BadServiceUnsupported),
879            "BadShutdown" => Ok(StatusCode::BadShutdown),
880            "BadServerNotConnected" => Ok(StatusCode::BadServerNotConnected),
881            "BadServerHalted" => Ok(StatusCode::BadServerHalted),
882            "BadNothingToDo" => Ok(StatusCode::BadNothingToDo),
883            "BadTooManyOperations" => Ok(StatusCode::BadTooManyOperations),
884            "BadDataTypeIdUnknown" => Ok(StatusCode::BadDataTypeIdUnknown),
885            "BadCertificateInvalid" => Ok(StatusCode::BadCertificateInvalid),
886            "BadSecurityChecksFailed" => Ok(StatusCode::BadSecurityChecksFailed),
887            "BadCertificateTimeInvalid" => Ok(StatusCode::BadCertificateTimeInvalid),
888            "BadCertificateIssuerTimeInvalid" => Ok(StatusCode::BadCertificateIssuerTimeInvalid),
889            "BadCertificateHostNameInvalid" => Ok(StatusCode::BadCertificateHostNameInvalid),
890            "BadCertificateUriInvalid" => Ok(StatusCode::BadCertificateUriInvalid),
891            "BadCertificateUseNotAllowed" => Ok(StatusCode::BadCertificateUseNotAllowed),
892            "BadCertificateIssuerUseNotAllowed" => {
893                Ok(StatusCode::BadCertificateIssuerUseNotAllowed)
894            }
895            "BadCertificateUntrusted" => Ok(StatusCode::BadCertificateUntrusted),
896            "BadCertificateRevocationUnknown" => Ok(StatusCode::BadCertificateRevocationUnknown),
897            "BadCertificateIssuerRevocationUnknown" => {
898                Ok(StatusCode::BadCertificateIssuerRevocationUnknown)
899            }
900            "BadCertificateRevoked" => Ok(StatusCode::BadCertificateRevoked),
901            "BadCertificateIssuerRevoked" => Ok(StatusCode::BadCertificateIssuerRevoked),
902            "BadUserAccessDenied" => Ok(StatusCode::BadUserAccessDenied),
903            "BadIdentityTokenInvalid" => Ok(StatusCode::BadIdentityTokenInvalid),
904            "BadIdentityTokenRejected" => Ok(StatusCode::BadIdentityTokenRejected),
905            "BadSecureChannelIdInvalid" => Ok(StatusCode::BadSecureChannelIdInvalid),
906            "BadInvalidTimestamp" => Ok(StatusCode::BadInvalidTimestamp),
907            "BadNonceInvalid" => Ok(StatusCode::BadNonceInvalid),
908            "BadSessionIdInvalid" => Ok(StatusCode::BadSessionIdInvalid),
909            "BadSessionClosed" => Ok(StatusCode::BadSessionClosed),
910            "BadSessionNotActivated" => Ok(StatusCode::BadSessionNotActivated),
911            "BadSubscriptionIdInvalid" => Ok(StatusCode::BadSubscriptionIdInvalid),
912            "BadRequestHeaderInvalid" => Ok(StatusCode::BadRequestHeaderInvalid),
913            "BadTimestampsToReturnInvalid" => Ok(StatusCode::BadTimestampsToReturnInvalid),
914            "BadRequestCancelledByClient" => Ok(StatusCode::BadRequestCancelledByClient),
915            "BadNoCommunication" => Ok(StatusCode::BadNoCommunication),
916            "BadWaitingForInitialData" => Ok(StatusCode::BadWaitingForInitialData),
917            "BadNodeIdInvalid" => Ok(StatusCode::BadNodeIdInvalid),
918            "BadNodeIdUnknown" => Ok(StatusCode::BadNodeIdUnknown),
919            "BadAttributeIdInvalid" => Ok(StatusCode::BadAttributeIdInvalid),
920            "BadIndexRangeInvalid" => Ok(StatusCode::BadIndexRangeInvalid),
921            "BadIndexRangeNoData" => Ok(StatusCode::BadIndexRangeNoData),
922            "BadDataEncodingInvalid" => Ok(StatusCode::BadDataEncodingInvalid),
923            "BadDataEncodingUnsupported" => Ok(StatusCode::BadDataEncodingUnsupported),
924            "BadNotReadable" => Ok(StatusCode::BadNotReadable),
925            "BadNotWritable" => Ok(StatusCode::BadNotWritable),
926            "BadOutOfRange" => Ok(StatusCode::BadOutOfRange),
927            "BadNotSupported" => Ok(StatusCode::BadNotSupported),
928            "BadNotFound" => Ok(StatusCode::BadNotFound),
929            "BadObjectDeleted" => Ok(StatusCode::BadObjectDeleted),
930            "BadNotImplemented" => Ok(StatusCode::BadNotImplemented),
931            "BadMonitoringModeInvalid" => Ok(StatusCode::BadMonitoringModeInvalid),
932            "BadMonitoredItemIdInvalid" => Ok(StatusCode::BadMonitoredItemIdInvalid),
933            "BadMonitoredItemFilterInvalid" => Ok(StatusCode::BadMonitoredItemFilterInvalid),
934            "BadMonitoredItemFilterUnsupported" => {
935                Ok(StatusCode::BadMonitoredItemFilterUnsupported)
936            }
937            "BadFilterNotAllowed" => Ok(StatusCode::BadFilterNotAllowed),
938            "BadStructureMissing" => Ok(StatusCode::BadStructureMissing),
939            "BadEventFilterInvalid" => Ok(StatusCode::BadEventFilterInvalid),
940            "BadContentFilterInvalid" => Ok(StatusCode::BadContentFilterInvalid),
941            "BadFilterOperandInvalid" => Ok(StatusCode::BadFilterOperandInvalid),
942            "BadContinuationPointInvalid" => Ok(StatusCode::BadContinuationPointInvalid),
943            "BadNoContinuationPoints" => Ok(StatusCode::BadNoContinuationPoints),
944            "BadReferenceTypeIdInvalid" => Ok(StatusCode::BadReferenceTypeIdInvalid),
945            "BadBrowseDirectionInvalid" => Ok(StatusCode::BadBrowseDirectionInvalid),
946            "BadNodeNotInView" => Ok(StatusCode::BadNodeNotInView),
947            "BadServerUriInvalid" => Ok(StatusCode::BadServerUriInvalid),
948            "BadServerNameMissing" => Ok(StatusCode::BadServerNameMissing),
949            "BadDiscoveryUrlMissing" => Ok(StatusCode::BadDiscoveryUrlMissing),
950            "BadSempahoreFileMissing" => Ok(StatusCode::BadSempahoreFileMissing),
951            "BadRequestTypeInvalid" => Ok(StatusCode::BadRequestTypeInvalid),
952            "BadSecurityModeRejected" => Ok(StatusCode::BadSecurityModeRejected),
953            "BadSecurityPolicyRejected" => Ok(StatusCode::BadSecurityPolicyRejected),
954            "BadTooManySessions" => Ok(StatusCode::BadTooManySessions),
955            "BadUserSignatureInvalid" => Ok(StatusCode::BadUserSignatureInvalid),
956            "BadApplicationSignatureInvalid" => Ok(StatusCode::BadApplicationSignatureInvalid),
957            "BadNoValidCertificates" => Ok(StatusCode::BadNoValidCertificates),
958            "BadRequestCancelledByRequest" => Ok(StatusCode::BadRequestCancelledByRequest),
959            "BadParentNodeIdInvalid" => Ok(StatusCode::BadParentNodeIdInvalid),
960            "BadReferenceNotAllowed" => Ok(StatusCode::BadReferenceNotAllowed),
961            "BadNodeIdRejected" => Ok(StatusCode::BadNodeIdRejected),
962            "BadNodeIdExists" => Ok(StatusCode::BadNodeIdExists),
963            "BadNodeClassInvalid" => Ok(StatusCode::BadNodeClassInvalid),
964            "BadBrowseNameInvalid" => Ok(StatusCode::BadBrowseNameInvalid),
965            "BadBrowseNameDuplicated" => Ok(StatusCode::BadBrowseNameDuplicated),
966            "BadNodeAttributesInvalid" => Ok(StatusCode::BadNodeAttributesInvalid),
967            "BadTypeDefinitionInvalid" => Ok(StatusCode::BadTypeDefinitionInvalid),
968            "BadSourceNodeIdInvalid" => Ok(StatusCode::BadSourceNodeIdInvalid),
969            "BadTargetNodeIdInvalid" => Ok(StatusCode::BadTargetNodeIdInvalid),
970            "BadDuplicateReferenceNotAllowed" => Ok(StatusCode::BadDuplicateReferenceNotAllowed),
971            "BadInvalidSelfReference" => Ok(StatusCode::BadInvalidSelfReference),
972            "BadReferenceLocalOnly" => Ok(StatusCode::BadReferenceLocalOnly),
973            "BadNoDeleteRights" => Ok(StatusCode::BadNoDeleteRights),
974            "BadServerIndexInvalid" => Ok(StatusCode::BadServerIndexInvalid),
975            "BadViewIdUnknown" => Ok(StatusCode::BadViewIdUnknown),
976            "BadTooManyMatches" => Ok(StatusCode::BadTooManyMatches),
977            "BadQueryTooComplex" => Ok(StatusCode::BadQueryTooComplex),
978            "BadNoMatch" => Ok(StatusCode::BadNoMatch),
979            "BadMaxAgeInvalid" => Ok(StatusCode::BadMaxAgeInvalid),
980            "BadHistoryOperationInvalid" => Ok(StatusCode::BadHistoryOperationInvalid),
981            "BadHistoryOperationUnsupported" => Ok(StatusCode::BadHistoryOperationUnsupported),
982            "BadWriteNotSupported" => Ok(StatusCode::BadWriteNotSupported),
983            "BadTypeMismatch" => Ok(StatusCode::BadTypeMismatch),
984            "BadMethodInvalid" => Ok(StatusCode::BadMethodInvalid),
985            "BadArgumentsMissing" => Ok(StatusCode::BadArgumentsMissing),
986            "BadTooManySubscriptions" => Ok(StatusCode::BadTooManySubscriptions),
987            "BadTooManyPublishRequests" => Ok(StatusCode::BadTooManyPublishRequests),
988            "BadNoSubscription" => Ok(StatusCode::BadNoSubscription),
989            "BadSequenceNumberUnknown" => Ok(StatusCode::BadSequenceNumberUnknown),
990            "BadMessageNotAvailable" => Ok(StatusCode::BadMessageNotAvailable),
991            "BadInsufficientClientProfile" => Ok(StatusCode::BadInsufficientClientProfile),
992            "BadTcpServerTooBusy" => Ok(StatusCode::BadTcpServerTooBusy),
993            "BadTcpMessageTypeInvalid" => Ok(StatusCode::BadTcpMessageTypeInvalid),
994            "BadTcpSecureChannelUnknown" => Ok(StatusCode::BadTcpSecureChannelUnknown),
995            "BadTcpMessageTooLarge" => Ok(StatusCode::BadTcpMessageTooLarge),
996            "BadTcpNotEnoughResources" => Ok(StatusCode::BadTcpNotEnoughResources),
997            "BadTcpInternalError" => Ok(StatusCode::BadTcpInternalError),
998            "BadTcpEndpointUrlInvalid" => Ok(StatusCode::BadTcpEndpointUrlInvalid),
999            "BadRequestInterrupted" => Ok(StatusCode::BadRequestInterrupted),
1000            "BadRequestTimeout" => Ok(StatusCode::BadRequestTimeout),
1001            "BadSecureChannelClosed" => Ok(StatusCode::BadSecureChannelClosed),
1002            "BadSecureChannelTokenUnknown" => Ok(StatusCode::BadSecureChannelTokenUnknown),
1003            "BadSequenceNumberInvalid" => Ok(StatusCode::BadSequenceNumberInvalid),
1004            "BadConfigurationError" => Ok(StatusCode::BadConfigurationError),
1005            "BadNotConnected" => Ok(StatusCode::BadNotConnected),
1006            "BadDeviceFailure" => Ok(StatusCode::BadDeviceFailure),
1007            "BadSensorFailure" => Ok(StatusCode::BadSensorFailure),
1008            "BadOutOfService" => Ok(StatusCode::BadOutOfService),
1009            "BadDeadbandFilterInvalid" => Ok(StatusCode::BadDeadbandFilterInvalid),
1010            "BadRefreshInProgress" => Ok(StatusCode::BadRefreshInProgress),
1011            "BadConditionAlreadyDisabled" => Ok(StatusCode::BadConditionAlreadyDisabled),
1012            "BadConditionDisabled" => Ok(StatusCode::BadConditionDisabled),
1013            "BadEventIdUnknown" => Ok(StatusCode::BadEventIdUnknown),
1014            "BadNoData" => Ok(StatusCode::BadNoData),
1015            "BadDataLost" => Ok(StatusCode::BadDataLost),
1016            "BadDataUnavailable" => Ok(StatusCode::BadDataUnavailable),
1017            "BadEntryExists" => Ok(StatusCode::BadEntryExists),
1018            "BadNoEntryExists" => Ok(StatusCode::BadNoEntryExists),
1019            "BadTimestampNotSupported" => Ok(StatusCode::BadTimestampNotSupported),
1020            "BadInvalidArgument" => Ok(StatusCode::BadInvalidArgument),
1021            "BadConnectionRejected" => Ok(StatusCode::BadConnectionRejected),
1022            "BadDisconnect" => Ok(StatusCode::BadDisconnect),
1023            "BadConnectionClosed" => Ok(StatusCode::BadConnectionClosed),
1024            "BadInvalidState" => Ok(StatusCode::BadInvalidState),
1025            "BadEndOfStream" => Ok(StatusCode::BadEndOfStream),
1026            "BadNoDataAvailable" => Ok(StatusCode::BadNoDataAvailable),
1027            "BadWaitingForResponse" => Ok(StatusCode::BadWaitingForResponse),
1028            "BadOperationAbandoned" => Ok(StatusCode::BadOperationAbandoned),
1029            "BadExpectedStreamToBlock" => Ok(StatusCode::BadExpectedStreamToBlock),
1030            "BadWouldBlock" => Ok(StatusCode::BadWouldBlock),
1031            "BadSyntaxError" => Ok(StatusCode::BadSyntaxError),
1032            "BadMaxConnectionsReached" => Ok(StatusCode::BadMaxConnectionsReached),
1033            "BadRequestTooLarge" => Ok(StatusCode::BadRequestTooLarge),
1034            "BadResponseTooLarge" => Ok(StatusCode::BadResponseTooLarge),
1035            "BadEventNotAcknowledgeable" => Ok(StatusCode::BadEventNotAcknowledgeable),
1036            "BadInvalidTimestampArgument" => Ok(StatusCode::BadInvalidTimestampArgument),
1037            "BadProtocolVersionUnsupported" => Ok(StatusCode::BadProtocolVersionUnsupported),
1038            "BadStateNotActive" => Ok(StatusCode::BadStateNotActive),
1039            "BadFilterOperatorInvalid" => Ok(StatusCode::BadFilterOperatorInvalid),
1040            "BadFilterOperatorUnsupported" => Ok(StatusCode::BadFilterOperatorUnsupported),
1041            "BadFilterOperandCountMismatch" => Ok(StatusCode::BadFilterOperandCountMismatch),
1042            "BadFilterElementInvalid" => Ok(StatusCode::BadFilterElementInvalid),
1043            "BadFilterLiteralInvalid" => Ok(StatusCode::BadFilterLiteralInvalid),
1044            "BadIdentityChangeNotSupported" => Ok(StatusCode::BadIdentityChangeNotSupported),
1045            "BadNotTypeDefinition" => Ok(StatusCode::BadNotTypeDefinition),
1046            "BadViewTimestampInvalid" => Ok(StatusCode::BadViewTimestampInvalid),
1047            "BadViewParameterMismatch" => Ok(StatusCode::BadViewParameterMismatch),
1048            "BadViewVersionInvalid" => Ok(StatusCode::BadViewVersionInvalid),
1049            "BadConditionAlreadyEnabled" => Ok(StatusCode::BadConditionAlreadyEnabled),
1050            "BadDialogNotActive" => Ok(StatusCode::BadDialogNotActive),
1051            "BadDialogResponseInvalid" => Ok(StatusCode::BadDialogResponseInvalid),
1052            "BadConditionBranchAlreadyAcked" => Ok(StatusCode::BadConditionBranchAlreadyAcked),
1053            "BadConditionBranchAlreadyConfirmed" => {
1054                Ok(StatusCode::BadConditionBranchAlreadyConfirmed)
1055            }
1056            "BadConditionAlreadyShelved" => Ok(StatusCode::BadConditionAlreadyShelved),
1057            "BadConditionNotShelved" => Ok(StatusCode::BadConditionNotShelved),
1058            "BadShelvingTimeOutOfRange" => Ok(StatusCode::BadShelvingTimeOutOfRange),
1059            "BadAggregateListMismatch" => Ok(StatusCode::BadAggregateListMismatch),
1060            "BadAggregateNotSupported" => Ok(StatusCode::BadAggregateNotSupported),
1061            "BadAggregateInvalidInputs" => Ok(StatusCode::BadAggregateInvalidInputs),
1062            "BadBoundNotFound" => Ok(StatusCode::BadBoundNotFound),
1063            "BadBoundNotSupported" => Ok(StatusCode::BadBoundNotSupported),
1064            "BadAggregateConfigurationRejected" => {
1065                Ok(StatusCode::BadAggregateConfigurationRejected)
1066            }
1067            "BadTooManyMonitoredItems" => Ok(StatusCode::BadTooManyMonitoredItems),
1068            "BadDominantValueChanged" => Ok(StatusCode::BadDominantValueChanged),
1069            "BadDependentValueChanged" => Ok(StatusCode::BadDependentValueChanged),
1070            "BadRequestNotAllowed" => Ok(StatusCode::BadRequestNotAllowed),
1071            "BadTooManyArguments" => Ok(StatusCode::BadTooManyArguments),
1072            "BadSecurityModeInsufficient" => Ok(StatusCode::BadSecurityModeInsufficient),
1073            "BadCertificateChainIncomplete" => Ok(StatusCode::BadCertificateChainIncomplete),
1074            "BadLicenseExpired" => Ok(StatusCode::BadLicenseExpired),
1075            "BadLicenseLimitsExceeded" => Ok(StatusCode::BadLicenseLimitsExceeded),
1076            "BadLicenseNotAvailable" => Ok(StatusCode::BadLicenseNotAvailable),
1077            "BadNotExecutable" => Ok(StatusCode::BadNotExecutable),
1078            "BadNumericOverflow" => Ok(StatusCode::BadNumericOverflow),
1079            "BadRequestNotComplete" => Ok(StatusCode::BadRequestNotComplete),
1080            "BadCertificatePolicyCheckFailed" => Ok(StatusCode::BadCertificatePolicyCheckFailed),
1081            "BadAlreadyExists" => Ok(StatusCode::BadAlreadyExists),
1082            "BadEdited_OutOfRange" => Ok(StatusCode::BadEdited_OutOfRange),
1083            "BadInitialValue_OutOfRange" => Ok(StatusCode::BadInitialValue_OutOfRange),
1084            "BadOutOfRange_DominantValueChanged" => {
1085                Ok(StatusCode::BadOutOfRange_DominantValueChanged)
1086            }
1087            "BadEdited_OutOfRange_DominantValueChanged" => {
1088                Ok(StatusCode::BadEdited_OutOfRange_DominantValueChanged)
1089            }
1090            "BadOutOfRange_DominantValueChanged_DependentValueChanged" => {
1091                Ok(StatusCode::BadOutOfRange_DominantValueChanged_DependentValueChanged)
1092            }
1093            "BadEdited_OutOfRange_DominantValueChanged_DependentValueChanged" => {
1094                Ok(StatusCode::BadEdited_OutOfRange_DominantValueChanged_DependentValueChanged)
1095            }
1096            _ => Err(()),
1097        }
1098    }
1099}