Source: proto/spine/core/tenant_id_pb.js

  1. // source: spine/core/tenant_id.proto
  2. /**
  3. * @fileoverview
  4. * @enhanceable
  5. * @suppress {messageConventions} JS Compiler reports an error if a variable or
  6. * field starts with 'MSG_' and isn't a translatable message.
  7. * @public
  8. */
  9. // GENERATED CODE -- DO NOT EDIT!
  10. var jspb = require('google-protobuf');
  11. var goog = jspb;
  12. var global = Function('return this')();
  13. var spine_options_pb = require('../../spine/options_pb.js');
  14. goog.object.extend(proto, spine_options_pb);
  15. var spine_net_internet_domain_pb = require('../../spine/net/internet_domain_pb.js');
  16. goog.object.extend(proto, spine_net_internet_domain_pb);
  17. var spine_net_email_address_pb = require('../../spine/net/email_address_pb.js');
  18. goog.object.extend(proto, spine_net_email_address_pb);
  19. goog.exportSymbol('proto.spine.core.TenantId', null, global);
  20. goog.exportSymbol('proto.spine.core.TenantId.KindCase', null, global);
  21. /**
  22. * Generated by JsPbCodeGenerator.
  23. * @param {Array=} opt_data Optional initial data array, typically from a
  24. * server response, or constructed directly in Javascript. The array is used
  25. * in place and becomes part of the constructed object. It is not cloned.
  26. * If no data is provided, the constructed object will be empty, but still
  27. * valid.
  28. * @extends {jspb.Message}
  29. * @constructor
  30. */
  31. proto.spine.core.TenantId = function(opt_data) {
  32. jspb.Message.initialize(this, opt_data, 0, -1, null, proto.spine.core.TenantId.oneofGroups_);
  33. };
  34. goog.inherits(proto.spine.core.TenantId, jspb.Message);
  35. if (goog.DEBUG && !COMPILED) {
  36. /**
  37. * @public
  38. * @override
  39. */
  40. proto.spine.core.TenantId.displayName = 'proto.spine.core.TenantId';
  41. }
  42. /**
  43. * Oneof group definitions for this message. Each group defines the field
  44. * numbers belonging to that group. When of these fields' value is set, all
  45. * other fields in the group are cleared. During deserialization, if multiple
  46. * fields are encountered for a group, only the last value seen will be kept.
  47. * @private {!Array<!Array<number>>}
  48. * @const
  49. */
  50. proto.spine.core.TenantId.oneofGroups_ = [[1,2,20]];
  51. /**
  52. * @enum {number}
  53. */
  54. proto.spine.core.TenantId.KindCase = {
  55. KIND_NOT_SET: 0,
  56. DOMAIN: 1,
  57. EMAIL: 2,
  58. VALUE: 20
  59. };
  60. /**
  61. * @return {proto.spine.core.TenantId.KindCase}
  62. */
  63. proto.spine.core.TenantId.prototype.getKindCase = function() {
  64. return /** @type {proto.spine.core.TenantId.KindCase} */(jspb.Message.computeOneofCase(this, proto.spine.core.TenantId.oneofGroups_[0]));
  65. };
  66. if (jspb.Message.GENERATE_TO_OBJECT) {
  67. /**
  68. * Creates an object representation of this proto.
  69. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  70. * Optional fields that are not set will be set to undefined.
  71. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  72. * For the list of reserved names please see:
  73. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  74. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  75. * JSPB instance for transitional soy proto support:
  76. * http://goto/soy-param-migration
  77. * @return {!Object}
  78. */
  79. proto.spine.core.TenantId.prototype.toObject = function(opt_includeInstance) {
  80. return proto.spine.core.TenantId.toObject(opt_includeInstance, this);
  81. };
  82. /**
  83. * Static version of the {@see toObject} method.
  84. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  85. * the JSPB instance for transitional soy proto support:
  86. * http://goto/soy-param-migration
  87. * @param {!proto.spine.core.TenantId} msg The msg instance to transform.
  88. * @return {!Object}
  89. * @suppress {unusedLocalVariables} f is only used for nested messages
  90. */
  91. proto.spine.core.TenantId.toObject = function(includeInstance, msg) {
  92. var f, obj = {
  93. domain: (f = msg.getDomain()) && spine_net_internet_domain_pb.InternetDomain.toObject(includeInstance, f),
  94. email: (f = msg.getEmail()) && spine_net_email_address_pb.EmailAddress.toObject(includeInstance, f),
  95. value: jspb.Message.getFieldWithDefault(msg, 20, "")
  96. };
  97. if (includeInstance) {
  98. obj.$jspbMessageInstance = msg;
  99. }
  100. return obj;
  101. };
  102. }
  103. /**
  104. * Deserializes binary data (in protobuf wire format).
  105. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  106. * @return {!proto.spine.core.TenantId}
  107. */
  108. proto.spine.core.TenantId.deserializeBinary = function(bytes) {
  109. var reader = new jspb.BinaryReader(bytes);
  110. var msg = new proto.spine.core.TenantId;
  111. return proto.spine.core.TenantId.deserializeBinaryFromReader(msg, reader);
  112. };
  113. /**
  114. * Deserializes binary data (in protobuf wire format) from the
  115. * given reader into the given message object.
  116. * @param {!proto.spine.core.TenantId} msg The message object to deserialize into.
  117. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  118. * @return {!proto.spine.core.TenantId}
  119. */
  120. proto.spine.core.TenantId.deserializeBinaryFromReader = function(msg, reader) {
  121. while (reader.nextField()) {
  122. if (reader.isEndGroup()) {
  123. break;
  124. }
  125. var field = reader.getFieldNumber();
  126. switch (field) {
  127. case 1:
  128. var value = new spine_net_internet_domain_pb.InternetDomain;
  129. reader.readMessage(value,spine_net_internet_domain_pb.InternetDomain.deserializeBinaryFromReader);
  130. msg.setDomain(value);
  131. break;
  132. case 2:
  133. var value = new spine_net_email_address_pb.EmailAddress;
  134. reader.readMessage(value,spine_net_email_address_pb.EmailAddress.deserializeBinaryFromReader);
  135. msg.setEmail(value);
  136. break;
  137. case 20:
  138. var value = /** @type {string} */ (reader.readString());
  139. msg.setValue(value);
  140. break;
  141. default:
  142. reader.skipField();
  143. break;
  144. }
  145. }
  146. return msg;
  147. };
  148. /**
  149. * Serializes the message to binary data (in protobuf wire format).
  150. * @return {!Uint8Array}
  151. */
  152. proto.spine.core.TenantId.prototype.serializeBinary = function() {
  153. var writer = new jspb.BinaryWriter();
  154. proto.spine.core.TenantId.serializeBinaryToWriter(this, writer);
  155. return writer.getResultBuffer();
  156. };
  157. /**
  158. * Serializes the given message to binary data (in protobuf wire
  159. * format), writing to the given BinaryWriter.
  160. * @param {!proto.spine.core.TenantId} message
  161. * @param {!jspb.BinaryWriter} writer
  162. * @suppress {unusedLocalVariables} f is only used for nested messages
  163. */
  164. proto.spine.core.TenantId.serializeBinaryToWriter = function(message, writer) {
  165. var f = undefined;
  166. f = message.getDomain();
  167. if (f != null) {
  168. writer.writeMessage(
  169. 1,
  170. f,
  171. spine_net_internet_domain_pb.InternetDomain.serializeBinaryToWriter
  172. );
  173. }
  174. f = message.getEmail();
  175. if (f != null) {
  176. writer.writeMessage(
  177. 2,
  178. f,
  179. spine_net_email_address_pb.EmailAddress.serializeBinaryToWriter
  180. );
  181. }
  182. f = /** @type {string} */ (jspb.Message.getField(message, 20));
  183. if (f != null) {
  184. writer.writeString(
  185. 20,
  186. f
  187. );
  188. }
  189. };
  190. /**
  191. * optional spine.net.InternetDomain domain = 1;
  192. * @return {?proto.spine.net.InternetDomain}
  193. */
  194. proto.spine.core.TenantId.prototype.getDomain = function() {
  195. return /** @type{?proto.spine.net.InternetDomain} */ (
  196. jspb.Message.getWrapperField(this, spine_net_internet_domain_pb.InternetDomain, 1));
  197. };
  198. /**
  199. * @param {?proto.spine.net.InternetDomain|undefined} value
  200. * @return {!proto.spine.core.TenantId} returns this
  201. */
  202. proto.spine.core.TenantId.prototype.setDomain = function(value) {
  203. return jspb.Message.setOneofWrapperField(this, 1, proto.spine.core.TenantId.oneofGroups_[0], value);
  204. };
  205. /**
  206. * Clears the message field making it undefined.
  207. * @return {!proto.spine.core.TenantId} returns this
  208. */
  209. proto.spine.core.TenantId.prototype.clearDomain = function() {
  210. return this.setDomain(undefined);
  211. };
  212. /**
  213. * Returns whether this field is set.
  214. * @return {boolean}
  215. */
  216. proto.spine.core.TenantId.prototype.hasDomain = function() {
  217. return jspb.Message.getField(this, 1) != null;
  218. };
  219. /**
  220. * optional spine.net.EmailAddress email = 2;
  221. * @return {?proto.spine.net.EmailAddress}
  222. */
  223. proto.spine.core.TenantId.prototype.getEmail = function() {
  224. return /** @type{?proto.spine.net.EmailAddress} */ (
  225. jspb.Message.getWrapperField(this, spine_net_email_address_pb.EmailAddress, 2));
  226. };
  227. /**
  228. * @param {?proto.spine.net.EmailAddress|undefined} value
  229. * @return {!proto.spine.core.TenantId} returns this
  230. */
  231. proto.spine.core.TenantId.prototype.setEmail = function(value) {
  232. return jspb.Message.setOneofWrapperField(this, 2, proto.spine.core.TenantId.oneofGroups_[0], value);
  233. };
  234. /**
  235. * Clears the message field making it undefined.
  236. * @return {!proto.spine.core.TenantId} returns this
  237. */
  238. proto.spine.core.TenantId.prototype.clearEmail = function() {
  239. return this.setEmail(undefined);
  240. };
  241. /**
  242. * Returns whether this field is set.
  243. * @return {boolean}
  244. */
  245. proto.spine.core.TenantId.prototype.hasEmail = function() {
  246. return jspb.Message.getField(this, 2) != null;
  247. };
  248. /**
  249. * optional string value = 20;
  250. * @return {string}
  251. */
  252. proto.spine.core.TenantId.prototype.getValue = function() {
  253. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 20, ""));
  254. };
  255. /**
  256. * @param {string} value
  257. * @return {!proto.spine.core.TenantId} returns this
  258. */
  259. proto.spine.core.TenantId.prototype.setValue = function(value) {
  260. return jspb.Message.setOneofField(this, 20, proto.spine.core.TenantId.oneofGroups_[0], value);
  261. };
  262. /**
  263. * Clears the field making it undefined.
  264. * @return {!proto.spine.core.TenantId} returns this
  265. */
  266. proto.spine.core.TenantId.prototype.clearValue = function() {
  267. return jspb.Message.setOneofField(this, 20, proto.spine.core.TenantId.oneofGroups_[0], undefined);
  268. };
  269. /**
  270. * Returns whether this field is set.
  271. * @return {boolean}
  272. */
  273. proto.spine.core.TenantId.prototype.hasValue = function() {
  274. return jspb.Message.getField(this, 20) != null;
  275. };
  276. goog.object.extend(exports, proto.spine.core);
  277. // Generated by Spine ProtoJs Plugin
  278. let ObjectParser = require('../../../client/parser/object-parser.js').default;
  279. let TypeParsers = require('../../../client/parser/type-parsers.js').default;
  280. proto.spine.core.TenantId.Parser = function() {
  281. ObjectParser.call(this);
  282. };
  283. proto.spine.core.TenantId.Parser.prototype = Object.create(ObjectParser.prototype);
  284. proto.spine.core.TenantId.Parser.prototype.constructor = proto.spine.core.TenantId.Parser;
  285. proto.spine.core.TenantId.Parser.prototype.fromObject = function(obj) {
  286. if (obj === null) {
  287. return null;
  288. }
  289. let msg = new proto.spine.core.TenantId();
  290. if (obj.domain !== undefined) {
  291. if (obj.domain === null) {
  292. msg.setDomain(null);
  293. } else {
  294. let value = TypeParsers.parserFor('type.spine.io/spine.net.InternetDomain').fromObject(obj.domain);
  295. msg.setDomain(value);
  296. }
  297. }
  298. if (obj.email !== undefined) {
  299. if (obj.email === null) {
  300. msg.setEmail(null);
  301. } else {
  302. let value = TypeParsers.parserFor('type.spine.io/spine.net.EmailAddress').fromObject(obj.email);
  303. msg.setEmail(value);
  304. }
  305. }
  306. if (obj.value !== undefined) {
  307. if (obj.value !== null) {
  308. let value = obj.value;
  309. msg.setValue(value);
  310. }
  311. }
  312. return msg;
  313. };
  314. // Generated by Spine ProtoJs Plugin
  315. proto.spine.core.TenantId.typeUrl = function() {
  316. return 'type.spine.io/spine.core.TenantId';
  317. };