|
| 1 | +// Copyright 2019 Google LLC |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
1 | 15 | /*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 | 16 | (function(global, factory) { /* global define, require, module */
|
3 | 17 |
|
|
1444 | 1458 | * @property {Array.<string>|null} [pattern] ResourceDescriptor pattern
|
1445 | 1459 | * @property {string|null} [nameField] ResourceDescriptor nameField
|
1446 | 1460 | * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history
|
| 1461 | + * @property {string|null} [plural] ResourceDescriptor plural |
| 1462 | + * @property {string|null} [singular] ResourceDescriptor singular |
1447 | 1463 | */
|
1448 | 1464 |
|
1449 | 1465 | /**
|
|
1494 | 1510 | */
|
1495 | 1511 | ResourceDescriptor.prototype.history = 0;
|
1496 | 1512 |
|
| 1513 | + /** |
| 1514 | + * ResourceDescriptor plural. |
| 1515 | + * @member {string} plural |
| 1516 | + * @memberof google.api.ResourceDescriptor |
| 1517 | + * @instance |
| 1518 | + */ |
| 1519 | + ResourceDescriptor.prototype.plural = ""; |
| 1520 | + |
| 1521 | + /** |
| 1522 | + * ResourceDescriptor singular. |
| 1523 | + * @member {string} singular |
| 1524 | + * @memberof google.api.ResourceDescriptor |
| 1525 | + * @instance |
| 1526 | + */ |
| 1527 | + ResourceDescriptor.prototype.singular = ""; |
| 1528 | + |
1497 | 1529 | /**
|
1498 | 1530 | * Creates a new ResourceDescriptor instance using the specified properties.
|
1499 | 1531 | * @function create
|
|
1527 | 1559 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField);
|
1528 | 1560 | if (message.history != null && message.hasOwnProperty("history"))
|
1529 | 1561 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history);
|
| 1562 | + if (message.plural != null && message.hasOwnProperty("plural")) |
| 1563 | + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); |
| 1564 | + if (message.singular != null && message.hasOwnProperty("singular")) |
| 1565 | + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); |
1530 | 1566 | return writer;
|
1531 | 1567 | };
|
1532 | 1568 |
|
|
1575 | 1611 | case 4:
|
1576 | 1612 | message.history = reader.int32();
|
1577 | 1613 | break;
|
| 1614 | + case 5: |
| 1615 | + message.plural = reader.string(); |
| 1616 | + break; |
| 1617 | + case 6: |
| 1618 | + message.singular = reader.string(); |
| 1619 | + break; |
1578 | 1620 | default:
|
1579 | 1621 | reader.skipType(tag & 7);
|
1580 | 1622 | break;
|
|
1632 | 1674 | case 2:
|
1633 | 1675 | break;
|
1634 | 1676 | }
|
| 1677 | + if (message.plural != null && message.hasOwnProperty("plural")) |
| 1678 | + if (!$util.isString(message.plural)) |
| 1679 | + return "plural: string expected"; |
| 1680 | + if (message.singular != null && message.hasOwnProperty("singular")) |
| 1681 | + if (!$util.isString(message.singular)) |
| 1682 | + return "singular: string expected"; |
1635 | 1683 | return null;
|
1636 | 1684 | };
|
1637 | 1685 |
|
|
1672 | 1720 | message.history = 2;
|
1673 | 1721 | break;
|
1674 | 1722 | }
|
| 1723 | + if (object.plural != null) |
| 1724 | + message.plural = String(object.plural); |
| 1725 | + if (object.singular != null) |
| 1726 | + message.singular = String(object.singular); |
1675 | 1727 | return message;
|
1676 | 1728 | };
|
1677 | 1729 |
|
|
1694 | 1746 | object.type = "";
|
1695 | 1747 | object.nameField = "";
|
1696 | 1748 | object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0;
|
| 1749 | + object.plural = ""; |
| 1750 | + object.singular = ""; |
1697 | 1751 | }
|
1698 | 1752 | if (message.type != null && message.hasOwnProperty("type"))
|
1699 | 1753 | object.type = message.type;
|
|
1706 | 1760 | object.nameField = message.nameField;
|
1707 | 1761 | if (message.history != null && message.hasOwnProperty("history"))
|
1708 | 1762 | object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history;
|
| 1763 | + if (message.plural != null && message.hasOwnProperty("plural")) |
| 1764 | + object.plural = message.plural; |
| 1765 | + if (message.singular != null && message.hasOwnProperty("singular")) |
| 1766 | + object.singular = message.singular; |
1709 | 1767 | return object;
|
1710 | 1768 | };
|
1711 | 1769 |
|
|
6120 | 6178 | * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace
|
6121 | 6179 | * @property {string|null} [rubyPackage] FileOptions rubyPackage
|
6122 | 6180 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] FileOptions uninterpretedOption
|
| 6181 | + * @property {Array.<google.api.IResourceDescriptor>|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition |
6123 | 6182 | */
|
6124 | 6183 |
|
6125 | 6184 | /**
|
|
6132 | 6191 | */
|
6133 | 6192 | function FileOptions(properties) {
|
6134 | 6193 | this.uninterpretedOption = [];
|
| 6194 | + this[".google.api.resourceDefinition"] = []; |
6135 | 6195 | if (properties)
|
6136 | 6196 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
6137 | 6197 | if (properties[keys[i]] != null)
|
|
6306 | 6366 | */
|
6307 | 6367 | FileOptions.prototype.uninterpretedOption = $util.emptyArray;
|
6308 | 6368 |
|
| 6369 | + /** |
| 6370 | + * FileOptions .google.api.resourceDefinition. |
| 6371 | + * @member {Array.<google.api.IResourceDescriptor>} .google.api.resourceDefinition |
| 6372 | + * @memberof google.protobuf.FileOptions |
| 6373 | + * @instance |
| 6374 | + */ |
| 6375 | + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; |
| 6376 | + |
6309 | 6377 | /**
|
6310 | 6378 | * Creates a new FileOptions instance using the specified properties.
|
6311 | 6379 | * @function create
|
|
6373 | 6441 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
6374 | 6442 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
6375 | 6443 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
| 6444 | + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) |
| 6445 | + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) |
| 6446 | + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); |
6376 | 6447 | return writer;
|
6377 | 6448 | };
|
6378 | 6449 |
|
|
6472 | 6543 | message.uninterpretedOption = [];
|
6473 | 6544 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
6474 | 6545 | break;
|
| 6546 | + case 1053: |
| 6547 | + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) |
| 6548 | + message[".google.api.resourceDefinition"] = []; |
| 6549 | + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); |
| 6550 | + break; |
6475 | 6551 | default:
|
6476 | 6552 | reader.skipType(tag & 7);
|
6477 | 6553 | break;
|
|
6582 | 6658 | return "uninterpretedOption." + error;
|
6583 | 6659 | }
|
6584 | 6660 | }
|
| 6661 | + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { |
| 6662 | + if (!Array.isArray(message[".google.api.resourceDefinition"])) |
| 6663 | + return ".google.api.resourceDefinition: array expected"; |
| 6664 | + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { |
| 6665 | + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); |
| 6666 | + if (error) |
| 6667 | + return ".google.api.resourceDefinition." + error; |
| 6668 | + } |
| 6669 | + } |
6585 | 6670 | return null;
|
6586 | 6671 | };
|
6587 | 6672 |
|
|
6659 | 6744 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
6660 | 6745 | }
|
6661 | 6746 | }
|
| 6747 | + if (object[".google.api.resourceDefinition"]) { |
| 6748 | + if (!Array.isArray(object[".google.api.resourceDefinition"])) |
| 6749 | + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); |
| 6750 | + message[".google.api.resourceDefinition"] = []; |
| 6751 | + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { |
| 6752 | + if (typeof object[".google.api.resourceDefinition"][i] !== "object") |
| 6753 | + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); |
| 6754 | + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); |
| 6755 | + } |
| 6756 | + } |
6662 | 6757 | return message;
|
6663 | 6758 | };
|
6664 | 6759 |
|
|
6675 | 6770 | if (!options)
|
6676 | 6771 | options = {};
|
6677 | 6772 | var object = {};
|
6678 |
| - if (options.arrays || options.defaults) |
| 6773 | + if (options.arrays || options.defaults) { |
6679 | 6774 | object.uninterpretedOption = [];
|
| 6775 | + object[".google.api.resourceDefinition"] = []; |
| 6776 | + } |
6680 | 6777 | if (options.defaults) {
|
6681 | 6778 | object.javaPackage = "";
|
6682 | 6779 | object.javaOuterClassname = "";
|
|
6744 | 6841 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
6745 | 6842 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
6746 | 6843 | }
|
| 6844 | + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { |
| 6845 | + object[".google.api.resourceDefinition"] = []; |
| 6846 | + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) |
| 6847 | + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); |
| 6848 | + } |
6747 | 6849 | return object;
|
6748 | 6850 | };
|
6749 | 6851 |
|
|
0 commit comments