@blueid/access-proto 0.25.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/BlueSDK.proto CHANGED
@@ -62,9 +62,12 @@ message BlueDeviceInfo {
62
62
  message BlueAccessCredential {
63
63
  required BlueCredentialId credentialId = 1;
64
64
  required BlueCredentialType credentialType = 2;
65
- optional BlueLocalTimestamp validFrom = 3;
66
- optional BlueLocalTimestamp validTo = 4;
67
- optional bytes privateKey = 5;
65
+ optional string name = 3;
66
+ optional string siteName = 4;
67
+ optional BlueLocalTimestamp validFrom = 5;
68
+ optional BlueLocalTimestamp validTo = 6;
69
+ optional BlueLocalTimestamp validity = 7;
70
+ optional bytes privateKey = 8;
68
71
  }
69
72
 
70
73
  message BlueAccessCredentialList {
@@ -73,7 +76,7 @@ message BlueAccessCredentialList {
73
76
 
74
77
  message BlueAccessDevice {
75
78
  required string deviceId = 1;
76
- optional string name = 2;
79
+ optional string objectName = 2;
77
80
  }
78
81
 
79
82
  message BlueAccessDeviceList {
@@ -210,17 +210,32 @@ export declare class BlueAccessCredential extends Message<BlueAccessCredential>
210
210
  credentialType: BlueCredentialType;
211
211
 
212
212
  /**
213
- * @generated from field: optional BlueLocalTimestamp validFrom = 3;
213
+ * @generated from field: optional string name = 3;
214
+ */
215
+ name?: string;
216
+
217
+ /**
218
+ * @generated from field: optional string siteName = 4;
219
+ */
220
+ siteName?: string;
221
+
222
+ /**
223
+ * @generated from field: optional BlueLocalTimestamp validFrom = 5;
214
224
  */
215
225
  validFrom?: BlueLocalTimestamp;
216
226
 
217
227
  /**
218
- * @generated from field: optional BlueLocalTimestamp validTo = 4;
228
+ * @generated from field: optional BlueLocalTimestamp validTo = 6;
219
229
  */
220
230
  validTo?: BlueLocalTimestamp;
221
231
 
222
232
  /**
223
- * @generated from field: optional bytes privateKey = 5;
233
+ * @generated from field: optional BlueLocalTimestamp validity = 7;
234
+ */
235
+ validity?: BlueLocalTimestamp;
236
+
237
+ /**
238
+ * @generated from field: optional bytes privateKey = 8;
224
239
  */
225
240
  privateKey?: Uint8Array;
226
241
 
@@ -273,9 +288,9 @@ export declare class BlueAccessDevice extends Message<BlueAccessDevice> {
273
288
  deviceId: string;
274
289
 
275
290
  /**
276
- * @generated from field: optional string name = 2;
291
+ * @generated from field: optional string objectName = 2;
277
292
  */
278
- name?: string;
293
+ objectName?: string;
279
294
 
280
295
  constructor(data?: PartialMessage<BlueAccessDevice>);
281
296
 
package/cjs/BlueSDK_pb.js CHANGED
@@ -116,9 +116,12 @@ const BlueAccessCredential = import_protobuf.proto2.makeMessageType(
116
116
  () => [
117
117
  { no: 1, name: "credentialId", kind: "message", T: import_BlueCore_pb.BlueCredentialId },
118
118
  { no: 2, name: "credentialType", kind: "enum", T: import_protobuf.proto2.getEnumType(import_BlueCore_pb.BlueCredentialType) },
119
- { no: 3, name: "validFrom", kind: "message", T: import_BlueCore_pb.BlueLocalTimestamp, opt: true },
120
- { no: 4, name: "validTo", kind: "message", T: import_BlueCore_pb.BlueLocalTimestamp, opt: true },
121
- { no: 5, name: "privateKey", kind: "scalar", T: 12, opt: true }
119
+ { no: 3, name: "name", kind: "scalar", T: 9, opt: true },
120
+ { no: 4, name: "siteName", kind: "scalar", T: 9, opt: true },
121
+ { no: 5, name: "validFrom", kind: "message", T: import_BlueCore_pb.BlueLocalTimestamp, opt: true },
122
+ { no: 6, name: "validTo", kind: "message", T: import_BlueCore_pb.BlueLocalTimestamp, opt: true },
123
+ { no: 7, name: "validity", kind: "message", T: import_BlueCore_pb.BlueLocalTimestamp, opt: true },
124
+ { no: 8, name: "privateKey", kind: "scalar", T: 12, opt: true }
122
125
  ]
123
126
  );
124
127
  const BlueAccessCredentialList = import_protobuf.proto2.makeMessageType(
@@ -137,7 +140,7 @@ const BlueAccessDevice = import_protobuf.proto2.makeMessageType(
137
140
  T: 9
138
141
  /* ScalarType.STRING */
139
142
  },
140
- { no: 2, name: "name", kind: "scalar", T: 9, opt: true }
143
+ { no: 2, name: "objectName", kind: "scalar", T: 9, opt: true }
141
144
  ]
142
145
  );
143
146
  const BlueAccessDeviceList = import_protobuf.proto2.makeMessageType(
@@ -210,17 +210,32 @@ export declare class BlueAccessCredential extends Message<BlueAccessCredential>
210
210
  credentialType: BlueCredentialType;
211
211
 
212
212
  /**
213
- * @generated from field: optional BlueLocalTimestamp validFrom = 3;
213
+ * @generated from field: optional string name = 3;
214
+ */
215
+ name?: string;
216
+
217
+ /**
218
+ * @generated from field: optional string siteName = 4;
219
+ */
220
+ siteName?: string;
221
+
222
+ /**
223
+ * @generated from field: optional BlueLocalTimestamp validFrom = 5;
214
224
  */
215
225
  validFrom?: BlueLocalTimestamp;
216
226
 
217
227
  /**
218
- * @generated from field: optional BlueLocalTimestamp validTo = 4;
228
+ * @generated from field: optional BlueLocalTimestamp validTo = 6;
219
229
  */
220
230
  validTo?: BlueLocalTimestamp;
221
231
 
222
232
  /**
223
- * @generated from field: optional bytes privateKey = 5;
233
+ * @generated from field: optional BlueLocalTimestamp validity = 7;
234
+ */
235
+ validity?: BlueLocalTimestamp;
236
+
237
+ /**
238
+ * @generated from field: optional bytes privateKey = 8;
224
239
  */
225
240
  privateKey?: Uint8Array;
226
241
 
@@ -273,9 +288,9 @@ export declare class BlueAccessDevice extends Message<BlueAccessDevice> {
273
288
  deviceId: string;
274
289
 
275
290
  /**
276
- * @generated from field: optional string name = 2;
291
+ * @generated from field: optional string objectName = 2;
277
292
  */
278
- name?: string;
293
+ objectName?: string;
279
294
 
280
295
  constructor(data?: PartialMessage<BlueAccessDevice>);
281
296
 
package/es/BlueSDK_pb.js CHANGED
@@ -79,9 +79,12 @@ export const BlueAccessCredential = proto2.makeMessageType(
79
79
  () => [
80
80
  { no: 1, name: "credentialId", kind: "message", T: BlueCredentialId },
81
81
  { no: 2, name: "credentialType", kind: "enum", T: proto2.getEnumType(BlueCredentialType) },
82
- { no: 3, name: "validFrom", kind: "message", T: BlueLocalTimestamp, opt: true },
83
- { no: 4, name: "validTo", kind: "message", T: BlueLocalTimestamp, opt: true },
84
- { no: 5, name: "privateKey", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true },
82
+ { no: 3, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
83
+ { no: 4, name: "siteName", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
84
+ { no: 5, name: "validFrom", kind: "message", T: BlueLocalTimestamp, opt: true },
85
+ { no: 6, name: "validTo", kind: "message", T: BlueLocalTimestamp, opt: true },
86
+ { no: 7, name: "validity", kind: "message", T: BlueLocalTimestamp, opt: true },
87
+ { no: 8, name: "privateKey", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true },
85
88
  ],
86
89
  );
87
90
 
@@ -102,7 +105,7 @@ export const BlueAccessDevice = proto2.makeMessageType(
102
105
  "BlueAccessDevice",
103
106
  () => [
104
107
  { no: 1, name: "deviceId", kind: "scalar", T: 9 /* ScalarType.STRING */ },
105
- { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
108
+ { no: 2, name: "objectName", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
106
109
  ],
107
110
  );
108
111
 
@@ -54,10 +54,14 @@ typedef struct BlueDeviceInfo {
54
54
  typedef struct BlueAccessCredential {
55
55
  BlueCredentialId_t credentialId;
56
56
  BlueCredentialType_t credentialType;
57
+ pb_callback_t name;
58
+ pb_callback_t siteName;
57
59
  bool has_validFrom;
58
60
  BlueLocalTimestamp_t validFrom;
59
61
  bool has_validTo;
60
62
  BlueLocalTimestamp_t validTo;
63
+ bool has_validity;
64
+ BlueLocalTimestamp_t validity;
61
65
  pb_callback_t privateKey;
62
66
  } BlueAccessCredential_t;
63
67
 
@@ -67,7 +71,7 @@ typedef struct BlueAccessCredentialList {
67
71
 
68
72
  typedef struct BlueAccessDevice {
69
73
  pb_callback_t deviceId;
70
- pb_callback_t name;
74
+ pb_callback_t objectName;
71
75
  } BlueAccessDevice_t;
72
76
 
73
77
  typedef struct BlueAccessDeviceList {
@@ -100,7 +104,7 @@ extern "C" {
100
104
  #define BLUEDEVICEDETAILSBLUETOOTH_INIT_DEFAULT {0, 0, 0}
101
105
  #define BLUEDEVICEDETAILSUWB_INIT_DEFAULT {0}
102
106
  #define BLUEDEVICEINFO_INIT_DEFAULT {_BLUEDEVICETYPE_MIN, {{NULL}, NULL}, 0, false, BLUEBLEMANUFACTURERINFO_INIT_DEFAULT, 0, {BLUEDEVICEDETAILSBLUETOOTH_INIT_DEFAULT}}
103
- #define BLUEACCESSCREDENTIAL_INIT_DEFAULT {BLUECREDENTIALID_INIT_DEFAULT, _BLUECREDENTIALTYPE_MIN, false, BLUELOCALTIMESTAMP_INIT_DEFAULT, false, BLUELOCALTIMESTAMP_INIT_DEFAULT, {{NULL}, NULL}}
107
+ #define BLUEACCESSCREDENTIAL_INIT_DEFAULT {BLUECREDENTIALID_INIT_DEFAULT, _BLUECREDENTIALTYPE_MIN, {{NULL}, NULL}, {{NULL}, NULL}, false, BLUELOCALTIMESTAMP_INIT_DEFAULT, false, BLUELOCALTIMESTAMP_INIT_DEFAULT, false, BLUELOCALTIMESTAMP_INIT_DEFAULT, {{NULL}, NULL}}
104
108
  #define BLUEACCESSCREDENTIALLIST_INIT_DEFAULT {{{NULL}, NULL}}
105
109
  #define BLUEACCESSDEVICE_INIT_DEFAULT {{{NULL}, NULL}, {{NULL}, NULL}}
106
110
  #define BLUEACCESSDEVICELIST_INIT_DEFAULT {{{NULL}, NULL}}
@@ -108,7 +112,7 @@ extern "C" {
108
112
  #define BLUEDEVICEDETAILSBLUETOOTH_INIT_ZERO {0, 0, 0}
109
113
  #define BLUEDEVICEDETAILSUWB_INIT_ZERO {0}
110
114
  #define BLUEDEVICEINFO_INIT_ZERO {_BLUEDEVICETYPE_MIN, {{NULL}, NULL}, 0, false, BLUEBLEMANUFACTURERINFO_INIT_ZERO, 0, {BLUEDEVICEDETAILSBLUETOOTH_INIT_ZERO}}
111
- #define BLUEACCESSCREDENTIAL_INIT_ZERO {BLUECREDENTIALID_INIT_ZERO, _BLUECREDENTIALTYPE_MIN, false, BLUELOCALTIMESTAMP_INIT_ZERO, false, BLUELOCALTIMESTAMP_INIT_ZERO, {{NULL}, NULL}}
115
+ #define BLUEACCESSCREDENTIAL_INIT_ZERO {BLUECREDENTIALID_INIT_ZERO, _BLUECREDENTIALTYPE_MIN, {{NULL}, NULL}, {{NULL}, NULL}, false, BLUELOCALTIMESTAMP_INIT_ZERO, false, BLUELOCALTIMESTAMP_INIT_ZERO, false, BLUELOCALTIMESTAMP_INIT_ZERO, {{NULL}, NULL}}
112
116
  #define BLUEACCESSCREDENTIALLIST_INIT_ZERO {{{NULL}, NULL}}
113
117
  #define BLUEACCESSDEVICE_INIT_ZERO {{{NULL}, NULL}, {{NULL}, NULL}}
114
118
  #define BLUEACCESSDEVICELIST_INIT_ZERO {{{NULL}, NULL}}
@@ -134,12 +138,15 @@ extern "C" {
134
138
  #define BLUEDEVICEINFO_UWB_TAG 6
135
139
  #define BLUEACCESSCREDENTIAL_CREDENTIALID_TAG 1
136
140
  #define BLUEACCESSCREDENTIAL_CREDENTIALTYPE_TAG 2
137
- #define BLUEACCESSCREDENTIAL_VALIDFROM_TAG 3
138
- #define BLUEACCESSCREDENTIAL_VALIDTO_TAG 4
139
- #define BLUEACCESSCREDENTIAL_PRIVATEKEY_TAG 5
141
+ #define BLUEACCESSCREDENTIAL_NAME_TAG 3
142
+ #define BLUEACCESSCREDENTIAL_SITENAME_TAG 4
143
+ #define BLUEACCESSCREDENTIAL_VALIDFROM_TAG 5
144
+ #define BLUEACCESSCREDENTIAL_VALIDTO_TAG 6
145
+ #define BLUEACCESSCREDENTIAL_VALIDITY_TAG 7
146
+ #define BLUEACCESSCREDENTIAL_PRIVATEKEY_TAG 8
140
147
  #define BLUEACCESSCREDENTIALLIST_CREDENTIALS_TAG 1
141
148
  #define BLUEACCESSDEVICE_DEVICEID_TAG 1
142
- #define BLUEACCESSDEVICE_NAME_TAG 2
149
+ #define BLUEACCESSDEVICE_OBJECTNAME_TAG 2
143
150
  #define BLUEACCESSDEVICELIST_DEVICES_TAG 1
144
151
 
145
152
  /* Struct field encoding specification for nanopb */
@@ -183,14 +190,18 @@ X(a, STATIC, ONEOF, MESSAGE, (details,uwb,details.uwb), 6)
183
190
  #define BLUEACCESSCREDENTIAL_FIELDLIST(X, a) \
184
191
  X(a, STATIC, REQUIRED, MESSAGE, credentialId, 1) \
185
192
  X(a, STATIC, REQUIRED, UENUM, credentialType, 2) \
186
- X(a, STATIC, OPTIONAL, MESSAGE, validFrom, 3) \
187
- X(a, STATIC, OPTIONAL, MESSAGE, validTo, 4) \
188
- X(a, CALLBACK, OPTIONAL, BYTES, privateKey, 5)
193
+ X(a, CALLBACK, OPTIONAL, STRING, name, 3) \
194
+ X(a, CALLBACK, OPTIONAL, STRING, siteName, 4) \
195
+ X(a, STATIC, OPTIONAL, MESSAGE, validFrom, 5) \
196
+ X(a, STATIC, OPTIONAL, MESSAGE, validTo, 6) \
197
+ X(a, STATIC, OPTIONAL, MESSAGE, validity, 7) \
198
+ X(a, CALLBACK, OPTIONAL, BYTES, privateKey, 8)
189
199
  #define BLUEACCESSCREDENTIAL_CALLBACK pb_default_field_callback
190
200
  #define BLUEACCESSCREDENTIAL_DEFAULT (const pb_byte_t*)"\x10\x01\x00"
191
201
  #define BlueAccessCredential_t_credentialId_MSGTYPE BlueCredentialId_t
192
202
  #define BlueAccessCredential_t_validFrom_MSGTYPE BlueLocalTimestamp_t
193
203
  #define BlueAccessCredential_t_validTo_MSGTYPE BlueLocalTimestamp_t
204
+ #define BlueAccessCredential_t_validity_MSGTYPE BlueLocalTimestamp_t
194
205
 
195
206
  #define BLUEACCESSCREDENTIALLIST_FIELDLIST(X, a) \
196
207
  X(a, CALLBACK, REPEATED, MESSAGE, credentials, 1)
@@ -200,7 +211,7 @@ X(a, CALLBACK, REPEATED, MESSAGE, credentials, 1)
200
211
 
201
212
  #define BLUEACCESSDEVICE_FIELDLIST(X, a) \
202
213
  X(a, CALLBACK, REQUIRED, STRING, deviceId, 1) \
203
- X(a, CALLBACK, OPTIONAL, STRING, name, 2)
214
+ X(a, CALLBACK, OPTIONAL, STRING, objectName, 2)
204
215
  #define BLUEACCESSDEVICE_CALLBACK pb_default_field_callback
205
216
  #define BLUEACCESSDEVICE_DEFAULT NULL
206
217
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueid/access-proto",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "description": "BlueID Access Proto files",
5
5
  "author": "BlueID GmbH",
6
6
  "main": "cjs/index.js",
@@ -322,59 +322,82 @@ public struct BlueAccessCredential {
322
322
  // methods supported on all messages.
323
323
 
324
324
  public var credentialID: BlueCredentialId {
325
- get {return _credentialID ?? BlueCredentialId()}
326
- set {_credentialID = newValue}
325
+ get {return _storage._credentialID ?? BlueCredentialId()}
326
+ set {_uniqueStorage()._credentialID = newValue}
327
327
  }
328
328
  /// Returns true if `credentialID` has been explicitly set.
329
- public var hasCredentialID: Bool {return self._credentialID != nil}
329
+ public var hasCredentialID: Bool {return _storage._credentialID != nil}
330
330
  /// Clears the value of `credentialID`. Subsequent reads from it will return its default value.
331
- public mutating func clearCredentialID() {self._credentialID = nil}
331
+ public mutating func clearCredentialID() {_uniqueStorage()._credentialID = nil}
332
332
 
333
333
  public var credentialType: BlueCredentialType {
334
- get {return _credentialType ?? .regular}
335
- set {_credentialType = newValue}
334
+ get {return _storage._credentialType ?? .regular}
335
+ set {_uniqueStorage()._credentialType = newValue}
336
336
  }
337
337
  /// Returns true if `credentialType` has been explicitly set.
338
- public var hasCredentialType: Bool {return self._credentialType != nil}
338
+ public var hasCredentialType: Bool {return _storage._credentialType != nil}
339
339
  /// Clears the value of `credentialType`. Subsequent reads from it will return its default value.
340
- public mutating func clearCredentialType() {self._credentialType = nil}
340
+ public mutating func clearCredentialType() {_uniqueStorage()._credentialType = nil}
341
+
342
+ public var name: String {
343
+ get {return _storage._name ?? String()}
344
+ set {_uniqueStorage()._name = newValue}
345
+ }
346
+ /// Returns true if `name` has been explicitly set.
347
+ public var hasName: Bool {return _storage._name != nil}
348
+ /// Clears the value of `name`. Subsequent reads from it will return its default value.
349
+ public mutating func clearName() {_uniqueStorage()._name = nil}
350
+
351
+ public var siteName: String {
352
+ get {return _storage._siteName ?? String()}
353
+ set {_uniqueStorage()._siteName = newValue}
354
+ }
355
+ /// Returns true if `siteName` has been explicitly set.
356
+ public var hasSiteName: Bool {return _storage._siteName != nil}
357
+ /// Clears the value of `siteName`. Subsequent reads from it will return its default value.
358
+ public mutating func clearSiteName() {_uniqueStorage()._siteName = nil}
341
359
 
342
360
  public var validFrom: BlueLocalTimestamp {
343
- get {return _validFrom ?? BlueLocalTimestamp()}
344
- set {_validFrom = newValue}
361
+ get {return _storage._validFrom ?? BlueLocalTimestamp()}
362
+ set {_uniqueStorage()._validFrom = newValue}
345
363
  }
346
364
  /// Returns true if `validFrom` has been explicitly set.
347
- public var hasValidFrom: Bool {return self._validFrom != nil}
365
+ public var hasValidFrom: Bool {return _storage._validFrom != nil}
348
366
  /// Clears the value of `validFrom`. Subsequent reads from it will return its default value.
349
- public mutating func clearValidFrom() {self._validFrom = nil}
367
+ public mutating func clearValidFrom() {_uniqueStorage()._validFrom = nil}
350
368
 
351
369
  public var validTo: BlueLocalTimestamp {
352
- get {return _validTo ?? BlueLocalTimestamp()}
353
- set {_validTo = newValue}
370
+ get {return _storage._validTo ?? BlueLocalTimestamp()}
371
+ set {_uniqueStorage()._validTo = newValue}
354
372
  }
355
373
  /// Returns true if `validTo` has been explicitly set.
356
- public var hasValidTo: Bool {return self._validTo != nil}
374
+ public var hasValidTo: Bool {return _storage._validTo != nil}
357
375
  /// Clears the value of `validTo`. Subsequent reads from it will return its default value.
358
- public mutating func clearValidTo() {self._validTo = nil}
376
+ public mutating func clearValidTo() {_uniqueStorage()._validTo = nil}
377
+
378
+ public var validity: BlueLocalTimestamp {
379
+ get {return _storage._validity ?? BlueLocalTimestamp()}
380
+ set {_uniqueStorage()._validity = newValue}
381
+ }
382
+ /// Returns true if `validity` has been explicitly set.
383
+ public var hasValidity: Bool {return _storage._validity != nil}
384
+ /// Clears the value of `validity`. Subsequent reads from it will return its default value.
385
+ public mutating func clearValidity() {_uniqueStorage()._validity = nil}
359
386
 
360
387
  public var privateKey: Data {
361
- get {return _privateKey ?? Data()}
362
- set {_privateKey = newValue}
388
+ get {return _storage._privateKey ?? Data()}
389
+ set {_uniqueStorage()._privateKey = newValue}
363
390
  }
364
391
  /// Returns true if `privateKey` has been explicitly set.
365
- public var hasPrivateKey: Bool {return self._privateKey != nil}
392
+ public var hasPrivateKey: Bool {return _storage._privateKey != nil}
366
393
  /// Clears the value of `privateKey`. Subsequent reads from it will return its default value.
367
- public mutating func clearPrivateKey() {self._privateKey = nil}
394
+ public mutating func clearPrivateKey() {_uniqueStorage()._privateKey = nil}
368
395
 
369
396
  public var unknownFields = SwiftProtobuf.UnknownStorage()
370
397
 
371
398
  public init() {}
372
399
 
373
- fileprivate var _credentialID: BlueCredentialId? = nil
374
- fileprivate var _credentialType: BlueCredentialType? = nil
375
- fileprivate var _validFrom: BlueLocalTimestamp? = nil
376
- fileprivate var _validTo: BlueLocalTimestamp? = nil
377
- fileprivate var _privateKey: Data? = nil
400
+ fileprivate var _storage = _StorageClass.defaultInstance
378
401
  }
379
402
 
380
403
  public struct BlueAccessCredentialList {
@@ -403,21 +426,21 @@ public struct BlueAccessDevice {
403
426
  /// Clears the value of `deviceID`. Subsequent reads from it will return its default value.
404
427
  public mutating func clearDeviceID() {self._deviceID = nil}
405
428
 
406
- public var name: String {
407
- get {return _name ?? String()}
408
- set {_name = newValue}
429
+ public var objectName: String {
430
+ get {return _objectName ?? String()}
431
+ set {_objectName = newValue}
409
432
  }
410
- /// Returns true if `name` has been explicitly set.
411
- public var hasName: Bool {return self._name != nil}
412
- /// Clears the value of `name`. Subsequent reads from it will return its default value.
413
- public mutating func clearName() {self._name = nil}
433
+ /// Returns true if `objectName` has been explicitly set.
434
+ public var hasObjectName: Bool {return self._objectName != nil}
435
+ /// Clears the value of `objectName`. Subsequent reads from it will return its default value.
436
+ public mutating func clearObjectName() {self._objectName = nil}
414
437
 
415
438
  public var unknownFields = SwiftProtobuf.UnknownStorage()
416
439
 
417
440
  public init() {}
418
441
 
419
442
  fileprivate var _deviceID: String? = nil
420
- fileprivate var _name: String? = nil
443
+ fileprivate var _objectName: String? = nil
421
444
  }
422
445
 
423
446
  public struct BlueAccessDeviceList {
@@ -748,65 +771,132 @@ extension BlueAccessCredential: SwiftProtobuf.Message, SwiftProtobuf._MessageImp
748
771
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
749
772
  1: .same(proto: "credentialId"),
750
773
  2: .same(proto: "credentialType"),
751
- 3: .same(proto: "validFrom"),
752
- 4: .same(proto: "validTo"),
753
- 5: .same(proto: "privateKey"),
774
+ 3: .same(proto: "name"),
775
+ 4: .same(proto: "siteName"),
776
+ 5: .same(proto: "validFrom"),
777
+ 6: .same(proto: "validTo"),
778
+ 7: .same(proto: "validity"),
779
+ 8: .same(proto: "privateKey"),
754
780
  ]
755
781
 
782
+ fileprivate class _StorageClass {
783
+ var _credentialID: BlueCredentialId? = nil
784
+ var _credentialType: BlueCredentialType? = nil
785
+ var _name: String? = nil
786
+ var _siteName: String? = nil
787
+ var _validFrom: BlueLocalTimestamp? = nil
788
+ var _validTo: BlueLocalTimestamp? = nil
789
+ var _validity: BlueLocalTimestamp? = nil
790
+ var _privateKey: Data? = nil
791
+
792
+ static let defaultInstance = _StorageClass()
793
+
794
+ private init() {}
795
+
796
+ init(copying source: _StorageClass) {
797
+ _credentialID = source._credentialID
798
+ _credentialType = source._credentialType
799
+ _name = source._name
800
+ _siteName = source._siteName
801
+ _validFrom = source._validFrom
802
+ _validTo = source._validTo
803
+ _validity = source._validity
804
+ _privateKey = source._privateKey
805
+ }
806
+ }
807
+
808
+ fileprivate mutating func _uniqueStorage() -> _StorageClass {
809
+ if !isKnownUniquelyReferenced(&_storage) {
810
+ _storage = _StorageClass(copying: _storage)
811
+ }
812
+ return _storage
813
+ }
814
+
756
815
  public var isInitialized: Bool {
757
- if self._credentialID == nil {return false}
758
- if self._credentialType == nil {return false}
759
- if let v = self._credentialID, !v.isInitialized {return false}
760
- if let v = self._validFrom, !v.isInitialized {return false}
761
- if let v = self._validTo, !v.isInitialized {return false}
762
- return true
816
+ return withExtendedLifetime(_storage) { (_storage: _StorageClass) in
817
+ if _storage._credentialID == nil {return false}
818
+ if _storage._credentialType == nil {return false}
819
+ if let v = _storage._credentialID, !v.isInitialized {return false}
820
+ if let v = _storage._validFrom, !v.isInitialized {return false}
821
+ if let v = _storage._validTo, !v.isInitialized {return false}
822
+ if let v = _storage._validity, !v.isInitialized {return false}
823
+ return true
824
+ }
763
825
  }
764
826
 
765
827
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
766
- while let fieldNumber = try decoder.nextFieldNumber() {
767
- // The use of inline closures is to circumvent an issue where the compiler
768
- // allocates stack space for every case branch when no optimizations are
769
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
770
- switch fieldNumber {
771
- case 1: try { try decoder.decodeSingularMessageField(value: &self._credentialID) }()
772
- case 2: try { try decoder.decodeSingularEnumField(value: &self._credentialType) }()
773
- case 3: try { try decoder.decodeSingularMessageField(value: &self._validFrom) }()
774
- case 4: try { try decoder.decodeSingularMessageField(value: &self._validTo) }()
775
- case 5: try { try decoder.decodeSingularBytesField(value: &self._privateKey) }()
776
- default: break
828
+ _ = _uniqueStorage()
829
+ try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
830
+ while let fieldNumber = try decoder.nextFieldNumber() {
831
+ // The use of inline closures is to circumvent an issue where the compiler
832
+ // allocates stack space for every case branch when no optimizations are
833
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
834
+ switch fieldNumber {
835
+ case 1: try { try decoder.decodeSingularMessageField(value: &_storage._credentialID) }()
836
+ case 2: try { try decoder.decodeSingularEnumField(value: &_storage._credentialType) }()
837
+ case 3: try { try decoder.decodeSingularStringField(value: &_storage._name) }()
838
+ case 4: try { try decoder.decodeSingularStringField(value: &_storage._siteName) }()
839
+ case 5: try { try decoder.decodeSingularMessageField(value: &_storage._validFrom) }()
840
+ case 6: try { try decoder.decodeSingularMessageField(value: &_storage._validTo) }()
841
+ case 7: try { try decoder.decodeSingularMessageField(value: &_storage._validity) }()
842
+ case 8: try { try decoder.decodeSingularBytesField(value: &_storage._privateKey) }()
843
+ default: break
844
+ }
777
845
  }
778
846
  }
779
847
  }
780
848
 
781
849
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
782
- // The use of inline closures is to circumvent an issue where the compiler
783
- // allocates stack space for every if/case branch local when no optimizations
784
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
785
- // https://github.com/apple/swift-protobuf/issues/1182
786
- try { if let v = self._credentialID {
787
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
788
- } }()
789
- try { if let v = self._credentialType {
790
- try visitor.visitSingularEnumField(value: v, fieldNumber: 2)
791
- } }()
792
- try { if let v = self._validFrom {
793
- try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
794
- } }()
795
- try { if let v = self._validTo {
796
- try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
797
- } }()
798
- try { if let v = self._privateKey {
799
- try visitor.visitSingularBytesField(value: v, fieldNumber: 5)
800
- } }()
850
+ try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
851
+ // The use of inline closures is to circumvent an issue where the compiler
852
+ // allocates stack space for every if/case branch local when no optimizations
853
+ // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
854
+ // https://github.com/apple/swift-protobuf/issues/1182
855
+ try { if let v = _storage._credentialID {
856
+ try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
857
+ } }()
858
+ try { if let v = _storage._credentialType {
859
+ try visitor.visitSingularEnumField(value: v, fieldNumber: 2)
860
+ } }()
861
+ try { if let v = _storage._name {
862
+ try visitor.visitSingularStringField(value: v, fieldNumber: 3)
863
+ } }()
864
+ try { if let v = _storage._siteName {
865
+ try visitor.visitSingularStringField(value: v, fieldNumber: 4)
866
+ } }()
867
+ try { if let v = _storage._validFrom {
868
+ try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
869
+ } }()
870
+ try { if let v = _storage._validTo {
871
+ try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
872
+ } }()
873
+ try { if let v = _storage._validity {
874
+ try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
875
+ } }()
876
+ try { if let v = _storage._privateKey {
877
+ try visitor.visitSingularBytesField(value: v, fieldNumber: 8)
878
+ } }()
879
+ }
801
880
  try unknownFields.traverse(visitor: &visitor)
802
881
  }
803
882
 
804
883
  public static func ==(lhs: BlueAccessCredential, rhs: BlueAccessCredential) -> Bool {
805
- if lhs._credentialID != rhs._credentialID {return false}
806
- if lhs._credentialType != rhs._credentialType {return false}
807
- if lhs._validFrom != rhs._validFrom {return false}
808
- if lhs._validTo != rhs._validTo {return false}
809
- if lhs._privateKey != rhs._privateKey {return false}
884
+ if lhs._storage !== rhs._storage {
885
+ let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
886
+ let _storage = _args.0
887
+ let rhs_storage = _args.1
888
+ if _storage._credentialID != rhs_storage._credentialID {return false}
889
+ if _storage._credentialType != rhs_storage._credentialType {return false}
890
+ if _storage._name != rhs_storage._name {return false}
891
+ if _storage._siteName != rhs_storage._siteName {return false}
892
+ if _storage._validFrom != rhs_storage._validFrom {return false}
893
+ if _storage._validTo != rhs_storage._validTo {return false}
894
+ if _storage._validity != rhs_storage._validity {return false}
895
+ if _storage._privateKey != rhs_storage._privateKey {return false}
896
+ return true
897
+ }
898
+ if !storagesAreEqual {return false}
899
+ }
810
900
  if lhs.unknownFields != rhs.unknownFields {return false}
811
901
  return true
812
902
  }
@@ -853,7 +943,7 @@ extension BlueAccessDevice: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
853
943
  public static let protoMessageName: String = "BlueAccessDevice"
854
944
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
855
945
  1: .same(proto: "deviceId"),
856
- 2: .same(proto: "name"),
946
+ 2: .same(proto: "objectName"),
857
947
  ]
858
948
 
859
949
  public var isInitialized: Bool {
@@ -868,7 +958,7 @@ extension BlueAccessDevice: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
868
958
  // enabled. https://github.com/apple/swift-protobuf/issues/1034
869
959
  switch fieldNumber {
870
960
  case 1: try { try decoder.decodeSingularStringField(value: &self._deviceID) }()
871
- case 2: try { try decoder.decodeSingularStringField(value: &self._name) }()
961
+ case 2: try { try decoder.decodeSingularStringField(value: &self._objectName) }()
872
962
  default: break
873
963
  }
874
964
  }
@@ -882,7 +972,7 @@ extension BlueAccessDevice: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
882
972
  try { if let v = self._deviceID {
883
973
  try visitor.visitSingularStringField(value: v, fieldNumber: 1)
884
974
  } }()
885
- try { if let v = self._name {
975
+ try { if let v = self._objectName {
886
976
  try visitor.visitSingularStringField(value: v, fieldNumber: 2)
887
977
  } }()
888
978
  try unknownFields.traverse(visitor: &visitor)
@@ -890,7 +980,7 @@ extension BlueAccessDevice: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
890
980
 
891
981
  public static func ==(lhs: BlueAccessDevice, rhs: BlueAccessDevice) -> Bool {
892
982
  if lhs._deviceID != rhs._deviceID {return false}
893
- if lhs._name != rhs._name {return false}
983
+ if lhs._objectName != rhs._objectName {return false}
894
984
  if lhs.unknownFields != rhs.unknownFields {return false}
895
985
  return true
896
986
  }