index.js 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187
  1. /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
  2. "use strict";
  3. var $protobuf = require("protobufjs/minimal");
  4. // Common aliases
  5. var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
  6. // Exported root namespace
  7. var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
  8. $root.GeoCoordiantes = (function() {
  9. /**
  10. * Properties of a GeoCoordiantes.
  11. * @exports IGeoCoordiantes
  12. * @interface IGeoCoordiantes
  13. * @property {number|null} [latitude] GeoCoordiantes latitude
  14. * @property {number|null} [longitude] GeoCoordiantes longitude
  15. */
  16. /**
  17. * Constructs a new GeoCoordiantes.
  18. * @exports GeoCoordiantes
  19. * @classdesc Represents a GeoCoordiantes.
  20. * @implements IGeoCoordiantes
  21. * @constructor
  22. * @param {IGeoCoordiantes=} [properties] Properties to set
  23. */
  24. function GeoCoordiantes(properties) {
  25. if (properties)
  26. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  27. if (properties[keys[i]] != null)
  28. this[keys[i]] = properties[keys[i]];
  29. }
  30. /**
  31. * GeoCoordiantes latitude.
  32. * @member {number} latitude
  33. * @memberof GeoCoordiantes
  34. * @instance
  35. */
  36. GeoCoordiantes.prototype.latitude = 0;
  37. /**
  38. * GeoCoordiantes longitude.
  39. * @member {number} longitude
  40. * @memberof GeoCoordiantes
  41. * @instance
  42. */
  43. GeoCoordiantes.prototype.longitude = 0;
  44. /**
  45. * Creates a new GeoCoordiantes instance using the specified properties.
  46. * @function create
  47. * @memberof GeoCoordiantes
  48. * @static
  49. * @param {IGeoCoordiantes=} [properties] Properties to set
  50. * @returns {GeoCoordiantes} GeoCoordiantes instance
  51. */
  52. GeoCoordiantes.create = function create(properties) {
  53. return new GeoCoordiantes(properties);
  54. };
  55. /**
  56. * Encodes the specified GeoCoordiantes message. Does not implicitly {@link GeoCoordiantes.verify|verify} messages.
  57. * @function encode
  58. * @memberof GeoCoordiantes
  59. * @static
  60. * @param {IGeoCoordiantes} message GeoCoordiantes message or plain object to encode
  61. * @param {$protobuf.Writer} [writer] Writer to encode to
  62. * @returns {$protobuf.Writer} Writer
  63. */
  64. GeoCoordiantes.encode = function encode(message, writer) {
  65. if (!writer)
  66. writer = $Writer.create();
  67. if (message.latitude != null && Object.hasOwnProperty.call(message, "latitude"))
  68. writer.uint32(/* id 3, wireType 5 =*/29).float(message.latitude);
  69. if (message.longitude != null && Object.hasOwnProperty.call(message, "longitude"))
  70. writer.uint32(/* id 4, wireType 5 =*/37).float(message.longitude);
  71. return writer;
  72. };
  73. /**
  74. * Encodes the specified GeoCoordiantes message, length delimited. Does not implicitly {@link GeoCoordiantes.verify|verify} messages.
  75. * @function encodeDelimited
  76. * @memberof GeoCoordiantes
  77. * @static
  78. * @param {IGeoCoordiantes} message GeoCoordiantes message or plain object to encode
  79. * @param {$protobuf.Writer} [writer] Writer to encode to
  80. * @returns {$protobuf.Writer} Writer
  81. */
  82. GeoCoordiantes.encodeDelimited = function encodeDelimited(message, writer) {
  83. return this.encode(message, writer).ldelim();
  84. };
  85. /**
  86. * Decodes a GeoCoordiantes message from the specified reader or buffer.
  87. * @function decode
  88. * @memberof GeoCoordiantes
  89. * @static
  90. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  91. * @param {number} [length] Message length if known beforehand
  92. * @returns {GeoCoordiantes} GeoCoordiantes
  93. * @throws {Error} If the payload is not a reader or valid buffer
  94. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  95. */
  96. GeoCoordiantes.decode = function decode(reader, length) {
  97. if (!(reader instanceof $Reader))
  98. reader = $Reader.create(reader);
  99. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.GeoCoordiantes();
  100. while (reader.pos < end) {
  101. var tag = reader.uint32();
  102. switch (tag >>> 3) {
  103. case 3:
  104. message.latitude = reader.float();
  105. break;
  106. case 4:
  107. message.longitude = reader.float();
  108. break;
  109. default:
  110. reader.skipType(tag & 7);
  111. break;
  112. }
  113. }
  114. return message;
  115. };
  116. /**
  117. * Decodes a GeoCoordiantes message from the specified reader or buffer, length delimited.
  118. * @function decodeDelimited
  119. * @memberof GeoCoordiantes
  120. * @static
  121. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  122. * @returns {GeoCoordiantes} GeoCoordiantes
  123. * @throws {Error} If the payload is not a reader or valid buffer
  124. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  125. */
  126. GeoCoordiantes.decodeDelimited = function decodeDelimited(reader) {
  127. if (!(reader instanceof $Reader))
  128. reader = new $Reader(reader);
  129. return this.decode(reader, reader.uint32());
  130. };
  131. /**
  132. * Verifies a GeoCoordiantes message.
  133. * @function verify
  134. * @memberof GeoCoordiantes
  135. * @static
  136. * @param {Object.<string,*>} message Plain object to verify
  137. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  138. */
  139. GeoCoordiantes.verify = function verify(message) {
  140. if (typeof message !== "object" || message === null)
  141. return "object expected";
  142. if (message.latitude != null && message.hasOwnProperty("latitude"))
  143. if (typeof message.latitude !== "number")
  144. return "latitude: number expected";
  145. if (message.longitude != null && message.hasOwnProperty("longitude"))
  146. if (typeof message.longitude !== "number")
  147. return "longitude: number expected";
  148. return null;
  149. };
  150. /**
  151. * Creates a GeoCoordiantes message from a plain object. Also converts values to their respective internal types.
  152. * @function fromObject
  153. * @memberof GeoCoordiantes
  154. * @static
  155. * @param {Object.<string,*>} object Plain object
  156. * @returns {GeoCoordiantes} GeoCoordiantes
  157. */
  158. GeoCoordiantes.fromObject = function fromObject(object) {
  159. if (object instanceof $root.GeoCoordiantes)
  160. return object;
  161. var message = new $root.GeoCoordiantes();
  162. if (object.latitude != null)
  163. message.latitude = Number(object.latitude);
  164. if (object.longitude != null)
  165. message.longitude = Number(object.longitude);
  166. return message;
  167. };
  168. /**
  169. * Creates a plain object from a GeoCoordiantes message. Also converts values to other types if specified.
  170. * @function toObject
  171. * @memberof GeoCoordiantes
  172. * @static
  173. * @param {GeoCoordiantes} message GeoCoordiantes
  174. * @param {$protobuf.IConversionOptions} [options] Conversion options
  175. * @returns {Object.<string,*>} Plain object
  176. */
  177. GeoCoordiantes.toObject = function toObject(message, options) {
  178. if (!options)
  179. options = {};
  180. var object = {};
  181. if (options.defaults) {
  182. object.latitude = 0;
  183. object.longitude = 0;
  184. }
  185. if (message.latitude != null && message.hasOwnProperty("latitude"))
  186. object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude;
  187. if (message.longitude != null && message.hasOwnProperty("longitude"))
  188. object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude;
  189. return object;
  190. };
  191. /**
  192. * Converts this GeoCoordiantes to JSON.
  193. * @function toJSON
  194. * @memberof GeoCoordiantes
  195. * @instance
  196. * @returns {Object.<string,*>} JSON object
  197. */
  198. GeoCoordiantes.prototype.toJSON = function toJSON() {
  199. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  200. };
  201. return GeoCoordiantes;
  202. })();
  203. $root.NodeLocationMetadata = (function() {
  204. /**
  205. * Properties of a NodeLocationMetadata.
  206. * @exports INodeLocationMetadata
  207. * @interface INodeLocationMetadata
  208. * @property {string|null} [countryCode] NodeLocationMetadata countryCode
  209. * @property {string|null} [city] NodeLocationMetadata city
  210. * @property {IGeoCoordiantes|null} [coordinates] NodeLocationMetadata coordinates
  211. */
  212. /**
  213. * Constructs a new NodeLocationMetadata.
  214. * @exports NodeLocationMetadata
  215. * @classdesc Represents a NodeLocationMetadata.
  216. * @implements INodeLocationMetadata
  217. * @constructor
  218. * @param {INodeLocationMetadata=} [properties] Properties to set
  219. */
  220. function NodeLocationMetadata(properties) {
  221. if (properties)
  222. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  223. if (properties[keys[i]] != null)
  224. this[keys[i]] = properties[keys[i]];
  225. }
  226. /**
  227. * NodeLocationMetadata countryCode.
  228. * @member {string} countryCode
  229. * @memberof NodeLocationMetadata
  230. * @instance
  231. */
  232. NodeLocationMetadata.prototype.countryCode = "";
  233. /**
  234. * NodeLocationMetadata city.
  235. * @member {string} city
  236. * @memberof NodeLocationMetadata
  237. * @instance
  238. */
  239. NodeLocationMetadata.prototype.city = "";
  240. /**
  241. * NodeLocationMetadata coordinates.
  242. * @member {IGeoCoordiantes|null|undefined} coordinates
  243. * @memberof NodeLocationMetadata
  244. * @instance
  245. */
  246. NodeLocationMetadata.prototype.coordinates = null;
  247. /**
  248. * Creates a new NodeLocationMetadata instance using the specified properties.
  249. * @function create
  250. * @memberof NodeLocationMetadata
  251. * @static
  252. * @param {INodeLocationMetadata=} [properties] Properties to set
  253. * @returns {NodeLocationMetadata} NodeLocationMetadata instance
  254. */
  255. NodeLocationMetadata.create = function create(properties) {
  256. return new NodeLocationMetadata(properties);
  257. };
  258. /**
  259. * Encodes the specified NodeLocationMetadata message. Does not implicitly {@link NodeLocationMetadata.verify|verify} messages.
  260. * @function encode
  261. * @memberof NodeLocationMetadata
  262. * @static
  263. * @param {INodeLocationMetadata} message NodeLocationMetadata message or plain object to encode
  264. * @param {$protobuf.Writer} [writer] Writer to encode to
  265. * @returns {$protobuf.Writer} Writer
  266. */
  267. NodeLocationMetadata.encode = function encode(message, writer) {
  268. if (!writer)
  269. writer = $Writer.create();
  270. if (message.countryCode != null && Object.hasOwnProperty.call(message, "countryCode"))
  271. writer.uint32(/* id 1, wireType 2 =*/10).string(message.countryCode);
  272. if (message.city != null && Object.hasOwnProperty.call(message, "city"))
  273. writer.uint32(/* id 2, wireType 2 =*/18).string(message.city);
  274. if (message.coordinates != null && Object.hasOwnProperty.call(message, "coordinates"))
  275. $root.GeoCoordiantes.encode(message.coordinates, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
  276. return writer;
  277. };
  278. /**
  279. * Encodes the specified NodeLocationMetadata message, length delimited. Does not implicitly {@link NodeLocationMetadata.verify|verify} messages.
  280. * @function encodeDelimited
  281. * @memberof NodeLocationMetadata
  282. * @static
  283. * @param {INodeLocationMetadata} message NodeLocationMetadata message or plain object to encode
  284. * @param {$protobuf.Writer} [writer] Writer to encode to
  285. * @returns {$protobuf.Writer} Writer
  286. */
  287. NodeLocationMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  288. return this.encode(message, writer).ldelim();
  289. };
  290. /**
  291. * Decodes a NodeLocationMetadata message from the specified reader or buffer.
  292. * @function decode
  293. * @memberof NodeLocationMetadata
  294. * @static
  295. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  296. * @param {number} [length] Message length if known beforehand
  297. * @returns {NodeLocationMetadata} NodeLocationMetadata
  298. * @throws {Error} If the payload is not a reader or valid buffer
  299. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  300. */
  301. NodeLocationMetadata.decode = function decode(reader, length) {
  302. if (!(reader instanceof $Reader))
  303. reader = $Reader.create(reader);
  304. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.NodeLocationMetadata();
  305. while (reader.pos < end) {
  306. var tag = reader.uint32();
  307. switch (tag >>> 3) {
  308. case 1:
  309. message.countryCode = reader.string();
  310. break;
  311. case 2:
  312. message.city = reader.string();
  313. break;
  314. case 3:
  315. message.coordinates = $root.GeoCoordiantes.decode(reader, reader.uint32());
  316. break;
  317. default:
  318. reader.skipType(tag & 7);
  319. break;
  320. }
  321. }
  322. return message;
  323. };
  324. /**
  325. * Decodes a NodeLocationMetadata message from the specified reader or buffer, length delimited.
  326. * @function decodeDelimited
  327. * @memberof NodeLocationMetadata
  328. * @static
  329. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  330. * @returns {NodeLocationMetadata} NodeLocationMetadata
  331. * @throws {Error} If the payload is not a reader or valid buffer
  332. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  333. */
  334. NodeLocationMetadata.decodeDelimited = function decodeDelimited(reader) {
  335. if (!(reader instanceof $Reader))
  336. reader = new $Reader(reader);
  337. return this.decode(reader, reader.uint32());
  338. };
  339. /**
  340. * Verifies a NodeLocationMetadata message.
  341. * @function verify
  342. * @memberof NodeLocationMetadata
  343. * @static
  344. * @param {Object.<string,*>} message Plain object to verify
  345. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  346. */
  347. NodeLocationMetadata.verify = function verify(message) {
  348. if (typeof message !== "object" || message === null)
  349. return "object expected";
  350. if (message.countryCode != null && message.hasOwnProperty("countryCode"))
  351. if (!$util.isString(message.countryCode))
  352. return "countryCode: string expected";
  353. if (message.city != null && message.hasOwnProperty("city"))
  354. if (!$util.isString(message.city))
  355. return "city: string expected";
  356. if (message.coordinates != null && message.hasOwnProperty("coordinates")) {
  357. var error = $root.GeoCoordiantes.verify(message.coordinates);
  358. if (error)
  359. return "coordinates." + error;
  360. }
  361. return null;
  362. };
  363. /**
  364. * Creates a NodeLocationMetadata message from a plain object. Also converts values to their respective internal types.
  365. * @function fromObject
  366. * @memberof NodeLocationMetadata
  367. * @static
  368. * @param {Object.<string,*>} object Plain object
  369. * @returns {NodeLocationMetadata} NodeLocationMetadata
  370. */
  371. NodeLocationMetadata.fromObject = function fromObject(object) {
  372. if (object instanceof $root.NodeLocationMetadata)
  373. return object;
  374. var message = new $root.NodeLocationMetadata();
  375. if (object.countryCode != null)
  376. message.countryCode = String(object.countryCode);
  377. if (object.city != null)
  378. message.city = String(object.city);
  379. if (object.coordinates != null) {
  380. if (typeof object.coordinates !== "object")
  381. throw TypeError(".NodeLocationMetadata.coordinates: object expected");
  382. message.coordinates = $root.GeoCoordiantes.fromObject(object.coordinates);
  383. }
  384. return message;
  385. };
  386. /**
  387. * Creates a plain object from a NodeLocationMetadata message. Also converts values to other types if specified.
  388. * @function toObject
  389. * @memberof NodeLocationMetadata
  390. * @static
  391. * @param {NodeLocationMetadata} message NodeLocationMetadata
  392. * @param {$protobuf.IConversionOptions} [options] Conversion options
  393. * @returns {Object.<string,*>} Plain object
  394. */
  395. NodeLocationMetadata.toObject = function toObject(message, options) {
  396. if (!options)
  397. options = {};
  398. var object = {};
  399. if (options.defaults) {
  400. object.countryCode = "";
  401. object.city = "";
  402. object.coordinates = null;
  403. }
  404. if (message.countryCode != null && message.hasOwnProperty("countryCode"))
  405. object.countryCode = message.countryCode;
  406. if (message.city != null && message.hasOwnProperty("city"))
  407. object.city = message.city;
  408. if (message.coordinates != null && message.hasOwnProperty("coordinates"))
  409. object.coordinates = $root.GeoCoordiantes.toObject(message.coordinates, options);
  410. return object;
  411. };
  412. /**
  413. * Converts this NodeLocationMetadata to JSON.
  414. * @function toJSON
  415. * @memberof NodeLocationMetadata
  416. * @instance
  417. * @returns {Object.<string,*>} JSON object
  418. */
  419. NodeLocationMetadata.prototype.toJSON = function toJSON() {
  420. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  421. };
  422. return NodeLocationMetadata;
  423. })();
  424. $root.StorageBucketOperatorMetadata = (function() {
  425. /**
  426. * Properties of a StorageBucketOperatorMetadata.
  427. * @exports IStorageBucketOperatorMetadata
  428. * @interface IStorageBucketOperatorMetadata
  429. * @property {string|null} [endpoint] StorageBucketOperatorMetadata endpoint
  430. * @property {INodeLocationMetadata|null} [location] StorageBucketOperatorMetadata location
  431. * @property {string|null} [extra] StorageBucketOperatorMetadata extra
  432. */
  433. /**
  434. * Constructs a new StorageBucketOperatorMetadata.
  435. * @exports StorageBucketOperatorMetadata
  436. * @classdesc Represents a StorageBucketOperatorMetadata.
  437. * @implements IStorageBucketOperatorMetadata
  438. * @constructor
  439. * @param {IStorageBucketOperatorMetadata=} [properties] Properties to set
  440. */
  441. function StorageBucketOperatorMetadata(properties) {
  442. if (properties)
  443. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  444. if (properties[keys[i]] != null)
  445. this[keys[i]] = properties[keys[i]];
  446. }
  447. /**
  448. * StorageBucketOperatorMetadata endpoint.
  449. * @member {string} endpoint
  450. * @memberof StorageBucketOperatorMetadata
  451. * @instance
  452. */
  453. StorageBucketOperatorMetadata.prototype.endpoint = "";
  454. /**
  455. * StorageBucketOperatorMetadata location.
  456. * @member {INodeLocationMetadata|null|undefined} location
  457. * @memberof StorageBucketOperatorMetadata
  458. * @instance
  459. */
  460. StorageBucketOperatorMetadata.prototype.location = null;
  461. /**
  462. * StorageBucketOperatorMetadata extra.
  463. * @member {string} extra
  464. * @memberof StorageBucketOperatorMetadata
  465. * @instance
  466. */
  467. StorageBucketOperatorMetadata.prototype.extra = "";
  468. /**
  469. * Creates a new StorageBucketOperatorMetadata instance using the specified properties.
  470. * @function create
  471. * @memberof StorageBucketOperatorMetadata
  472. * @static
  473. * @param {IStorageBucketOperatorMetadata=} [properties] Properties to set
  474. * @returns {StorageBucketOperatorMetadata} StorageBucketOperatorMetadata instance
  475. */
  476. StorageBucketOperatorMetadata.create = function create(properties) {
  477. return new StorageBucketOperatorMetadata(properties);
  478. };
  479. /**
  480. * Encodes the specified StorageBucketOperatorMetadata message. Does not implicitly {@link StorageBucketOperatorMetadata.verify|verify} messages.
  481. * @function encode
  482. * @memberof StorageBucketOperatorMetadata
  483. * @static
  484. * @param {IStorageBucketOperatorMetadata} message StorageBucketOperatorMetadata message or plain object to encode
  485. * @param {$protobuf.Writer} [writer] Writer to encode to
  486. * @returns {$protobuf.Writer} Writer
  487. */
  488. StorageBucketOperatorMetadata.encode = function encode(message, writer) {
  489. if (!writer)
  490. writer = $Writer.create();
  491. if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint"))
  492. writer.uint32(/* id 1, wireType 2 =*/10).string(message.endpoint);
  493. if (message.location != null && Object.hasOwnProperty.call(message, "location"))
  494. $root.NodeLocationMetadata.encode(message.location, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
  495. if (message.extra != null && Object.hasOwnProperty.call(message, "extra"))
  496. writer.uint32(/* id 3, wireType 2 =*/26).string(message.extra);
  497. return writer;
  498. };
  499. /**
  500. * Encodes the specified StorageBucketOperatorMetadata message, length delimited. Does not implicitly {@link StorageBucketOperatorMetadata.verify|verify} messages.
  501. * @function encodeDelimited
  502. * @memberof StorageBucketOperatorMetadata
  503. * @static
  504. * @param {IStorageBucketOperatorMetadata} message StorageBucketOperatorMetadata message or plain object to encode
  505. * @param {$protobuf.Writer} [writer] Writer to encode to
  506. * @returns {$protobuf.Writer} Writer
  507. */
  508. StorageBucketOperatorMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  509. return this.encode(message, writer).ldelim();
  510. };
  511. /**
  512. * Decodes a StorageBucketOperatorMetadata message from the specified reader or buffer.
  513. * @function decode
  514. * @memberof StorageBucketOperatorMetadata
  515. * @static
  516. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  517. * @param {number} [length] Message length if known beforehand
  518. * @returns {StorageBucketOperatorMetadata} StorageBucketOperatorMetadata
  519. * @throws {Error} If the payload is not a reader or valid buffer
  520. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  521. */
  522. StorageBucketOperatorMetadata.decode = function decode(reader, length) {
  523. if (!(reader instanceof $Reader))
  524. reader = $Reader.create(reader);
  525. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StorageBucketOperatorMetadata();
  526. while (reader.pos < end) {
  527. var tag = reader.uint32();
  528. switch (tag >>> 3) {
  529. case 1:
  530. message.endpoint = reader.string();
  531. break;
  532. case 2:
  533. message.location = $root.NodeLocationMetadata.decode(reader, reader.uint32());
  534. break;
  535. case 3:
  536. message.extra = reader.string();
  537. break;
  538. default:
  539. reader.skipType(tag & 7);
  540. break;
  541. }
  542. }
  543. return message;
  544. };
  545. /**
  546. * Decodes a StorageBucketOperatorMetadata message from the specified reader or buffer, length delimited.
  547. * @function decodeDelimited
  548. * @memberof StorageBucketOperatorMetadata
  549. * @static
  550. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  551. * @returns {StorageBucketOperatorMetadata} StorageBucketOperatorMetadata
  552. * @throws {Error} If the payload is not a reader or valid buffer
  553. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  554. */
  555. StorageBucketOperatorMetadata.decodeDelimited = function decodeDelimited(reader) {
  556. if (!(reader instanceof $Reader))
  557. reader = new $Reader(reader);
  558. return this.decode(reader, reader.uint32());
  559. };
  560. /**
  561. * Verifies a StorageBucketOperatorMetadata message.
  562. * @function verify
  563. * @memberof StorageBucketOperatorMetadata
  564. * @static
  565. * @param {Object.<string,*>} message Plain object to verify
  566. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  567. */
  568. StorageBucketOperatorMetadata.verify = function verify(message) {
  569. if (typeof message !== "object" || message === null)
  570. return "object expected";
  571. if (message.endpoint != null && message.hasOwnProperty("endpoint"))
  572. if (!$util.isString(message.endpoint))
  573. return "endpoint: string expected";
  574. if (message.location != null && message.hasOwnProperty("location")) {
  575. var error = $root.NodeLocationMetadata.verify(message.location);
  576. if (error)
  577. return "location." + error;
  578. }
  579. if (message.extra != null && message.hasOwnProperty("extra"))
  580. if (!$util.isString(message.extra))
  581. return "extra: string expected";
  582. return null;
  583. };
  584. /**
  585. * Creates a StorageBucketOperatorMetadata message from a plain object. Also converts values to their respective internal types.
  586. * @function fromObject
  587. * @memberof StorageBucketOperatorMetadata
  588. * @static
  589. * @param {Object.<string,*>} object Plain object
  590. * @returns {StorageBucketOperatorMetadata} StorageBucketOperatorMetadata
  591. */
  592. StorageBucketOperatorMetadata.fromObject = function fromObject(object) {
  593. if (object instanceof $root.StorageBucketOperatorMetadata)
  594. return object;
  595. var message = new $root.StorageBucketOperatorMetadata();
  596. if (object.endpoint != null)
  597. message.endpoint = String(object.endpoint);
  598. if (object.location != null) {
  599. if (typeof object.location !== "object")
  600. throw TypeError(".StorageBucketOperatorMetadata.location: object expected");
  601. message.location = $root.NodeLocationMetadata.fromObject(object.location);
  602. }
  603. if (object.extra != null)
  604. message.extra = String(object.extra);
  605. return message;
  606. };
  607. /**
  608. * Creates a plain object from a StorageBucketOperatorMetadata message. Also converts values to other types if specified.
  609. * @function toObject
  610. * @memberof StorageBucketOperatorMetadata
  611. * @static
  612. * @param {StorageBucketOperatorMetadata} message StorageBucketOperatorMetadata
  613. * @param {$protobuf.IConversionOptions} [options] Conversion options
  614. * @returns {Object.<string,*>} Plain object
  615. */
  616. StorageBucketOperatorMetadata.toObject = function toObject(message, options) {
  617. if (!options)
  618. options = {};
  619. var object = {};
  620. if (options.defaults) {
  621. object.endpoint = "";
  622. object.location = null;
  623. object.extra = "";
  624. }
  625. if (message.endpoint != null && message.hasOwnProperty("endpoint"))
  626. object.endpoint = message.endpoint;
  627. if (message.location != null && message.hasOwnProperty("location"))
  628. object.location = $root.NodeLocationMetadata.toObject(message.location, options);
  629. if (message.extra != null && message.hasOwnProperty("extra"))
  630. object.extra = message.extra;
  631. return object;
  632. };
  633. /**
  634. * Converts this StorageBucketOperatorMetadata to JSON.
  635. * @function toJSON
  636. * @memberof StorageBucketOperatorMetadata
  637. * @instance
  638. * @returns {Object.<string,*>} JSON object
  639. */
  640. StorageBucketOperatorMetadata.prototype.toJSON = function toJSON() {
  641. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  642. };
  643. return StorageBucketOperatorMetadata;
  644. })();
  645. $root.DistributionBucketOperatorMetadata = (function() {
  646. /**
  647. * Properties of a DistributionBucketOperatorMetadata.
  648. * @exports IDistributionBucketOperatorMetadata
  649. * @interface IDistributionBucketOperatorMetadata
  650. * @property {string|null} [endpoint] DistributionBucketOperatorMetadata endpoint
  651. * @property {INodeLocationMetadata|null} [location] DistributionBucketOperatorMetadata location
  652. * @property {string|null} [extra] DistributionBucketOperatorMetadata extra
  653. */
  654. /**
  655. * Constructs a new DistributionBucketOperatorMetadata.
  656. * @exports DistributionBucketOperatorMetadata
  657. * @classdesc Represents a DistributionBucketOperatorMetadata.
  658. * @implements IDistributionBucketOperatorMetadata
  659. * @constructor
  660. * @param {IDistributionBucketOperatorMetadata=} [properties] Properties to set
  661. */
  662. function DistributionBucketOperatorMetadata(properties) {
  663. if (properties)
  664. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  665. if (properties[keys[i]] != null)
  666. this[keys[i]] = properties[keys[i]];
  667. }
  668. /**
  669. * DistributionBucketOperatorMetadata endpoint.
  670. * @member {string} endpoint
  671. * @memberof DistributionBucketOperatorMetadata
  672. * @instance
  673. */
  674. DistributionBucketOperatorMetadata.prototype.endpoint = "";
  675. /**
  676. * DistributionBucketOperatorMetadata location.
  677. * @member {INodeLocationMetadata|null|undefined} location
  678. * @memberof DistributionBucketOperatorMetadata
  679. * @instance
  680. */
  681. DistributionBucketOperatorMetadata.prototype.location = null;
  682. /**
  683. * DistributionBucketOperatorMetadata extra.
  684. * @member {string} extra
  685. * @memberof DistributionBucketOperatorMetadata
  686. * @instance
  687. */
  688. DistributionBucketOperatorMetadata.prototype.extra = "";
  689. /**
  690. * Creates a new DistributionBucketOperatorMetadata instance using the specified properties.
  691. * @function create
  692. * @memberof DistributionBucketOperatorMetadata
  693. * @static
  694. * @param {IDistributionBucketOperatorMetadata=} [properties] Properties to set
  695. * @returns {DistributionBucketOperatorMetadata} DistributionBucketOperatorMetadata instance
  696. */
  697. DistributionBucketOperatorMetadata.create = function create(properties) {
  698. return new DistributionBucketOperatorMetadata(properties);
  699. };
  700. /**
  701. * Encodes the specified DistributionBucketOperatorMetadata message. Does not implicitly {@link DistributionBucketOperatorMetadata.verify|verify} messages.
  702. * @function encode
  703. * @memberof DistributionBucketOperatorMetadata
  704. * @static
  705. * @param {IDistributionBucketOperatorMetadata} message DistributionBucketOperatorMetadata message or plain object to encode
  706. * @param {$protobuf.Writer} [writer] Writer to encode to
  707. * @returns {$protobuf.Writer} Writer
  708. */
  709. DistributionBucketOperatorMetadata.encode = function encode(message, writer) {
  710. if (!writer)
  711. writer = $Writer.create();
  712. if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint"))
  713. writer.uint32(/* id 1, wireType 2 =*/10).string(message.endpoint);
  714. if (message.location != null && Object.hasOwnProperty.call(message, "location"))
  715. $root.NodeLocationMetadata.encode(message.location, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
  716. if (message.extra != null && Object.hasOwnProperty.call(message, "extra"))
  717. writer.uint32(/* id 3, wireType 2 =*/26).string(message.extra);
  718. return writer;
  719. };
  720. /**
  721. * Encodes the specified DistributionBucketOperatorMetadata message, length delimited. Does not implicitly {@link DistributionBucketOperatorMetadata.verify|verify} messages.
  722. * @function encodeDelimited
  723. * @memberof DistributionBucketOperatorMetadata
  724. * @static
  725. * @param {IDistributionBucketOperatorMetadata} message DistributionBucketOperatorMetadata message or plain object to encode
  726. * @param {$protobuf.Writer} [writer] Writer to encode to
  727. * @returns {$protobuf.Writer} Writer
  728. */
  729. DistributionBucketOperatorMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  730. return this.encode(message, writer).ldelim();
  731. };
  732. /**
  733. * Decodes a DistributionBucketOperatorMetadata message from the specified reader or buffer.
  734. * @function decode
  735. * @memberof DistributionBucketOperatorMetadata
  736. * @static
  737. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  738. * @param {number} [length] Message length if known beforehand
  739. * @returns {DistributionBucketOperatorMetadata} DistributionBucketOperatorMetadata
  740. * @throws {Error} If the payload is not a reader or valid buffer
  741. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  742. */
  743. DistributionBucketOperatorMetadata.decode = function decode(reader, length) {
  744. if (!(reader instanceof $Reader))
  745. reader = $Reader.create(reader);
  746. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DistributionBucketOperatorMetadata();
  747. while (reader.pos < end) {
  748. var tag = reader.uint32();
  749. switch (tag >>> 3) {
  750. case 1:
  751. message.endpoint = reader.string();
  752. break;
  753. case 2:
  754. message.location = $root.NodeLocationMetadata.decode(reader, reader.uint32());
  755. break;
  756. case 3:
  757. message.extra = reader.string();
  758. break;
  759. default:
  760. reader.skipType(tag & 7);
  761. break;
  762. }
  763. }
  764. return message;
  765. };
  766. /**
  767. * Decodes a DistributionBucketOperatorMetadata message from the specified reader or buffer, length delimited.
  768. * @function decodeDelimited
  769. * @memberof DistributionBucketOperatorMetadata
  770. * @static
  771. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  772. * @returns {DistributionBucketOperatorMetadata} DistributionBucketOperatorMetadata
  773. * @throws {Error} If the payload is not a reader or valid buffer
  774. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  775. */
  776. DistributionBucketOperatorMetadata.decodeDelimited = function decodeDelimited(reader) {
  777. if (!(reader instanceof $Reader))
  778. reader = new $Reader(reader);
  779. return this.decode(reader, reader.uint32());
  780. };
  781. /**
  782. * Verifies a DistributionBucketOperatorMetadata message.
  783. * @function verify
  784. * @memberof DistributionBucketOperatorMetadata
  785. * @static
  786. * @param {Object.<string,*>} message Plain object to verify
  787. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  788. */
  789. DistributionBucketOperatorMetadata.verify = function verify(message) {
  790. if (typeof message !== "object" || message === null)
  791. return "object expected";
  792. if (message.endpoint != null && message.hasOwnProperty("endpoint"))
  793. if (!$util.isString(message.endpoint))
  794. return "endpoint: string expected";
  795. if (message.location != null && message.hasOwnProperty("location")) {
  796. var error = $root.NodeLocationMetadata.verify(message.location);
  797. if (error)
  798. return "location." + error;
  799. }
  800. if (message.extra != null && message.hasOwnProperty("extra"))
  801. if (!$util.isString(message.extra))
  802. return "extra: string expected";
  803. return null;
  804. };
  805. /**
  806. * Creates a DistributionBucketOperatorMetadata message from a plain object. Also converts values to their respective internal types.
  807. * @function fromObject
  808. * @memberof DistributionBucketOperatorMetadata
  809. * @static
  810. * @param {Object.<string,*>} object Plain object
  811. * @returns {DistributionBucketOperatorMetadata} DistributionBucketOperatorMetadata
  812. */
  813. DistributionBucketOperatorMetadata.fromObject = function fromObject(object) {
  814. if (object instanceof $root.DistributionBucketOperatorMetadata)
  815. return object;
  816. var message = new $root.DistributionBucketOperatorMetadata();
  817. if (object.endpoint != null)
  818. message.endpoint = String(object.endpoint);
  819. if (object.location != null) {
  820. if (typeof object.location !== "object")
  821. throw TypeError(".DistributionBucketOperatorMetadata.location: object expected");
  822. message.location = $root.NodeLocationMetadata.fromObject(object.location);
  823. }
  824. if (object.extra != null)
  825. message.extra = String(object.extra);
  826. return message;
  827. };
  828. /**
  829. * Creates a plain object from a DistributionBucketOperatorMetadata message. Also converts values to other types if specified.
  830. * @function toObject
  831. * @memberof DistributionBucketOperatorMetadata
  832. * @static
  833. * @param {DistributionBucketOperatorMetadata} message DistributionBucketOperatorMetadata
  834. * @param {$protobuf.IConversionOptions} [options] Conversion options
  835. * @returns {Object.<string,*>} Plain object
  836. */
  837. DistributionBucketOperatorMetadata.toObject = function toObject(message, options) {
  838. if (!options)
  839. options = {};
  840. var object = {};
  841. if (options.defaults) {
  842. object.endpoint = "";
  843. object.location = null;
  844. object.extra = "";
  845. }
  846. if (message.endpoint != null && message.hasOwnProperty("endpoint"))
  847. object.endpoint = message.endpoint;
  848. if (message.location != null && message.hasOwnProperty("location"))
  849. object.location = $root.NodeLocationMetadata.toObject(message.location, options);
  850. if (message.extra != null && message.hasOwnProperty("extra"))
  851. object.extra = message.extra;
  852. return object;
  853. };
  854. /**
  855. * Converts this DistributionBucketOperatorMetadata to JSON.
  856. * @function toJSON
  857. * @memberof DistributionBucketOperatorMetadata
  858. * @instance
  859. * @returns {Object.<string,*>} JSON object
  860. */
  861. DistributionBucketOperatorMetadata.prototype.toJSON = function toJSON() {
  862. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  863. };
  864. return DistributionBucketOperatorMetadata;
  865. })();
  866. $root.DistributionBucketFamilyMetadata = (function() {
  867. /**
  868. * Properties of a DistributionBucketFamilyMetadata.
  869. * @exports IDistributionBucketFamilyMetadata
  870. * @interface IDistributionBucketFamilyMetadata
  871. * @property {string|null} [region] DistributionBucketFamilyMetadata region
  872. * @property {string|null} [description] DistributionBucketFamilyMetadata description
  873. * @property {Array.<IGeoCoordiantes>|null} [boundary] DistributionBucketFamilyMetadata boundary
  874. */
  875. /**
  876. * Constructs a new DistributionBucketFamilyMetadata.
  877. * @exports DistributionBucketFamilyMetadata
  878. * @classdesc Represents a DistributionBucketFamilyMetadata.
  879. * @implements IDistributionBucketFamilyMetadata
  880. * @constructor
  881. * @param {IDistributionBucketFamilyMetadata=} [properties] Properties to set
  882. */
  883. function DistributionBucketFamilyMetadata(properties) {
  884. this.boundary = [];
  885. if (properties)
  886. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  887. if (properties[keys[i]] != null)
  888. this[keys[i]] = properties[keys[i]];
  889. }
  890. /**
  891. * DistributionBucketFamilyMetadata region.
  892. * @member {string} region
  893. * @memberof DistributionBucketFamilyMetadata
  894. * @instance
  895. */
  896. DistributionBucketFamilyMetadata.prototype.region = "";
  897. /**
  898. * DistributionBucketFamilyMetadata description.
  899. * @member {string} description
  900. * @memberof DistributionBucketFamilyMetadata
  901. * @instance
  902. */
  903. DistributionBucketFamilyMetadata.prototype.description = "";
  904. /**
  905. * DistributionBucketFamilyMetadata boundary.
  906. * @member {Array.<IGeoCoordiantes>} boundary
  907. * @memberof DistributionBucketFamilyMetadata
  908. * @instance
  909. */
  910. DistributionBucketFamilyMetadata.prototype.boundary = $util.emptyArray;
  911. /**
  912. * Creates a new DistributionBucketFamilyMetadata instance using the specified properties.
  913. * @function create
  914. * @memberof DistributionBucketFamilyMetadata
  915. * @static
  916. * @param {IDistributionBucketFamilyMetadata=} [properties] Properties to set
  917. * @returns {DistributionBucketFamilyMetadata} DistributionBucketFamilyMetadata instance
  918. */
  919. DistributionBucketFamilyMetadata.create = function create(properties) {
  920. return new DistributionBucketFamilyMetadata(properties);
  921. };
  922. /**
  923. * Encodes the specified DistributionBucketFamilyMetadata message. Does not implicitly {@link DistributionBucketFamilyMetadata.verify|verify} messages.
  924. * @function encode
  925. * @memberof DistributionBucketFamilyMetadata
  926. * @static
  927. * @param {IDistributionBucketFamilyMetadata} message DistributionBucketFamilyMetadata message or plain object to encode
  928. * @param {$protobuf.Writer} [writer] Writer to encode to
  929. * @returns {$protobuf.Writer} Writer
  930. */
  931. DistributionBucketFamilyMetadata.encode = function encode(message, writer) {
  932. if (!writer)
  933. writer = $Writer.create();
  934. if (message.region != null && Object.hasOwnProperty.call(message, "region"))
  935. writer.uint32(/* id 1, wireType 2 =*/10).string(message.region);
  936. if (message.description != null && Object.hasOwnProperty.call(message, "description"))
  937. writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
  938. if (message.boundary != null && message.boundary.length)
  939. for (var i = 0; i < message.boundary.length; ++i)
  940. $root.GeoCoordiantes.encode(message.boundary[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
  941. return writer;
  942. };
  943. /**
  944. * Encodes the specified DistributionBucketFamilyMetadata message, length delimited. Does not implicitly {@link DistributionBucketFamilyMetadata.verify|verify} messages.
  945. * @function encodeDelimited
  946. * @memberof DistributionBucketFamilyMetadata
  947. * @static
  948. * @param {IDistributionBucketFamilyMetadata} message DistributionBucketFamilyMetadata message or plain object to encode
  949. * @param {$protobuf.Writer} [writer] Writer to encode to
  950. * @returns {$protobuf.Writer} Writer
  951. */
  952. DistributionBucketFamilyMetadata.encodeDelimited = function encodeDelimited(message, writer) {
  953. return this.encode(message, writer).ldelim();
  954. };
  955. /**
  956. * Decodes a DistributionBucketFamilyMetadata message from the specified reader or buffer.
  957. * @function decode
  958. * @memberof DistributionBucketFamilyMetadata
  959. * @static
  960. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  961. * @param {number} [length] Message length if known beforehand
  962. * @returns {DistributionBucketFamilyMetadata} DistributionBucketFamilyMetadata
  963. * @throws {Error} If the payload is not a reader or valid buffer
  964. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  965. */
  966. DistributionBucketFamilyMetadata.decode = function decode(reader, length) {
  967. if (!(reader instanceof $Reader))
  968. reader = $Reader.create(reader);
  969. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.DistributionBucketFamilyMetadata();
  970. while (reader.pos < end) {
  971. var tag = reader.uint32();
  972. switch (tag >>> 3) {
  973. case 1:
  974. message.region = reader.string();
  975. break;
  976. case 2:
  977. message.description = reader.string();
  978. break;
  979. case 3:
  980. if (!(message.boundary && message.boundary.length))
  981. message.boundary = [];
  982. message.boundary.push($root.GeoCoordiantes.decode(reader, reader.uint32()));
  983. break;
  984. default:
  985. reader.skipType(tag & 7);
  986. break;
  987. }
  988. }
  989. return message;
  990. };
  991. /**
  992. * Decodes a DistributionBucketFamilyMetadata message from the specified reader or buffer, length delimited.
  993. * @function decodeDelimited
  994. * @memberof DistributionBucketFamilyMetadata
  995. * @static
  996. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  997. * @returns {DistributionBucketFamilyMetadata} DistributionBucketFamilyMetadata
  998. * @throws {Error} If the payload is not a reader or valid buffer
  999. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  1000. */
  1001. DistributionBucketFamilyMetadata.decodeDelimited = function decodeDelimited(reader) {
  1002. if (!(reader instanceof $Reader))
  1003. reader = new $Reader(reader);
  1004. return this.decode(reader, reader.uint32());
  1005. };
  1006. /**
  1007. * Verifies a DistributionBucketFamilyMetadata message.
  1008. * @function verify
  1009. * @memberof DistributionBucketFamilyMetadata
  1010. * @static
  1011. * @param {Object.<string,*>} message Plain object to verify
  1012. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  1013. */
  1014. DistributionBucketFamilyMetadata.verify = function verify(message) {
  1015. if (typeof message !== "object" || message === null)
  1016. return "object expected";
  1017. if (message.region != null && message.hasOwnProperty("region"))
  1018. if (!$util.isString(message.region))
  1019. return "region: string expected";
  1020. if (message.description != null && message.hasOwnProperty("description"))
  1021. if (!$util.isString(message.description))
  1022. return "description: string expected";
  1023. if (message.boundary != null && message.hasOwnProperty("boundary")) {
  1024. if (!Array.isArray(message.boundary))
  1025. return "boundary: array expected";
  1026. for (var i = 0; i < message.boundary.length; ++i) {
  1027. var error = $root.GeoCoordiantes.verify(message.boundary[i]);
  1028. if (error)
  1029. return "boundary." + error;
  1030. }
  1031. }
  1032. return null;
  1033. };
  1034. /**
  1035. * Creates a DistributionBucketFamilyMetadata message from a plain object. Also converts values to their respective internal types.
  1036. * @function fromObject
  1037. * @memberof DistributionBucketFamilyMetadata
  1038. * @static
  1039. * @param {Object.<string,*>} object Plain object
  1040. * @returns {DistributionBucketFamilyMetadata} DistributionBucketFamilyMetadata
  1041. */
  1042. DistributionBucketFamilyMetadata.fromObject = function fromObject(object) {
  1043. if (object instanceof $root.DistributionBucketFamilyMetadata)
  1044. return object;
  1045. var message = new $root.DistributionBucketFamilyMetadata();
  1046. if (object.region != null)
  1047. message.region = String(object.region);
  1048. if (object.description != null)
  1049. message.description = String(object.description);
  1050. if (object.boundary) {
  1051. if (!Array.isArray(object.boundary))
  1052. throw TypeError(".DistributionBucketFamilyMetadata.boundary: array expected");
  1053. message.boundary = [];
  1054. for (var i = 0; i < object.boundary.length; ++i) {
  1055. if (typeof object.boundary[i] !== "object")
  1056. throw TypeError(".DistributionBucketFamilyMetadata.boundary: object expected");
  1057. message.boundary[i] = $root.GeoCoordiantes.fromObject(object.boundary[i]);
  1058. }
  1059. }
  1060. return message;
  1061. };
  1062. /**
  1063. * Creates a plain object from a DistributionBucketFamilyMetadata message. Also converts values to other types if specified.
  1064. * @function toObject
  1065. * @memberof DistributionBucketFamilyMetadata
  1066. * @static
  1067. * @param {DistributionBucketFamilyMetadata} message DistributionBucketFamilyMetadata
  1068. * @param {$protobuf.IConversionOptions} [options] Conversion options
  1069. * @returns {Object.<string,*>} Plain object
  1070. */
  1071. DistributionBucketFamilyMetadata.toObject = function toObject(message, options) {
  1072. if (!options)
  1073. options = {};
  1074. var object = {};
  1075. if (options.arrays || options.defaults)
  1076. object.boundary = [];
  1077. if (options.defaults) {
  1078. object.region = "";
  1079. object.description = "";
  1080. }
  1081. if (message.region != null && message.hasOwnProperty("region"))
  1082. object.region = message.region;
  1083. if (message.description != null && message.hasOwnProperty("description"))
  1084. object.description = message.description;
  1085. if (message.boundary && message.boundary.length) {
  1086. object.boundary = [];
  1087. for (var j = 0; j < message.boundary.length; ++j)
  1088. object.boundary[j] = $root.GeoCoordiantes.toObject(message.boundary[j], options);
  1089. }
  1090. return object;
  1091. };
  1092. /**
  1093. * Converts this DistributionBucketFamilyMetadata to JSON.
  1094. * @function toJSON
  1095. * @memberof DistributionBucketFamilyMetadata
  1096. * @instance
  1097. * @returns {Object.<string,*>} JSON object
  1098. */
  1099. DistributionBucketFamilyMetadata.prototype.toJSON = function toJSON() {
  1100. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  1101. };
  1102. return DistributionBucketFamilyMetadata;
  1103. })();
  1104. module.exports = $root;