|
| 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 |
|
|
2647 | 2661 | * @property {Array.<string>|null} [pattern] ResourceDescriptor pattern
|
2648 | 2662 | * @property {string|null} [nameField] ResourceDescriptor nameField
|
2649 | 2663 | * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history
|
| 2664 | + * @property {string|null} [plural] ResourceDescriptor plural |
| 2665 | + * @property {string|null} [singular] ResourceDescriptor singular |
2650 | 2666 | */
|
2651 | 2667 |
|
2652 | 2668 | /**
|
|
2697 | 2713 | */
|
2698 | 2714 | ResourceDescriptor.prototype.history = 0;
|
2699 | 2715 |
|
| 2716 | + /** |
| 2717 | + * ResourceDescriptor plural. |
| 2718 | + * @member {string} plural |
| 2719 | + * @memberof google.api.ResourceDescriptor |
| 2720 | + * @instance |
| 2721 | + */ |
| 2722 | + ResourceDescriptor.prototype.plural = ""; |
| 2723 | + |
| 2724 | + /** |
| 2725 | + * ResourceDescriptor singular. |
| 2726 | + * @member {string} singular |
| 2727 | + * @memberof google.api.ResourceDescriptor |
| 2728 | + * @instance |
| 2729 | + */ |
| 2730 | + ResourceDescriptor.prototype.singular = ""; |
| 2731 | + |
2700 | 2732 | /**
|
2701 | 2733 | * Creates a new ResourceDescriptor instance using the specified properties.
|
2702 | 2734 | * @function create
|
|
2730 | 2762 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField);
|
2731 | 2763 | if (message.history != null && message.hasOwnProperty("history"))
|
2732 | 2764 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history);
|
| 2765 | + if (message.plural != null && message.hasOwnProperty("plural")) |
| 2766 | + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); |
| 2767 | + if (message.singular != null && message.hasOwnProperty("singular")) |
| 2768 | + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); |
2733 | 2769 | return writer;
|
2734 | 2770 | };
|
2735 | 2771 |
|
|
2778 | 2814 | case 4:
|
2779 | 2815 | message.history = reader.int32();
|
2780 | 2816 | break;
|
| 2817 | + case 5: |
| 2818 | + message.plural = reader.string(); |
| 2819 | + break; |
| 2820 | + case 6: |
| 2821 | + message.singular = reader.string(); |
| 2822 | + break; |
2781 | 2823 | default:
|
2782 | 2824 | reader.skipType(tag & 7);
|
2783 | 2825 | break;
|
|
2835 | 2877 | case 2:
|
2836 | 2878 | break;
|
2837 | 2879 | }
|
| 2880 | + if (message.plural != null && message.hasOwnProperty("plural")) |
| 2881 | + if (!$util.isString(message.plural)) |
| 2882 | + return "plural: string expected"; |
| 2883 | + if (message.singular != null && message.hasOwnProperty("singular")) |
| 2884 | + if (!$util.isString(message.singular)) |
| 2885 | + return "singular: string expected"; |
2838 | 2886 | return null;
|
2839 | 2887 | };
|
2840 | 2888 |
|
|
2875 | 2923 | message.history = 2;
|
2876 | 2924 | break;
|
2877 | 2925 | }
|
| 2926 | + if (object.plural != null) |
| 2927 | + message.plural = String(object.plural); |
| 2928 | + if (object.singular != null) |
| 2929 | + message.singular = String(object.singular); |
2878 | 2930 | return message;
|
2879 | 2931 | };
|
2880 | 2932 |
|
|
2897 | 2949 | object.type = "";
|
2898 | 2950 | object.nameField = "";
|
2899 | 2951 | object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0;
|
| 2952 | + object.plural = ""; |
| 2953 | + object.singular = ""; |
2900 | 2954 | }
|
2901 | 2955 | if (message.type != null && message.hasOwnProperty("type"))
|
2902 | 2956 | object.type = message.type;
|
|
2909 | 2963 | object.nameField = message.nameField;
|
2910 | 2964 | if (message.history != null && message.hasOwnProperty("history"))
|
2911 | 2965 | object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history;
|
| 2966 | + if (message.plural != null && message.hasOwnProperty("plural")) |
| 2967 | + object.plural = message.plural; |
| 2968 | + if (message.singular != null && message.hasOwnProperty("singular")) |
| 2969 | + object.singular = message.singular; |
2912 | 2970 | return object;
|
2913 | 2971 | };
|
2914 | 2972 |
|
|
7323 | 7381 | * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace
|
7324 | 7382 | * @property {string|null} [rubyPackage] FileOptions rubyPackage
|
7325 | 7383 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] FileOptions uninterpretedOption
|
| 7384 | + * @property {Array.<google.api.IResourceDescriptor>|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition |
7326 | 7385 | */
|
7327 | 7386 |
|
7328 | 7387 | /**
|
|
7335 | 7394 | */
|
7336 | 7395 | function FileOptions(properties) {
|
7337 | 7396 | this.uninterpretedOption = [];
|
| 7397 | + this[".google.api.resourceDefinition"] = []; |
7338 | 7398 | if (properties)
|
7339 | 7399 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
7340 | 7400 | if (properties[keys[i]] != null)
|
|
7509 | 7569 | */
|
7510 | 7570 | FileOptions.prototype.uninterpretedOption = $util.emptyArray;
|
7511 | 7571 |
|
| 7572 | + /** |
| 7573 | + * FileOptions .google.api.resourceDefinition. |
| 7574 | + * @member {Array.<google.api.IResourceDescriptor>} .google.api.resourceDefinition |
| 7575 | + * @memberof google.protobuf.FileOptions |
| 7576 | + * @instance |
| 7577 | + */ |
| 7578 | + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; |
| 7579 | + |
7512 | 7580 | /**
|
7513 | 7581 | * Creates a new FileOptions instance using the specified properties.
|
7514 | 7582 | * @function create
|
|
7576 | 7644 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
7577 | 7645 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
7578 | 7646 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
| 7647 | + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) |
| 7648 | + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) |
| 7649 | + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); |
7579 | 7650 | return writer;
|
7580 | 7651 | };
|
7581 | 7652 |
|
|
7675 | 7746 | message.uninterpretedOption = [];
|
7676 | 7747 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
7677 | 7748 | break;
|
| 7749 | + case 1053: |
| 7750 | + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) |
| 7751 | + message[".google.api.resourceDefinition"] = []; |
| 7752 | + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); |
| 7753 | + break; |
7678 | 7754 | default:
|
7679 | 7755 | reader.skipType(tag & 7);
|
7680 | 7756 | break;
|
|
7785 | 7861 | return "uninterpretedOption." + error;
|
7786 | 7862 | }
|
7787 | 7863 | }
|
| 7864 | + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { |
| 7865 | + if (!Array.isArray(message[".google.api.resourceDefinition"])) |
| 7866 | + return ".google.api.resourceDefinition: array expected"; |
| 7867 | + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { |
| 7868 | + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); |
| 7869 | + if (error) |
| 7870 | + return ".google.api.resourceDefinition." + error; |
| 7871 | + } |
| 7872 | + } |
7788 | 7873 | return null;
|
7789 | 7874 | };
|
7790 | 7875 |
|
|
7862 | 7947 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
7863 | 7948 | }
|
7864 | 7949 | }
|
| 7950 | + if (object[".google.api.resourceDefinition"]) { |
| 7951 | + if (!Array.isArray(object[".google.api.resourceDefinition"])) |
| 7952 | + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); |
| 7953 | + message[".google.api.resourceDefinition"] = []; |
| 7954 | + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { |
| 7955 | + if (typeof object[".google.api.resourceDefinition"][i] !== "object") |
| 7956 | + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); |
| 7957 | + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); |
| 7958 | + } |
| 7959 | + } |
7865 | 7960 | return message;
|
7866 | 7961 | };
|
7867 | 7962 |
|
|
7878 | 7973 | if (!options)
|
7879 | 7974 | options = {};
|
7880 | 7975 | var object = {};
|
7881 |
| - if (options.arrays || options.defaults) |
| 7976 | + if (options.arrays || options.defaults) { |
7882 | 7977 | object.uninterpretedOption = [];
|
| 7978 | + object[".google.api.resourceDefinition"] = []; |
| 7979 | + } |
7883 | 7980 | if (options.defaults) {
|
7884 | 7981 | object.javaPackage = "";
|
7885 | 7982 | object.javaOuterClassname = "";
|
|
7947 | 8044 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
7948 | 8045 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
7949 | 8046 | }
|
| 8047 | + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { |
| 8048 | + object[".google.api.resourceDefinition"] = []; |
| 8049 | + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) |
| 8050 | + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); |
| 8051 | + } |
7950 | 8052 | return object;
|
7951 | 8053 | };
|
7952 | 8054 |
|
|
0 commit comments