diff --git a/README.md b/README.md index 488296e..9654c3e 100644 --- a/README.md +++ b/README.md @@ -25,5 +25,15 @@ npm run test npm run lint ``` +### Generate gRPC clients + +#### Install protobuf and grpc-web plugin +https://github.com/grpc/grpc-web#code-generator-plugin + +#### Generate +``` +npm run protoc +``` + ### Customize configuration See [Configuration Reference](https://cli.vuejs.org/config/). diff --git a/package-lock.json b/package-lock.json index fc0f094..8948d66 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5036,14 +5036,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5063,8 +5061,7 @@ "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", @@ -5212,7 +5209,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5635,6 +5631,11 @@ "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", "dev": true }, + "grpc-web": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/grpc-web/-/grpc-web-1.0.3.tgz", + "integrity": "sha512-C1mk+55YgPAmU4OK36Fm+nZoo62KTmjSF4/aUHT/yfpKFKTR6r/O8aavyRWaXUT83EcsoZoQaWYWY/2hrOSRJg==" + }, "gzip-size": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.0.0.tgz", diff --git a/package.json b/package.json index 8d70b2d..46336ff 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,11 @@ "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", - "lint": "vue-cli-service lint" + "lint": "vue-cli-service lint", + "protoc": "scripts/protoc.sh" }, "dependencies": { + "grpc-web": "^1.0.3", "vue": "^2.5.21", "vue-router": "^3.0.1", "vuex": "^3.0.1" @@ -46,4 +48,4 @@ "last 2 versions", "not ie <= 8" ] -} +} \ No newline at end of file diff --git a/protos/.keep b/protos/.keep new file mode 100644 index 0000000..e69de29 diff --git a/protos/google/api/annotations.proto b/protos/google/api/annotations.proto new file mode 100644 index 0000000..85c361b --- /dev/null +++ b/protos/google/api/annotations.proto @@ -0,0 +1,31 @@ +// Copyright (c) 2015, Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/api/http.proto"; +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.MethodOptions { + // See `HttpRule`. + HttpRule http = 72295728; +} diff --git a/protos/google/api/http.proto b/protos/google/api/http.proto new file mode 100644 index 0000000..2bd3a19 --- /dev/null +++ b/protos/google/api/http.proto @@ -0,0 +1,318 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "HttpProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// Defines the HTTP configuration for an API service. It contains a list of +// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method +// to one or more HTTP REST API methods. +message Http { + // A list of HTTP configuration rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated HttpRule rules = 1; + + // When set to true, URL path parmeters will be fully URI-decoded except in + // cases of single segment matches in reserved expansion, where "%2F" will be + // left encoded. + // + // The default behavior is to not decode RFC 6570 reserved characters in multi + // segment matches. + bool fully_decode_reserved_expansion = 2; +} + +// `HttpRule` defines the mapping of an RPC method to one or more HTTP +// REST API methods. The mapping specifies how different portions of the RPC +// request message are mapped to URL path, URL query parameters, and +// HTTP request body. The mapping is typically specified as an +// `google.api.http` annotation on the RPC method, +// see "google/api/annotations.proto" for details. +// +// The mapping consists of a field specifying the path template and +// method kind. The path template can refer to fields in the request +// message, as in the example below which describes a REST GET +// operation on a resource collection of messages: +// +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // mapped to the URL +// SubMessage sub = 2; // `sub.subfield` is url-mapped +// } +// message Message { +// string text = 1; // content of the resource +// } +// +// The same http annotation can alternatively be expressed inside the +// `GRPC API Configuration` YAML file. +// +// http: +// rules: +// - selector: .Messaging.GetMessage +// get: /v1/messages/{message_id}/{sub.subfield} +// +// This definition enables an automatic, bidrectional mapping of HTTP +// JSON to RPC. Example: +// +// HTTP | RPC +// -----|----- +// `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))` +// +// In general, not only fields but also field paths can be referenced +// from a path pattern. Fields mapped to the path pattern cannot be +// repeated and must have a primitive (non-message) type. +// +// Any fields in the request message which are not bound by the path +// pattern automatically become (optional) HTTP query +// parameters. Assume the following definition of the request message: +// +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http).get = "/v1/messages/{message_id}"; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // mapped to the URL +// int64 revision = 2; // becomes a parameter +// SubMessage sub = 3; // `sub.subfield` becomes a parameter +// } +// +// +// This enables a HTTP JSON to RPC mapping as below: +// +// HTTP | RPC +// -----|----- +// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))` +// +// Note that fields which are mapped to HTTP parameters must have a +// primitive type or a repeated primitive type. Message types are not +// allowed. In the case of a repeated type, the parameter can be +// repeated in the URL, as in `...?param=A¶m=B`. +// +// For HTTP method kinds which allow a request body, the `body` field +// specifies the mapping. Consider a REST update method on the +// message resource collection: +// +// +// service Messaging { +// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +// option (google.api.http) = { +// put: "/v1/messages/{message_id}" +// body: "message" +// }; +// } +// } +// message UpdateMessageRequest { +// string message_id = 1; // mapped to the URL +// Message message = 2; // mapped to the body +// } +// +// +// The following HTTP JSON to RPC mapping is enabled, where the +// representation of the JSON in the request body is determined by +// protos JSON encoding: +// +// HTTP | RPC +// -----|----- +// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })` +// +// The special name `*` can be used in the body mapping to define that +// every field not bound by the path template should be mapped to the +// request body. This enables the following alternative definition of +// the update method: +// +// service Messaging { +// rpc UpdateMessage(Message) returns (Message) { +// option (google.api.http) = { +// put: "/v1/messages/{message_id}" +// body: "*" +// }; +// } +// } +// message Message { +// string message_id = 1; +// string text = 2; +// } +// +// +// The following HTTP JSON to RPC mapping is enabled: +// +// HTTP | RPC +// -----|----- +// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")` +// +// Note that when using `*` in the body mapping, it is not possible to +// have HTTP parameters, as all fields not bound by the path end in +// the body. This makes this option more rarely used in practice of +// defining REST APIs. The common usage of `*` is in custom methods +// which don't use the URL at all for transferring data. +// +// It is possible to define multiple HTTP methods for one RPC by using +// the `additional_bindings` option. Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/messages/{message_id}" +// additional_bindings { +// get: "/v1/users/{user_id}/messages/{message_id}" +// } +// }; +// } +// } +// message GetMessageRequest { +// string message_id = 1; +// string user_id = 2; +// } +// +// +// This enables the following two alternative HTTP JSON to RPC +// mappings: +// +// HTTP | RPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")` +// +// # Rules for HTTP mapping +// +// The rules for mapping HTTP path, query parameters, and body fields +// to the request message are as follows: +// +// 1. The `body` field specifies either `*` or a field path, or is +// omitted. If omitted, it indicates there is no HTTP request body. +// 2. Leaf fields (recursive expansion of nested messages in the +// request) can be classified into three types: +// (a) Matched in the URL template. +// (b) Covered by body (if body is `*`, everything except (a) fields; +// else everything under the body field) +// (c) All other fields. +// 3. URL query parameters found in the HTTP request are mapped to (c) fields. +// 4. Any body sent with an HTTP request can contain only (b) fields. +// +// The syntax of the path template is as follows: +// +// Template = "/" Segments [ Verb ] ; +// Segments = Segment { "/" Segment } ; +// Segment = "*" | "**" | LITERAL | Variable ; +// Variable = "{" FieldPath [ "=" Segments ] "}" ; +// FieldPath = IDENT { "." IDENT } ; +// Verb = ":" LITERAL ; +// +// The syntax `*` matches a single path segment. The syntax `**` matches zero +// or more path segments, which must be the last part of the path except the +// `Verb`. The syntax `LITERAL` matches literal text in the path. +// +// The syntax `Variable` matches part of the URL path as specified by its +// template. A variable template must not contain other variables. If a variable +// matches a single path segment, its template may be omitted, e.g. `{var}` +// is equivalent to `{var=*}`. +// +// If a variable contains exactly one path segment, such as `"{var}"` or +// `"{var=*}"`, when such a variable is expanded into a URL path, all characters +// except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the +// Discovery Document as `{var}`. +// +// If a variable contains one or more path segments, such as `"{var=foo/*}"` +// or `"{var=**}"`, when such a variable is expanded into a URL path, all +// characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables +// show up in the Discovery Document as `{+var}`. +// +// NOTE: While the single segment variable matches the semantics of +// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 +// Simple String Expansion, the multi segment variable **does not** match +// RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion +// does not expand special characters like `?` and `#`, which would lead +// to invalid URLs. +// +// NOTE: the field paths in variables and in the `body` must not refer to +// repeated fields or map fields. +message HttpRule { + // Selects methods to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + string selector = 1; + + // Determines the URL pattern is matched by this rules. This pattern can be + // used with any of the {get|put|post|delete|patch} methods. A custom method + // can be defined using the 'custom' field. + oneof pattern { + // Used for listing and getting information about resources. + string get = 2; + + // Used for updating a resource. + string put = 3; + + // Used for creating a resource. + string post = 4; + + // Used for deleting a resource. + string delete = 5; + + // Used for updating a resource. + string patch = 6; + + // The custom pattern is used for specifying an HTTP method that is not + // included in the `pattern` field, such as HEAD, or "*" to leave the + // HTTP method unspecified for this rule. The wild-card rule is useful + // for services that provide content to Web (HTML) clients. + CustomHttpPattern custom = 8; + } + + // The name of the request field whose value is mapped to the HTTP body, or + // `*` for mapping all fields not captured by the path pattern to the HTTP + // body. NOTE: the referred field must not be a repeated field and must be + // present at the top-level of request message type. + string body = 7; + + // Optional. The name of the response field whose value is mapped to the HTTP + // body of response. Other response fields are ignored. When + // not set, the response message will be used as HTTP body of response. + string response_body = 12; + + // Additional HTTP bindings for the selector. Nested bindings must + // not contain an `additional_bindings` field themselves (that is, + // the nesting may only be one level deep). + repeated HttpRule additional_bindings = 11; +} + +// A custom pattern is used for defining custom HTTP verb. +message CustomHttpPattern { + // The name of this custom HTTP verb. + string kind = 1; + + // The path matched by this custom verb. + string path = 2; +} diff --git a/protos/google/protobuf/descriptor.proto b/protos/google/protobuf/descriptor.proto new file mode 100644 index 0000000..ed08fcb --- /dev/null +++ b/protos/google/protobuf/descriptor.proto @@ -0,0 +1,883 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// The messages in this file describe the definitions found in .proto files. +// A valid .proto file can be translated directly to a FileDescriptorProto +// without any other information (e.g. without reading its imports). + + +syntax = "proto2"; + +package google.protobuf; +option go_package = "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DescriptorProtos"; +option csharp_namespace = "Google.Protobuf.Reflection"; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// descriptor.proto must be optimized for speed because reflection-based +// algorithms don't work during bootstrapping. +option optimize_for = SPEED; + +// The protocol compiler can output a FileDescriptorSet containing the .proto +// files it parses. +message FileDescriptorSet { + repeated FileDescriptorProto file = 1; +} + +// Describes a complete .proto file. +message FileDescriptorProto { + optional string name = 1; // file name, relative to root of source tree + optional string package = 2; // e.g. "foo", "foo.bar", etc. + + // Names of files imported by this file. + repeated string dependency = 3; + // Indexes of the public imported files in the dependency list above. + repeated int32 public_dependency = 10; + // Indexes of the weak imported files in the dependency list. + // For Google-internal migration only. Do not use. + repeated int32 weak_dependency = 11; + + // All top-level definitions in this file. + repeated DescriptorProto message_type = 4; + repeated EnumDescriptorProto enum_type = 5; + repeated ServiceDescriptorProto service = 6; + repeated FieldDescriptorProto extension = 7; + + optional FileOptions options = 8; + + // This field contains optional information about the original source code. + // You may safely remove this entire field without harming runtime + // functionality of the descriptors -- the information is needed only by + // development tools. + optional SourceCodeInfo source_code_info = 9; + + // The syntax of the proto file. + // The supported values are "proto2" and "proto3". + optional string syntax = 12; +} + +// Describes a message type. +message DescriptorProto { + optional string name = 1; + + repeated FieldDescriptorProto field = 2; + repeated FieldDescriptorProto extension = 6; + + repeated DescriptorProto nested_type = 3; + repeated EnumDescriptorProto enum_type = 4; + + message ExtensionRange { + optional int32 start = 1; + optional int32 end = 2; + + optional ExtensionRangeOptions options = 3; + } + repeated ExtensionRange extension_range = 5; + + repeated OneofDescriptorProto oneof_decl = 8; + + optional MessageOptions options = 7; + + // Range of reserved tag numbers. Reserved tag numbers may not be used by + // fields or extension ranges in the same message. Reserved ranges may + // not overlap. + message ReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + } + repeated ReservedRange reserved_range = 9; + // Reserved field names, which may not be used by fields in the same message. + // A given name may only be reserved once. + repeated string reserved_name = 10; +} + +message ExtensionRangeOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// Describes a field within a message. +message FieldDescriptorProto { + enum Type { + // 0 is reserved for errors. + // Order is weird for historical reasons. + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + // negative values are likely. + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + // negative values are likely. + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + // Tag-delimited aggregate. + // Group type is deprecated and not supported in proto3. However, Proto3 + // implementations should still be able to parse the group wire format and + // treat group fields as unknown fields. + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; // Length-delimited aggregate. + + // New in version 2. + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; // Uses ZigZag encoding. + TYPE_SINT64 = 18; // Uses ZigZag encoding. + }; + + enum Label { + // 0 is reserved for errors + LABEL_OPTIONAL = 1; + LABEL_REQUIRED = 2; + LABEL_REPEATED = 3; + }; + + optional string name = 1; + optional int32 number = 3; + optional Label label = 4; + + // If type_name is set, this need not be set. If both this and type_name + // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + optional Type type = 5; + + // For message and enum types, this is the name of the type. If the name + // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + // rules are used to find the type (i.e. first the nested types within this + // message are searched, then within the parent, on up to the root + // namespace). + optional string type_name = 6; + + // For extensions, this is the name of the type being extended. It is + // resolved in the same manner as type_name. + optional string extendee = 2; + + // For numeric types, contains the original text representation of the value. + // For booleans, "true" or "false". + // For strings, contains the default text contents (not escaped in any way). + // For bytes, contains the C escaped value. All bytes >= 128 are escaped. + // TODO(kenton): Base-64 encode? + optional string default_value = 7; + + // If set, gives the index of a oneof in the containing type's oneof_decl + // list. This field is a member of that oneof. + optional int32 oneof_index = 9; + + // JSON name of this field. The value is set by protocol compiler. If the + // user has set a "json_name" option on this field, that option's value + // will be used. Otherwise, it's deduced from the field's name by converting + // it to camelCase. + optional string json_name = 10; + + optional FieldOptions options = 8; +} + +// Describes a oneof. +message OneofDescriptorProto { + optional string name = 1; + optional OneofOptions options = 2; +} + +// Describes an enum type. +message EnumDescriptorProto { + optional string name = 1; + + repeated EnumValueDescriptorProto value = 2; + + optional EnumOptions options = 3; + + // Range of reserved numeric values. Reserved values may not be used by + // entries in the same enum. Reserved ranges may not overlap. + // + // Note that this is distinct from DescriptorProto.ReservedRange in that it + // is inclusive such that it can appropriately represent the entire int32 + // domain. + message EnumReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Inclusive. + } + + // Range of reserved numeric values. Reserved numeric values may not be used + // by enum values in the same enum declaration. Reserved ranges may not + // overlap. + repeated EnumReservedRange reserved_range = 4; + + // Reserved enum value names, which may not be reused. A given name may only + // be reserved once. + repeated string reserved_name = 5; +} + +// Describes a value within an enum. +message EnumValueDescriptorProto { + optional string name = 1; + optional int32 number = 2; + + optional EnumValueOptions options = 3; +} + +// Describes a service. +message ServiceDescriptorProto { + optional string name = 1; + repeated MethodDescriptorProto method = 2; + + optional ServiceOptions options = 3; +} + +// Describes a method of a service. +message MethodDescriptorProto { + optional string name = 1; + + // Input and output type names. These are resolved in the same way as + // FieldDescriptorProto.type_name, but must refer to a message type. + optional string input_type = 2; + optional string output_type = 3; + + optional MethodOptions options = 4; + + // Identifies if client streams multiple client messages + optional bool client_streaming = 5 [default=false]; + // Identifies if server streams multiple server messages + optional bool server_streaming = 6 [default=false]; +} + + +// =================================================================== +// Options + +// Each of the definitions above may have "options" attached. These are +// just annotations which may cause code to be generated slightly differently +// or may contain hints for code that manipulates protocol messages. +// +// Clients may define custom options as extensions of the *Options messages. +// These extensions may not yet be known at parsing time, so the parser cannot +// store the values in them. Instead it stores them in a field in the *Options +// message called uninterpreted_option. This field must have the same name +// across all *Options messages. We then use this field to populate the +// extensions when we build a descriptor, at which point all protos have been +// parsed and so all extensions are known. +// +// Extension numbers for custom options may be chosen as follows: +// * For options which will only be used within a single application or +// organization, or for experimental options, use field numbers 50000 +// through 99999. It is up to you to ensure that you do not use the +// same number for multiple options. +// * For options which will be published and used publicly by multiple +// independent entities, e-mail protobuf-global-extension-registry@google.com +// to reserve extension numbers. Simply provide your project name (e.g. +// Objective-C plugin) and your project website (if available) -- there's no +// need to explain how you intend to use them. Usually you only need one +// extension number. You can declare multiple options with only one extension +// number by putting them in a sub-message. See the Custom Options section of +// the docs for examples: +// https://developers.google.com/protocol-buffers/docs/proto#options +// If this turns out to be popular, a web service will be set up +// to automatically assign option numbers. + + +message FileOptions { + + // Sets the Java package where classes generated from this .proto will be + // placed. By default, the proto package is used, but this is often + // inappropriate because proto packages do not normally start with backwards + // domain names. + optional string java_package = 1; + + + // If set, all the classes from the .proto file are wrapped in a single + // outer class with the given name. This applies to both Proto1 + // (equivalent to the old "--one_java_file" option) and Proto2 (where + // a .proto always translates to a single class, but you may want to + // explicitly choose the class name). + optional string java_outer_classname = 8; + + // If set true, then the Java code generator will generate a separate .java + // file for each top-level message, enum, and service defined in the .proto + // file. Thus, these types will *not* be nested inside the outer class + // named by java_outer_classname. However, the outer class will still be + // generated to contain the file's getDescriptor() method as well as any + // top-level extensions defined in the file. + optional bool java_multiple_files = 10 [default=false]; + + // This option does nothing. + optional bool java_generate_equals_and_hash = 20 [deprecated=true]; + + // If set true, then the Java2 code generator will generate code that + // throws an exception whenever an attempt is made to assign a non-UTF-8 + // byte sequence to a string field. + // Message reflection will do the same. + // However, an extension field still accepts non-UTF-8 byte sequences. + // This option has no effect on when used with the lite runtime. + optional bool java_string_check_utf8 = 27 [default=false]; + + + // Generated classes can be optimized for speed or code size. + enum OptimizeMode { + SPEED = 1; // Generate complete code for parsing, serialization, + // etc. + CODE_SIZE = 2; // Use ReflectionOps to implement these methods. + LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. + } + optional OptimizeMode optimize_for = 9 [default=SPEED]; + + // Sets the Go package where structs generated from this .proto will be + // placed. If omitted, the Go package will be derived from the following: + // - The basename of the package import path, if provided. + // - Otherwise, the package statement in the .proto file, if present. + // - Otherwise, the basename of the .proto file, without extension. + optional string go_package = 11; + + + + // Should generic services be generated in each language? "Generic" services + // are not specific to any particular RPC system. They are generated by the + // main code generators in each language (without additional plugins). + // Generic services were the only kind of service generation supported by + // early versions of google.protobuf. + // + // Generic services are now considered deprecated in favor of using plugins + // that generate code specific to your particular RPC system. Therefore, + // these default to false. Old code which depends on generic services should + // explicitly set them to true. + optional bool cc_generic_services = 16 [default=false]; + optional bool java_generic_services = 17 [default=false]; + optional bool py_generic_services = 18 [default=false]; + optional bool php_generic_services = 42 [default=false]; + + // Is this file deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for everything in the file, or it will be completely ignored; in the very + // least, this is a formalization for deprecating files. + optional bool deprecated = 23 [default=false]; + + // Enables the use of arenas for the proto messages in this file. This applies + // only to generated classes for C++. + optional bool cc_enable_arenas = 31 [default=false]; + + + // Sets the objective c class prefix which is prepended to all objective c + // generated classes from this .proto. There is no default. + optional string objc_class_prefix = 36; + + // Namespace for generated classes; defaults to the package. + optional string csharp_namespace = 37; + + // By default Swift generators will take the proto package and CamelCase it + // replacing '.' with underscore and use that to prefix the types/symbols + // defined. When this options is provided, they will use this value instead + // to prefix the types/symbols defined. + optional string swift_prefix = 39; + + // Sets the php class prefix which is prepended to all php generated classes + // from this .proto. Default is empty. + optional string php_class_prefix = 40; + + // Use this option to change the namespace of php generated classes. Default + // is empty. When this option is empty, the package name will be used for + // determining the namespace. + optional string php_namespace = 41; + + + // Use this option to change the namespace of php generated metadata classes. + // Default is empty. When this option is empty, the proto file name will be used + // for determining the namespace. + optional string php_metadata_namespace = 44; + + // Use this option to change the package of ruby generated classes. Default + // is empty. When this option is not set, the package name will be used for + // determining the ruby package. + optional string ruby_package = 45; + + // The parser stores options it doesn't recognize here. + // See the documentation for the "Options" section above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. + // See the documentation for the "Options" section above. + extensions 1000 to max; + + reserved 38; +} + +message MessageOptions { + // Set true to use the old proto1 MessageSet wire format for extensions. + // This is provided for backwards-compatibility with the MessageSet wire + // format. You should not use this for any other reason: It's less + // efficient, has fewer features, and is more complicated. + // + // The message must be defined exactly as follows: + // message Foo { + // option message_set_wire_format = true; + // extensions 4 to max; + // } + // Note that the message cannot have any defined fields; MessageSets only + // have extensions. + // + // All extensions of your type must be singular messages; e.g. they cannot + // be int32s, enums, or repeated messages. + // + // Because this is an option, the above two restrictions are not enforced by + // the protocol compiler. + optional bool message_set_wire_format = 1 [default=false]; + + // Disables the generation of the standard "descriptor()" accessor, which can + // conflict with a field of the same name. This is meant to make migration + // from proto1 easier; new code should avoid fields named "descriptor". + optional bool no_standard_descriptor_accessor = 2 [default=false]; + + // Is this message deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the message, or it will be completely ignored; in the very least, + // this is a formalization for deprecating messages. + optional bool deprecated = 3 [default=false]; + + // Whether the message is an automatically generated map entry type for the + // maps field. + // + // For maps fields: + // map map_field = 1; + // The parsed descriptor looks like: + // message MapFieldEntry { + // option map_entry = true; + // optional KeyType key = 1; + // optional ValueType value = 2; + // } + // repeated MapFieldEntry map_field = 1; + // + // Implementations may choose not to generate the map_entry=true message, but + // use a native map in the target language to hold the keys and values. + // The reflection APIs in such implementions still need to work as + // if the field is a repeated message field. + // + // NOTE: Do not set the option in .proto files. Always use the maps syntax + // instead. The option should only be implicitly set by the proto compiler + // parser. + optional bool map_entry = 7; + + reserved 8; // javalite_serializable + reserved 9; // javanano_as_lite + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message FieldOptions { + // The ctype option instructs the C++ code generator to use a different + // representation of the field than it normally would. See the specific + // options below. This option is not yet implemented in the open source + // release -- sorry, we'll try to include it in a future version! + optional CType ctype = 1 [default = STRING]; + enum CType { + // Default mode. + STRING = 0; + + CORD = 1; + + STRING_PIECE = 2; + } + // The packed option can be enabled for repeated primitive fields to enable + // a more efficient representation on the wire. Rather than repeatedly + // writing the tag and type for each element, the entire array is encoded as + // a single length-delimited blob. In proto3, only explicit setting it to + // false will avoid using packed encoding. + optional bool packed = 2; + + // The jstype option determines the JavaScript type used for values of the + // field. The option is permitted only for 64 bit integral and fixed types + // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + // is represented as JavaScript string, which avoids loss of precision that + // can happen when a large value is converted to a floating point JavaScript. + // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + // use the JavaScript "number" type. The behavior of the default option + // JS_NORMAL is implementation dependent. + // + // This option is an enum to permit additional types to be added, e.g. + // goog.math.Integer. + optional JSType jstype = 6 [default = JS_NORMAL]; + enum JSType { + // Use the default type. + JS_NORMAL = 0; + + // Use JavaScript strings. + JS_STRING = 1; + + // Use JavaScript numbers. + JS_NUMBER = 2; + } + + // Should this field be parsed lazily? Lazy applies only to message-type + // fields. It means that when the outer message is initially parsed, the + // inner message's contents will not be parsed but instead stored in encoded + // form. The inner message will actually be parsed when it is first accessed. + // + // This is only a hint. Implementations are free to choose whether to use + // eager or lazy parsing regardless of the value of this option. However, + // setting this option true suggests that the protocol author believes that + // using lazy parsing on this field is worth the additional bookkeeping + // overhead typically needed to implement it. + // + // This option does not affect the public interface of any generated code; + // all method signatures remain the same. Furthermore, thread-safety of the + // interface is not affected by this option; const methods remain safe to + // call from multiple threads concurrently, while non-const methods continue + // to require exclusive access. + // + // + // Note that implementations may choose not to check required fields within + // a lazy sub-message. That is, calling IsInitialized() on the outer message + // may return true even if the inner message has missing required fields. + // This is necessary because otherwise the inner message would have to be + // parsed in order to perform the check, defeating the purpose of lazy + // parsing. An implementation which chooses not to check required fields + // must be consistent about it. That is, for any particular sub-message, the + // implementation must either *always* check its required fields, or *never* + // check its required fields, regardless of whether or not the message has + // been parsed. + optional bool lazy = 5 [default=false]; + + // Is this field deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for accessors, or it will be completely ignored; in the very least, this + // is a formalization for deprecating fields. + optional bool deprecated = 3 [default=false]; + + // For Google-internal migration only. Do not use. + optional bool weak = 10 [default=false]; + + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; + + reserved 4; // removed jtype +} + +message OneofOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumOptions { + + // Set this option to true to allow mapping different tag names to the same + // value. + optional bool allow_alias = 2; + + // Is this enum deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum, or it will be completely ignored; in the very least, this + // is a formalization for deprecating enums. + optional bool deprecated = 3 [default=false]; + + reserved 5; // javanano_as_lite + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumValueOptions { + // Is this enum value deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum value, or it will be completely ignored; in the very least, + // this is a formalization for deprecating enum values. + optional bool deprecated = 1 [default=false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message ServiceOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this service deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the service, or it will be completely ignored; in the very least, + // this is a formalization for deprecating services. + optional bool deprecated = 33 [default=false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message MethodOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this method deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the method, or it will be completely ignored; in the very least, + // this is a formalization for deprecating methods. + optional bool deprecated = 33 [default=false]; + + // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + // or neither? HTTP based RPC implementation may choose GET verb for safe + // methods, and PUT verb for idempotent methods instead of the default POST. + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0; + NO_SIDE_EFFECTS = 1; // implies idempotent + IDEMPOTENT = 2; // idempotent, but may have side effects + } + optional IdempotencyLevel idempotency_level = + 34 [default=IDEMPOTENCY_UNKNOWN]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + + +// A message representing a option the parser does not recognize. This only +// appears in options protos created by the compiler::Parser class. +// DescriptorPool resolves these when building Descriptor objects. Therefore, +// options protos in descriptor objects (e.g. returned by Descriptor::options(), +// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions +// in them. +message UninterpretedOption { + // The name of the uninterpreted option. Each string represents a segment in + // a dot-separated name. is_extension is true iff a segment represents an + // extension (denoted with parentheses in options specs in .proto files). + // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + // "foo.(bar.baz).qux". + message NamePart { + required string name_part = 1; + required bool is_extension = 2; + } + repeated NamePart name = 2; + + // The value of the uninterpreted option, in whatever type the tokenizer + // identified it as during parsing. Exactly one of these should be set. + optional string identifier_value = 3; + optional uint64 positive_int_value = 4; + optional int64 negative_int_value = 5; + optional double double_value = 6; + optional bytes string_value = 7; + optional string aggregate_value = 8; +} + +// =================================================================== +// Optional source code info + +// Encapsulates information about the original source file from which a +// FileDescriptorProto was generated. +message SourceCodeInfo { + // A Location identifies a piece of source code in a .proto file which + // corresponds to a particular definition. This information is intended + // to be useful to IDEs, code indexers, documentation generators, and similar + // tools. + // + // For example, say we have a file like: + // message Foo { + // optional string foo = 1; + // } + // Let's look at just the field definition: + // optional string foo = 1; + // ^ ^^ ^^ ^ ^^^ + // a bc de f ghi + // We have the following locations: + // span path represents + // [a,i) [ 4, 0, 2, 0 ] The whole field definition. + // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + // + // Notes: + // - A location may refer to a repeated field itself (i.e. not to any + // particular index within it). This is used whenever a set of elements are + // logically enclosed in a single code segment. For example, an entire + // extend block (possibly containing multiple extension definitions) will + // have an outer location whose path refers to the "extensions" repeated + // field without an index. + // - Multiple locations may have the same path. This happens when a single + // logical declaration is spread out across multiple places. The most + // obvious example is the "extend" block again -- there may be multiple + // extend blocks in the same scope, each of which will have the same path. + // - A location's span is not always a subset of its parent's span. For + // example, the "extendee" of an extension declaration appears at the + // beginning of the "extend" block and is shared by all extensions within + // the block. + // - Just because a location's span is a subset of some other location's span + // does not mean that it is a descendent. For example, a "group" defines + // both a type and a field in a single declaration. Thus, the locations + // corresponding to the type and field and their components will overlap. + // - Code which tries to interpret locations should probably be designed to + // ignore those that it doesn't understand, as more types of locations could + // be recorded in the future. + repeated Location location = 1; + message Location { + // Identifies which part of the FileDescriptorProto was defined at this + // location. + // + // Each element is a field number or an index. They form a path from + // the root FileDescriptorProto to the place where the definition. For + // example, this path: + // [ 4, 3, 2, 7, 1 ] + // refers to: + // file.message_type(3) // 4, 3 + // .field(7) // 2, 7 + // .name() // 1 + // This is because FileDescriptorProto.message_type has field number 4: + // repeated DescriptorProto message_type = 4; + // and DescriptorProto.field has field number 2: + // repeated FieldDescriptorProto field = 2; + // and FieldDescriptorProto.name has field number 1: + // optional string name = 1; + // + // Thus, the above path gives the location of a field name. If we removed + // the last element: + // [ 4, 3, 2, 7 ] + // this path refers to the whole field declaration (from the beginning + // of the label to the terminating semicolon). + repeated int32 path = 1 [packed=true]; + + // Always has exactly three or four elements: start line, start column, + // end line (optional, otherwise assumed same as start line), end column. + // These are packed into a single field for efficiency. Note that line + // and column numbers are zero-based -- typically you will want to add + // 1 to each before displaying to a user. + repeated int32 span = 2 [packed=true]; + + // If this SourceCodeInfo represents a complete declaration, these are any + // comments appearing before and after the declaration which appear to be + // attached to the declaration. + // + // A series of line comments appearing on consecutive lines, with no other + // tokens appearing on those lines, will be treated as a single comment. + // + // leading_detached_comments will keep paragraphs of comments that appear + // before (but not connected to) the current element. Each paragraph, + // separated by empty lines, will be one comment element in the repeated + // field. + // + // Only the comment content is provided; comment markers (e.g. //) are + // stripped out. For block comments, leading whitespace and an asterisk + // will be stripped from the beginning of each line other than the first. + // Newlines are included in the output. + // + // Examples: + // + // optional int32 foo = 1; // Comment attached to foo. + // // Comment attached to bar. + // optional int32 bar = 2; + // + // optional string baz = 3; + // // Comment attached to baz. + // // Another line attached to baz. + // + // // Comment attached to qux. + // // + // // Another line attached to qux. + // optional double qux = 4; + // + // // Detached comment for corge. This is not leading or trailing comments + // // to qux or corge because there are blank lines separating it from + // // both. + // + // // Detached comment for corge paragraph 2. + // + // optional string corge = 5; + // /* Block comment attached + // * to corge. Leading asterisks + // * will be removed. */ + // /* Block comment attached to + // * grault. */ + // optional int32 grault = 6; + // + // // ignored detached comments. + optional string leading_comments = 3; + optional string trailing_comments = 4; + repeated string leading_detached_comments = 6; + } +} + +// Describes the relationship between generated code and its original source +// file. A GeneratedCodeInfo message is associated with only one generated +// source file, but may contain references to different source .proto files. +message GeneratedCodeInfo { + // An Annotation connects some span of text in generated code to an element + // of its generating .proto file. + repeated Annotation annotation = 1; + message Annotation { + // Identifies the element in the original source .proto file. This field + // is formatted the same as SourceCodeInfo.Location.path. + repeated int32 path = 1 [packed=true]; + + // Identifies the filesystem path to the original source .proto. + optional string source_file = 2; + + // Identifies the starting offset in bytes in the generated code + // that relates to the identified object. + optional int32 begin = 3; + + // Identifies the ending offset in bytes in the generated code that + // relates to the identified offset. The end offset should be one past + // the last relevant byte (so the length of the text = end - begin). + optional int32 end = 4; + } +} diff --git a/protos/google/protobuf/empty.proto b/protos/google/protobuf/empty.proto new file mode 100644 index 0000000..03cacd2 --- /dev/null +++ b/protos/google/protobuf/empty.proto @@ -0,0 +1,52 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "github.com/golang/protobuf/ptypes/empty"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "EmptyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// A generic empty message that you can re-use to avoid defining duplicated +// empty messages in your APIs. A typical example is to use it as the request +// or the response type of an API method. For instance: +// +// service Foo { +// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +// } +// +// The JSON representation for `Empty` is empty JSON object `{}`. +message Empty {} diff --git a/protos/oauth.proto b/protos/oauth.proto new file mode 100644 index 0000000..779a02e --- /dev/null +++ b/protos/oauth.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; + +package programming_lab.prolab_accounts; + +option go_package = "github.com/ProgrammingLab/prolab-accounts/api;api_pb"; + + +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; + +import "type/client.proto"; + +service OAuthService { + rpc StartOAuthLogin (StartOAuthLoginRequest) returns (StartOAuthLoginResponse) { + option (google.api.http) = { + get: "/oauth/login" + }; + } + rpc OAuthLogin (OAuthLoginRequest) returns (OAuthLoginResponse) { + option (google.api.http) = { + post: "/oauth/login" + body: "*" + }; + } + rpc StartOAuthConsent (StartOAuthConsentRequest) returns (StartOAuthConsentResponse) { + option (google.api.http) = { + get: "/oauth/consent" + }; + } + rpc OAuthConsent (OAuthConsentRequest) returns (OAuthConsentResponse) { + option (google.api.http) = { + post: "/oauth/consent" + body: "*" + }; + } +} + +message StartOAuthLoginRequest { + string login_challenge = 1; +} + +message StartOAuthLoginResponse { + bool skip = 1; + string redirect_url = 2; +} + +message OAuthLoginRequest { + string login_challenge = 1; + string name = 2; + string password = 3; + bool remember = 4; +} + +message OAuthLoginResponse { + string redirect_url = 1; +} + +message StartOAuthConsentRequest { + string consent_challenge = 1; +} + +message StartOAuthConsentResponse { + bool skip = 1; + string redirect_url = 2; + repeated string requested_scopes = 3; + type.Client client = 4; +} + +message OAuthConsentRequest { + string consent_challenge = 1; + bool accept = 2; + repeated string grant_scopes = 3; + bool remember = 4; +} + +message OAuthConsentResponse { + string redirect_url = 1; +} diff --git a/protos/sessions.proto b/protos/sessions.proto new file mode 100644 index 0000000..993d738 --- /dev/null +++ b/protos/sessions.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +option go_package = "api_pb"; +package com.github.ProgrammingLab.prolab_accounts.api; + +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; + +service SessionService { + rpc GetSession (GetSessionRequest) returns (Session) { + option (google.api.http) = { + get: "/sessions" + }; + } + rpc CreateSession (CreateSessionRequest) returns (Session) { + option (google.api.http) = { + post: "/sessions" + body: "*" + }; + } + rpc DeleteSession (DeleteSessionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/sessions" + }; + } +} + +message Session { + string session_id = 1; +} + +message GetSessionRequest {} + +message CreateSessionRequest { + string name = 1; + string password = 2; +} + +message DeleteSessionRequest {} diff --git a/protos/type/client.proto b/protos/type/client.proto new file mode 100644 index 0000000..96903c3 --- /dev/null +++ b/protos/type/client.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package programming_lab.prolab_accounts.type; + +option go_package = "github.com/ProgrammingLab/prolab-accounts/api/type;type_pb"; + +message Client { + string id = 1; + string name = 2; + string uri = 3; + repeated string contacts = 4; + string logo_uri = 5; + string owner = 6; +} diff --git a/protos/users.proto b/protos/users.proto new file mode 100644 index 0000000..59bd7df --- /dev/null +++ b/protos/users.proto @@ -0,0 +1,88 @@ +syntax = "proto3"; +option go_package = "api_pb"; +package com.github.ProgrammingLab.prolab_accounts.api; + +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; + +service UserService { + rpc ListUsers (ListUsersRequest) returns (ListUsersResponse) { + option (google.api.http) = { + get: "/users" + }; + } + rpc GetUser (GetUserRequest) returns (User) { + option (google.api.http) = { + get: "/users/{user_id}" + }; + } + rpc CreateUser (CreateUserRequest) returns (User) { + option (google.api.http) = { + post: "/users" + body: "user" + }; + } + rpc GetCurrentUser (GetCurrentUserRequest) returns (User) { + option (google.api.http) = { + get: "/user" + }; + } + rpc UpdateUser (UpdateUserRequest) returns (User) { + option (google.api.http) = { + patch: "/user" + body: "user" + }; + } + rpc UpdatePassword (UpdatePasswordRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + put: "/user/password" + }; + } +} + +message User { + uint32 user_id = 1; + string name = 2; + string email = 3; + string full_name = 4; + string avatar_url = 5; + string description = 6; + int32 grade = 7; + bool left = 8; + string department = 9; + string short_department = 10; + string role = 11; + string twitter_screen_name = 12; + string github_user_name = 13; +} + +message ListUsersRequest { + uint32 page_token = 1; + int32 page_size = 2; +} + +message ListUsersResponse { + repeated User users = 1; + uint32 next_page_token = 2; +} + +message GetUserRequest { + uint32 user_id = 1; +} + +message CreateUserRequest { + User user = 1; + string registeration_token = 2; +} + +message GetCurrentUserRequest {} + +message UpdateUserRequest { + User user = 1; +} + +message UpdatePasswordRequest { + string password = 1; + string new_password = 2; + string new_password_repeat = 3; +} diff --git a/scripts/protoc.sh b/scripts/protoc.sh new file mode 100755 index 0000000..bb1d9f5 --- /dev/null +++ b/scripts/protoc.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +OUT_DIR="./src/api" +PROTO_DIR="./protos" + +ls -l -d $(find ${PROTO_DIR}) | grep -E ".*\.proto" | grep -v google | while read LINE + +do + FILE=`echo ${LINE} | awk '{print $9}'` + protoc -I=${PROTO_DIR} ${FILE} \ + --js_out=import_style=commonjs:${OUT_DIR} \ + --grpc-web_out=import_style=commonjs,mode=grpcwebtext:${OUT_DIR} +done diff --git a/src/api/oauth_grpc_web_pb.js b/src/api/oauth_grpc_web_pb.js new file mode 100644 index 0000000..9f9342a --- /dev/null +++ b/src/api/oauth_grpc_web_pb.js @@ -0,0 +1,307 @@ +/** + * @fileoverview gRPC-Web generated client stub for programming_lab.prolab_accounts + * @enhanceable + * @public + */ + +// GENERATED CODE -- DO NOT EDIT! + + + +const grpc = {}; +grpc.web = require('grpc-web'); + + +var google_api_annotations_pb = require('./google/api/annotations_pb.js') + +var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js') + +var type_client_pb = require('./type/client_pb.js') +const proto = {}; +proto.programming_lab = {}; +proto.programming_lab.prolab_accounts = require('./oauth_pb.js'); + +/** + * @param {string} hostname + * @param {?Object} credentials + * @param {?Object} options + * @constructor + * @struct + * @final + */ +proto.programming_lab.prolab_accounts.OAuthServiceClient = + function(hostname, credentials, options) { + if (!options) options = {}; + options['format'] = 'text'; + + /** + * @private @const {!grpc.web.GrpcWebClientBase} The client + */ + this.client_ = new grpc.web.GrpcWebClientBase(options); + + /** + * @private @const {string} The hostname + */ + this.hostname_ = hostname; + + /** + * @private @const {?Object} The credentials to be used to connect + * to the server + */ + this.credentials_ = credentials; + + /** + * @private @const {?Object} Options for the client + */ + this.options_ = options; +}; + + +/** + * @param {string} hostname + * @param {?Object} credentials + * @param {?Object} options + * @constructor + * @struct + * @final + */ +proto.programming_lab.prolab_accounts.OAuthServicePromiseClient = + function(hostname, credentials, options) { + if (!options) options = {}; + options['format'] = 'text'; + + /** + * @private @const {!proto.programming_lab.prolab_accounts.OAuthServiceClient} The delegate callback based client + */ + this.delegateClient_ = new proto.programming_lab.prolab_accounts.OAuthServiceClient( + hostname, credentials, options); + +}; + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.programming_lab.prolab_accounts.StartOAuthLoginRequest, + * !proto.programming_lab.prolab_accounts.StartOAuthLoginResponse>} + */ +const methodInfo_OAuthService_StartOAuthLogin = new grpc.web.AbstractClientBase.MethodInfo( + proto.programming_lab.prolab_accounts.StartOAuthLoginResponse, + /** @param {!proto.programming_lab.prolab_accounts.StartOAuthLoginRequest} request */ + function(request) { + return request.serializeBinary(); + }, + proto.programming_lab.prolab_accounts.StartOAuthLoginResponse.deserializeBinary +); + + +/** + * @param {!proto.programming_lab.prolab_accounts.StartOAuthLoginRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.programming_lab.prolab_accounts.StartOAuthLoginResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.programming_lab.prolab_accounts.OAuthServiceClient.prototype.startOAuthLogin = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/programming_lab.prolab_accounts.OAuthService/StartOAuthLogin', + request, + metadata, + methodInfo_OAuthService_StartOAuthLogin, + callback); +}; + + +/** + * @param {!proto.programming_lab.prolab_accounts.StartOAuthLoginRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @return {!Promise} + * The XHR Node Readable Stream + */ +proto.programming_lab.prolab_accounts.OAuthServicePromiseClient.prototype.startOAuthLogin = + function(request, metadata) { + return new Promise((resolve, reject) => { + this.delegateClient_.startOAuthLogin( + request, metadata, (error, response) => { + error ? reject(error) : resolve(response); + }); + }); +}; + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.programming_lab.prolab_accounts.OAuthLoginRequest, + * !proto.programming_lab.prolab_accounts.OAuthLoginResponse>} + */ +const methodInfo_OAuthService_OAuthLogin = new grpc.web.AbstractClientBase.MethodInfo( + proto.programming_lab.prolab_accounts.OAuthLoginResponse, + /** @param {!proto.programming_lab.prolab_accounts.OAuthLoginRequest} request */ + function(request) { + return request.serializeBinary(); + }, + proto.programming_lab.prolab_accounts.OAuthLoginResponse.deserializeBinary +); + + +/** + * @param {!proto.programming_lab.prolab_accounts.OAuthLoginRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.programming_lab.prolab_accounts.OAuthLoginResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.programming_lab.prolab_accounts.OAuthServiceClient.prototype.oAuthLogin = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/programming_lab.prolab_accounts.OAuthService/OAuthLogin', + request, + metadata, + methodInfo_OAuthService_OAuthLogin, + callback); +}; + + +/** + * @param {!proto.programming_lab.prolab_accounts.OAuthLoginRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @return {!Promise} + * The XHR Node Readable Stream + */ +proto.programming_lab.prolab_accounts.OAuthServicePromiseClient.prototype.oAuthLogin = + function(request, metadata) { + return new Promise((resolve, reject) => { + this.delegateClient_.oAuthLogin( + request, metadata, (error, response) => { + error ? reject(error) : resolve(response); + }); + }); +}; + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.programming_lab.prolab_accounts.StartOAuthConsentRequest, + * !proto.programming_lab.prolab_accounts.StartOAuthConsentResponse>} + */ +const methodInfo_OAuthService_StartOAuthConsent = new grpc.web.AbstractClientBase.MethodInfo( + proto.programming_lab.prolab_accounts.StartOAuthConsentResponse, + /** @param {!proto.programming_lab.prolab_accounts.StartOAuthConsentRequest} request */ + function(request) { + return request.serializeBinary(); + }, + proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.deserializeBinary +); + + +/** + * @param {!proto.programming_lab.prolab_accounts.StartOAuthConsentRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.programming_lab.prolab_accounts.StartOAuthConsentResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.programming_lab.prolab_accounts.OAuthServiceClient.prototype.startOAuthConsent = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/programming_lab.prolab_accounts.OAuthService/StartOAuthConsent', + request, + metadata, + methodInfo_OAuthService_StartOAuthConsent, + callback); +}; + + +/** + * @param {!proto.programming_lab.prolab_accounts.StartOAuthConsentRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @return {!Promise} + * The XHR Node Readable Stream + */ +proto.programming_lab.prolab_accounts.OAuthServicePromiseClient.prototype.startOAuthConsent = + function(request, metadata) { + return new Promise((resolve, reject) => { + this.delegateClient_.startOAuthConsent( + request, metadata, (error, response) => { + error ? reject(error) : resolve(response); + }); + }); +}; + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.programming_lab.prolab_accounts.OAuthConsentRequest, + * !proto.programming_lab.prolab_accounts.OAuthConsentResponse>} + */ +const methodInfo_OAuthService_OAuthConsent = new grpc.web.AbstractClientBase.MethodInfo( + proto.programming_lab.prolab_accounts.OAuthConsentResponse, + /** @param {!proto.programming_lab.prolab_accounts.OAuthConsentRequest} request */ + function(request) { + return request.serializeBinary(); + }, + proto.programming_lab.prolab_accounts.OAuthConsentResponse.deserializeBinary +); + + +/** + * @param {!proto.programming_lab.prolab_accounts.OAuthConsentRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.programming_lab.prolab_accounts.OAuthConsentResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.programming_lab.prolab_accounts.OAuthServiceClient.prototype.oAuthConsent = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/programming_lab.prolab_accounts.OAuthService/OAuthConsent', + request, + metadata, + methodInfo_OAuthService_OAuthConsent, + callback); +}; + + +/** + * @param {!proto.programming_lab.prolab_accounts.OAuthConsentRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @return {!Promise} + * The XHR Node Readable Stream + */ +proto.programming_lab.prolab_accounts.OAuthServicePromiseClient.prototype.oAuthConsent = + function(request, metadata) { + return new Promise((resolve, reject) => { + this.delegateClient_.oAuthConsent( + request, metadata, (error, response) => { + error ? reject(error) : resolve(response); + }); + }); +}; + + +module.exports = proto.programming_lab.prolab_accounts; + diff --git a/src/api/oauth_pb.js b/src/api/oauth_pb.js new file mode 100644 index 0000000..171187e --- /dev/null +++ b/src/api/oauth_pb.js @@ -0,0 +1,1500 @@ +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var google_api_annotations_pb = require('./google/api/annotations_pb.js'); +var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js'); +var type_client_pb = require('./type/client_pb.js'); +goog.exportSymbol('proto.programming_lab.prolab_accounts.OAuthConsentRequest', null, global); +goog.exportSymbol('proto.programming_lab.prolab_accounts.OAuthConsentResponse', null, global); +goog.exportSymbol('proto.programming_lab.prolab_accounts.OAuthLoginRequest', null, global); +goog.exportSymbol('proto.programming_lab.prolab_accounts.OAuthLoginResponse', null, global); +goog.exportSymbol('proto.programming_lab.prolab_accounts.StartOAuthConsentRequest', null, global); +goog.exportSymbol('proto.programming_lab.prolab_accounts.StartOAuthConsentResponse', null, global); +goog.exportSymbol('proto.programming_lab.prolab_accounts.StartOAuthLoginRequest', null, global); +goog.exportSymbol('proto.programming_lab.prolab_accounts.StartOAuthLoginResponse', null, global); + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.programming_lab.prolab_accounts.StartOAuthLoginRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.programming_lab.prolab_accounts.StartOAuthLoginRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.programming_lab.prolab_accounts.StartOAuthLoginRequest.displayName = 'proto.programming_lab.prolab_accounts.StartOAuthLoginRequest'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.programming_lab.prolab_accounts.StartOAuthLoginRequest.prototype.toObject = function(opt_includeInstance) { + return proto.programming_lab.prolab_accounts.StartOAuthLoginRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.programming_lab.prolab_accounts.StartOAuthLoginRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.programming_lab.prolab_accounts.StartOAuthLoginRequest.toObject = function(includeInstance, msg) { + var f, obj = { + loginChallenge: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.programming_lab.prolab_accounts.StartOAuthLoginRequest} + */ +proto.programming_lab.prolab_accounts.StartOAuthLoginRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.programming_lab.prolab_accounts.StartOAuthLoginRequest; + return proto.programming_lab.prolab_accounts.StartOAuthLoginRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.programming_lab.prolab_accounts.StartOAuthLoginRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.programming_lab.prolab_accounts.StartOAuthLoginRequest} + */ +proto.programming_lab.prolab_accounts.StartOAuthLoginRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setLoginChallenge(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.programming_lab.prolab_accounts.StartOAuthLoginRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.programming_lab.prolab_accounts.StartOAuthLoginRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.programming_lab.prolab_accounts.StartOAuthLoginRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.programming_lab.prolab_accounts.StartOAuthLoginRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getLoginChallenge(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string login_challenge = 1; + * @return {string} + */ +proto.programming_lab.prolab_accounts.StartOAuthLoginRequest.prototype.getLoginChallenge = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.programming_lab.prolab_accounts.StartOAuthLoginRequest.prototype.setLoginChallenge = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.programming_lab.prolab_accounts.StartOAuthLoginResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.programming_lab.prolab_accounts.StartOAuthLoginResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.programming_lab.prolab_accounts.StartOAuthLoginResponse.displayName = 'proto.programming_lab.prolab_accounts.StartOAuthLoginResponse'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.programming_lab.prolab_accounts.StartOAuthLoginResponse.prototype.toObject = function(opt_includeInstance) { + return proto.programming_lab.prolab_accounts.StartOAuthLoginResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.programming_lab.prolab_accounts.StartOAuthLoginResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.programming_lab.prolab_accounts.StartOAuthLoginResponse.toObject = function(includeInstance, msg) { + var f, obj = { + skip: jspb.Message.getFieldWithDefault(msg, 1, false), + redirectUrl: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.programming_lab.prolab_accounts.StartOAuthLoginResponse} + */ +proto.programming_lab.prolab_accounts.StartOAuthLoginResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.programming_lab.prolab_accounts.StartOAuthLoginResponse; + return proto.programming_lab.prolab_accounts.StartOAuthLoginResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.programming_lab.prolab_accounts.StartOAuthLoginResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.programming_lab.prolab_accounts.StartOAuthLoginResponse} + */ +proto.programming_lab.prolab_accounts.StartOAuthLoginResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSkip(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setRedirectUrl(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.programming_lab.prolab_accounts.StartOAuthLoginResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.programming_lab.prolab_accounts.StartOAuthLoginResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.programming_lab.prolab_accounts.StartOAuthLoginResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.programming_lab.prolab_accounts.StartOAuthLoginResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSkip(); + if (f) { + writer.writeBool( + 1, + f + ); + } + f = message.getRedirectUrl(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional bool skip = 1; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.programming_lab.prolab_accounts.StartOAuthLoginResponse.prototype.getSkip = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 1, false)); +}; + + +/** @param {boolean} value */ +proto.programming_lab.prolab_accounts.StartOAuthLoginResponse.prototype.setSkip = function(value) { + jspb.Message.setProto3BooleanField(this, 1, value); +}; + + +/** + * optional string redirect_url = 2; + * @return {string} + */ +proto.programming_lab.prolab_accounts.StartOAuthLoginResponse.prototype.getRedirectUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.programming_lab.prolab_accounts.StartOAuthLoginResponse.prototype.setRedirectUrl = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.programming_lab.prolab_accounts.OAuthLoginRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.programming_lab.prolab_accounts.OAuthLoginRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.programming_lab.prolab_accounts.OAuthLoginRequest.displayName = 'proto.programming_lab.prolab_accounts.OAuthLoginRequest'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.programming_lab.prolab_accounts.OAuthLoginRequest.prototype.toObject = function(opt_includeInstance) { + return proto.programming_lab.prolab_accounts.OAuthLoginRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.programming_lab.prolab_accounts.OAuthLoginRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.programming_lab.prolab_accounts.OAuthLoginRequest.toObject = function(includeInstance, msg) { + var f, obj = { + loginChallenge: jspb.Message.getFieldWithDefault(msg, 1, ""), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + password: jspb.Message.getFieldWithDefault(msg, 3, ""), + remember: jspb.Message.getFieldWithDefault(msg, 4, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.programming_lab.prolab_accounts.OAuthLoginRequest} + */ +proto.programming_lab.prolab_accounts.OAuthLoginRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.programming_lab.prolab_accounts.OAuthLoginRequest; + return proto.programming_lab.prolab_accounts.OAuthLoginRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.programming_lab.prolab_accounts.OAuthLoginRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.programming_lab.prolab_accounts.OAuthLoginRequest} + */ +proto.programming_lab.prolab_accounts.OAuthLoginRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setLoginChallenge(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setPassword(value); + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setRemember(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.programming_lab.prolab_accounts.OAuthLoginRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.programming_lab.prolab_accounts.OAuthLoginRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.programming_lab.prolab_accounts.OAuthLoginRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.programming_lab.prolab_accounts.OAuthLoginRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getLoginChallenge(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getPassword(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getRemember(); + if (f) { + writer.writeBool( + 4, + f + ); + } +}; + + +/** + * optional string login_challenge = 1; + * @return {string} + */ +proto.programming_lab.prolab_accounts.OAuthLoginRequest.prototype.getLoginChallenge = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.programming_lab.prolab_accounts.OAuthLoginRequest.prototype.setLoginChallenge = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.programming_lab.prolab_accounts.OAuthLoginRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.programming_lab.prolab_accounts.OAuthLoginRequest.prototype.setName = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string password = 3; + * @return {string} + */ +proto.programming_lab.prolab_accounts.OAuthLoginRequest.prototype.getPassword = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +proto.programming_lab.prolab_accounts.OAuthLoginRequest.prototype.setPassword = function(value) { + jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional bool remember = 4; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.programming_lab.prolab_accounts.OAuthLoginRequest.prototype.getRemember = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 4, false)); +}; + + +/** @param {boolean} value */ +proto.programming_lab.prolab_accounts.OAuthLoginRequest.prototype.setRemember = function(value) { + jspb.Message.setProto3BooleanField(this, 4, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.programming_lab.prolab_accounts.OAuthLoginResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.programming_lab.prolab_accounts.OAuthLoginResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.programming_lab.prolab_accounts.OAuthLoginResponse.displayName = 'proto.programming_lab.prolab_accounts.OAuthLoginResponse'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.programming_lab.prolab_accounts.OAuthLoginResponse.prototype.toObject = function(opt_includeInstance) { + return proto.programming_lab.prolab_accounts.OAuthLoginResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.programming_lab.prolab_accounts.OAuthLoginResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.programming_lab.prolab_accounts.OAuthLoginResponse.toObject = function(includeInstance, msg) { + var f, obj = { + redirectUrl: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.programming_lab.prolab_accounts.OAuthLoginResponse} + */ +proto.programming_lab.prolab_accounts.OAuthLoginResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.programming_lab.prolab_accounts.OAuthLoginResponse; + return proto.programming_lab.prolab_accounts.OAuthLoginResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.programming_lab.prolab_accounts.OAuthLoginResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.programming_lab.prolab_accounts.OAuthLoginResponse} + */ +proto.programming_lab.prolab_accounts.OAuthLoginResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setRedirectUrl(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.programming_lab.prolab_accounts.OAuthLoginResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.programming_lab.prolab_accounts.OAuthLoginResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.programming_lab.prolab_accounts.OAuthLoginResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.programming_lab.prolab_accounts.OAuthLoginResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRedirectUrl(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string redirect_url = 1; + * @return {string} + */ +proto.programming_lab.prolab_accounts.OAuthLoginResponse.prototype.getRedirectUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.programming_lab.prolab_accounts.OAuthLoginResponse.prototype.setRedirectUrl = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.programming_lab.prolab_accounts.StartOAuthConsentRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.programming_lab.prolab_accounts.StartOAuthConsentRequest.displayName = 'proto.programming_lab.prolab_accounts.StartOAuthConsentRequest'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentRequest.prototype.toObject = function(opt_includeInstance) { + return proto.programming_lab.prolab_accounts.StartOAuthConsentRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.programming_lab.prolab_accounts.StartOAuthConsentRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentRequest.toObject = function(includeInstance, msg) { + var f, obj = { + consentChallenge: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.programming_lab.prolab_accounts.StartOAuthConsentRequest} + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.programming_lab.prolab_accounts.StartOAuthConsentRequest; + return proto.programming_lab.prolab_accounts.StartOAuthConsentRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.programming_lab.prolab_accounts.StartOAuthConsentRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.programming_lab.prolab_accounts.StartOAuthConsentRequest} + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setConsentChallenge(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.programming_lab.prolab_accounts.StartOAuthConsentRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.programming_lab.prolab_accounts.StartOAuthConsentRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getConsentChallenge(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string consent_challenge = 1; + * @return {string} + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentRequest.prototype.getConsentChallenge = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.programming_lab.prolab_accounts.StartOAuthConsentRequest.prototype.setConsentChallenge = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.repeatedFields_, null); +}; +goog.inherits(proto.programming_lab.prolab_accounts.StartOAuthConsentResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.displayName = 'proto.programming_lab.prolab_accounts.StartOAuthConsentResponse'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.prototype.toObject = function(opt_includeInstance) { + return proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.programming_lab.prolab_accounts.StartOAuthConsentResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.toObject = function(includeInstance, msg) { + var f, obj = { + skip: jspb.Message.getFieldWithDefault(msg, 1, false), + redirectUrl: jspb.Message.getFieldWithDefault(msg, 2, ""), + requestedScopesList: jspb.Message.getRepeatedField(msg, 3), + client: (f = msg.getClient()) && type_client_pb.Client.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.programming_lab.prolab_accounts.StartOAuthConsentResponse} + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.programming_lab.prolab_accounts.StartOAuthConsentResponse; + return proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.programming_lab.prolab_accounts.StartOAuthConsentResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.programming_lab.prolab_accounts.StartOAuthConsentResponse} + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSkip(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setRedirectUrl(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.addRequestedScopes(value); + break; + case 4: + var value = new type_client_pb.Client; + reader.readMessage(value,type_client_pb.Client.deserializeBinaryFromReader); + msg.setClient(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.programming_lab.prolab_accounts.StartOAuthConsentResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSkip(); + if (f) { + writer.writeBool( + 1, + f + ); + } + f = message.getRedirectUrl(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getRequestedScopesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 3, + f + ); + } + f = message.getClient(); + if (f != null) { + writer.writeMessage( + 4, + f, + type_client_pb.Client.serializeBinaryToWriter + ); + } +}; + + +/** + * optional bool skip = 1; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.prototype.getSkip = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 1, false)); +}; + + +/** @param {boolean} value */ +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.prototype.setSkip = function(value) { + jspb.Message.setProto3BooleanField(this, 1, value); +}; + + +/** + * optional string redirect_url = 2; + * @return {string} + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.prototype.getRedirectUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.prototype.setRedirectUrl = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * repeated string requested_scopes = 3; + * @return {!Array} + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.prototype.getRequestedScopesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** @param {!Array} value */ +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.prototype.setRequestedScopesList = function(value) { + jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {!string} value + * @param {number=} opt_index + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.prototype.addRequestedScopes = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.prototype.clearRequestedScopesList = function() { + this.setRequestedScopesList([]); +}; + + +/** + * optional type.Client client = 4; + * @return {?proto.programming_lab.prolab_accounts.type.Client} + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.prototype.getClient = function() { + return /** @type{?proto.programming_lab.prolab_accounts.type.Client} */ ( + jspb.Message.getWrapperField(this, type_client_pb.Client, 4)); +}; + + +/** @param {?proto.programming_lab.prolab_accounts.type.Client|undefined} value */ +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.prototype.setClient = function(value) { + jspb.Message.setWrapperField(this, 4, value); +}; + + +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.prototype.clearClient = function() { + this.setClient(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.programming_lab.prolab_accounts.StartOAuthConsentResponse.prototype.hasClient = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.programming_lab.prolab_accounts.OAuthConsentRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.programming_lab.prolab_accounts.OAuthConsentRequest.repeatedFields_, null); +}; +goog.inherits(proto.programming_lab.prolab_accounts.OAuthConsentRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.programming_lab.prolab_accounts.OAuthConsentRequest.displayName = 'proto.programming_lab.prolab_accounts.OAuthConsentRequest'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.programming_lab.prolab_accounts.OAuthConsentRequest.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.programming_lab.prolab_accounts.OAuthConsentRequest.prototype.toObject = function(opt_includeInstance) { + return proto.programming_lab.prolab_accounts.OAuthConsentRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.programming_lab.prolab_accounts.OAuthConsentRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.programming_lab.prolab_accounts.OAuthConsentRequest.toObject = function(includeInstance, msg) { + var f, obj = { + consentChallenge: jspb.Message.getFieldWithDefault(msg, 1, ""), + accept: jspb.Message.getFieldWithDefault(msg, 2, false), + grantScopesList: jspb.Message.getRepeatedField(msg, 3), + remember: jspb.Message.getFieldWithDefault(msg, 4, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.programming_lab.prolab_accounts.OAuthConsentRequest} + */ +proto.programming_lab.prolab_accounts.OAuthConsentRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.programming_lab.prolab_accounts.OAuthConsentRequest; + return proto.programming_lab.prolab_accounts.OAuthConsentRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.programming_lab.prolab_accounts.OAuthConsentRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.programming_lab.prolab_accounts.OAuthConsentRequest} + */ +proto.programming_lab.prolab_accounts.OAuthConsentRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setConsentChallenge(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAccept(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.addGrantScopes(value); + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setRemember(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.programming_lab.prolab_accounts.OAuthConsentRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.programming_lab.prolab_accounts.OAuthConsentRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.programming_lab.prolab_accounts.OAuthConsentRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.programming_lab.prolab_accounts.OAuthConsentRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getConsentChallenge(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getAccept(); + if (f) { + writer.writeBool( + 2, + f + ); + } + f = message.getGrantScopesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 3, + f + ); + } + f = message.getRemember(); + if (f) { + writer.writeBool( + 4, + f + ); + } +}; + + +/** + * optional string consent_challenge = 1; + * @return {string} + */ +proto.programming_lab.prolab_accounts.OAuthConsentRequest.prototype.getConsentChallenge = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.programming_lab.prolab_accounts.OAuthConsentRequest.prototype.setConsentChallenge = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional bool accept = 2; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.programming_lab.prolab_accounts.OAuthConsentRequest.prototype.getAccept = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 2, false)); +}; + + +/** @param {boolean} value */ +proto.programming_lab.prolab_accounts.OAuthConsentRequest.prototype.setAccept = function(value) { + jspb.Message.setProto3BooleanField(this, 2, value); +}; + + +/** + * repeated string grant_scopes = 3; + * @return {!Array} + */ +proto.programming_lab.prolab_accounts.OAuthConsentRequest.prototype.getGrantScopesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** @param {!Array} value */ +proto.programming_lab.prolab_accounts.OAuthConsentRequest.prototype.setGrantScopesList = function(value) { + jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {!string} value + * @param {number=} opt_index + */ +proto.programming_lab.prolab_accounts.OAuthConsentRequest.prototype.addGrantScopes = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +proto.programming_lab.prolab_accounts.OAuthConsentRequest.prototype.clearGrantScopesList = function() { + this.setGrantScopesList([]); +}; + + +/** + * optional bool remember = 4; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.programming_lab.prolab_accounts.OAuthConsentRequest.prototype.getRemember = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 4, false)); +}; + + +/** @param {boolean} value */ +proto.programming_lab.prolab_accounts.OAuthConsentRequest.prototype.setRemember = function(value) { + jspb.Message.setProto3BooleanField(this, 4, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.programming_lab.prolab_accounts.OAuthConsentResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.programming_lab.prolab_accounts.OAuthConsentResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.programming_lab.prolab_accounts.OAuthConsentResponse.displayName = 'proto.programming_lab.prolab_accounts.OAuthConsentResponse'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.programming_lab.prolab_accounts.OAuthConsentResponse.prototype.toObject = function(opt_includeInstance) { + return proto.programming_lab.prolab_accounts.OAuthConsentResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.programming_lab.prolab_accounts.OAuthConsentResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.programming_lab.prolab_accounts.OAuthConsentResponse.toObject = function(includeInstance, msg) { + var f, obj = { + redirectUrl: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.programming_lab.prolab_accounts.OAuthConsentResponse} + */ +proto.programming_lab.prolab_accounts.OAuthConsentResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.programming_lab.prolab_accounts.OAuthConsentResponse; + return proto.programming_lab.prolab_accounts.OAuthConsentResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.programming_lab.prolab_accounts.OAuthConsentResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.programming_lab.prolab_accounts.OAuthConsentResponse} + */ +proto.programming_lab.prolab_accounts.OAuthConsentResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setRedirectUrl(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.programming_lab.prolab_accounts.OAuthConsentResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.programming_lab.prolab_accounts.OAuthConsentResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.programming_lab.prolab_accounts.OAuthConsentResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.programming_lab.prolab_accounts.OAuthConsentResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRedirectUrl(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string redirect_url = 1; + * @return {string} + */ +proto.programming_lab.prolab_accounts.OAuthConsentResponse.prototype.getRedirectUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.programming_lab.prolab_accounts.OAuthConsentResponse.prototype.setRedirectUrl = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +goog.object.extend(exports, proto.programming_lab.prolab_accounts); diff --git a/src/api/sessions_grpc_web_pb.js b/src/api/sessions_grpc_web_pb.js new file mode 100644 index 0000000..648f9b7 --- /dev/null +++ b/src/api/sessions_grpc_web_pb.js @@ -0,0 +1,252 @@ +/** + * @fileoverview gRPC-Web generated client stub for com.github.ProgrammingLab.prolab_accounts.api + * @enhanceable + * @public + */ + +// GENERATED CODE -- DO NOT EDIT! + + + +const grpc = {}; +grpc.web = require('grpc-web'); + + +var google_api_annotations_pb = require('./google/api/annotations_pb.js') + +var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js') +const proto = {}; +proto.com = {}; +proto.com.github = {}; +proto.com.github.ProgrammingLab = {}; +proto.com.github.ProgrammingLab.prolab_accounts = {}; +proto.com.github.ProgrammingLab.prolab_accounts.api = require('./sessions_pb.js'); + +/** + * @param {string} hostname + * @param {?Object} credentials + * @param {?Object} options + * @constructor + * @struct + * @final + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.SessionServiceClient = + function(hostname, credentials, options) { + if (!options) options = {}; + options['format'] = 'text'; + + /** + * @private @const {!grpc.web.GrpcWebClientBase} The client + */ + this.client_ = new grpc.web.GrpcWebClientBase(options); + + /** + * @private @const {string} The hostname + */ + this.hostname_ = hostname; + + /** + * @private @const {?Object} The credentials to be used to connect + * to the server + */ + this.credentials_ = credentials; + + /** + * @private @const {?Object} Options for the client + */ + this.options_ = options; +}; + + +/** + * @param {string} hostname + * @param {?Object} credentials + * @param {?Object} options + * @constructor + * @struct + * @final + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.SessionServicePromiseClient = + function(hostname, credentials, options) { + if (!options) options = {}; + options['format'] = 'text'; + + /** + * @private @const {!proto.com.github.ProgrammingLab.prolab_accounts.api.SessionServiceClient} The delegate callback based client + */ + this.delegateClient_ = new proto.com.github.ProgrammingLab.prolab_accounts.api.SessionServiceClient( + hostname, credentials, options); + +}; + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest, + * !proto.com.github.ProgrammingLab.prolab_accounts.api.Session>} + */ +const methodInfo_SessionService_GetSession = new grpc.web.AbstractClientBase.MethodInfo( + proto.com.github.ProgrammingLab.prolab_accounts.api.Session, + /** @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest} request */ + function(request) { + return request.serializeBinary(); + }, + proto.com.github.ProgrammingLab.prolab_accounts.api.Session.deserializeBinary +); + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.com.github.ProgrammingLab.prolab_accounts.api.Session)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.SessionServiceClient.prototype.getSession = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/com.github.ProgrammingLab.prolab_accounts.api.SessionService/GetSession', + request, + metadata, + methodInfo_SessionService_GetSession, + callback); +}; + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @return {!Promise} + * The XHR Node Readable Stream + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.SessionServicePromiseClient.prototype.getSession = + function(request, metadata) { + return new Promise((resolve, reject) => { + this.delegateClient_.getSession( + request, metadata, (error, response) => { + error ? reject(error) : resolve(response); + }); + }); +}; + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest, + * !proto.com.github.ProgrammingLab.prolab_accounts.api.Session>} + */ +const methodInfo_SessionService_CreateSession = new grpc.web.AbstractClientBase.MethodInfo( + proto.com.github.ProgrammingLab.prolab_accounts.api.Session, + /** @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest} request */ + function(request) { + return request.serializeBinary(); + }, + proto.com.github.ProgrammingLab.prolab_accounts.api.Session.deserializeBinary +); + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.com.github.ProgrammingLab.prolab_accounts.api.Session)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.SessionServiceClient.prototype.createSession = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/com.github.ProgrammingLab.prolab_accounts.api.SessionService/CreateSession', + request, + metadata, + methodInfo_SessionService_CreateSession, + callback); +}; + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @return {!Promise} + * The XHR Node Readable Stream + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.SessionServicePromiseClient.prototype.createSession = + function(request, metadata) { + return new Promise((resolve, reject) => { + this.delegateClient_.createSession( + request, metadata, (error, response) => { + error ? reject(error) : resolve(response); + }); + }); +}; + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest, + * !proto.google.protobuf.Empty>} + */ +const methodInfo_SessionService_DeleteSession = new grpc.web.AbstractClientBase.MethodInfo( + google_protobuf_empty_pb.Empty, + /** @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest} request */ + function(request) { + return request.serializeBinary(); + }, + google_protobuf_empty_pb.Empty.deserializeBinary +); + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.google.protobuf.Empty)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.SessionServiceClient.prototype.deleteSession = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/com.github.ProgrammingLab.prolab_accounts.api.SessionService/DeleteSession', + request, + metadata, + methodInfo_SessionService_DeleteSession, + callback); +}; + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @return {!Promise} + * The XHR Node Readable Stream + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.SessionServicePromiseClient.prototype.deleteSession = + function(request, metadata) { + return new Promise((resolve, reject) => { + this.delegateClient_.deleteSession( + request, metadata, (error, response) => { + error ? reject(error) : resolve(response); + }); + }); +}; + + +module.exports = proto.com.github.ProgrammingLab.prolab_accounts.api; + diff --git a/src/api/sessions_pb.js b/src/api/sessions_pb.js new file mode 100644 index 0000000..204b498 --- /dev/null +++ b/src/api/sessions_pb.js @@ -0,0 +1,563 @@ +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var google_api_annotations_pb = require('./google/api/annotations_pb.js'); +var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js'); +goog.exportSymbol('proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest', null, global); +goog.exportSymbol('proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest', null, global); +goog.exportSymbol('proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest', null, global); +goog.exportSymbol('proto.com.github.ProgrammingLab.prolab_accounts.api.Session', null, global); + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.Session = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.com.github.ProgrammingLab.prolab_accounts.api.Session, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.com.github.ProgrammingLab.prolab_accounts.api.Session.displayName = 'proto.com.github.ProgrammingLab.prolab_accounts.api.Session'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.Session.prototype.toObject = function(opt_includeInstance) { + return proto.com.github.ProgrammingLab.prolab_accounts.api.Session.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.Session} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.Session.toObject = function(includeInstance, msg) { + var f, obj = { + sessionId: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.Session} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.Session.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.com.github.ProgrammingLab.prolab_accounts.api.Session; + return proto.com.github.ProgrammingLab.prolab_accounts.api.Session.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.Session} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.Session} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.Session.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setSessionId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.Session.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.com.github.ProgrammingLab.prolab_accounts.api.Session.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.Session} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.Session.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSessionId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string session_id = 1; + * @return {string} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.Session.prototype.getSessionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.Session.prototype.setSessionId = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest.displayName = 'proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest.prototype.toObject = function(opt_includeInstance) { + return proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest; + return proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetSessionRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest.displayName = 'proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest.prototype.toObject = function(opt_includeInstance) { + return proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + password: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest; + return proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setPassword(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getPassword(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest.prototype.setName = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string password = 2; + * @return {string} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest.prototype.getPassword = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateSessionRequest.prototype.setPassword = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest.displayName = 'proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest.prototype.toObject = function(opt_includeInstance) { + return proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest; + return proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.DeleteSessionRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + +goog.object.extend(exports, proto.com.github.ProgrammingLab.prolab_accounts.api); diff --git a/src/api/type/client_pb.js b/src/api/type/client_pb.js new file mode 100644 index 0000000..d49bf6a --- /dev/null +++ b/src/api/type/client_pb.js @@ -0,0 +1,313 @@ +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +goog.exportSymbol('proto.programming_lab.prolab_accounts.type.Client', null, global); + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.programming_lab.prolab_accounts.type.Client = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.programming_lab.prolab_accounts.type.Client.repeatedFields_, null); +}; +goog.inherits(proto.programming_lab.prolab_accounts.type.Client, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.programming_lab.prolab_accounts.type.Client.displayName = 'proto.programming_lab.prolab_accounts.type.Client'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.programming_lab.prolab_accounts.type.Client.repeatedFields_ = [4]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.programming_lab.prolab_accounts.type.Client.prototype.toObject = function(opt_includeInstance) { + return proto.programming_lab.prolab_accounts.type.Client.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.programming_lab.prolab_accounts.type.Client} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.programming_lab.prolab_accounts.type.Client.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + uri: jspb.Message.getFieldWithDefault(msg, 3, ""), + contactsList: jspb.Message.getRepeatedField(msg, 4), + logoUri: jspb.Message.getFieldWithDefault(msg, 5, ""), + owner: jspb.Message.getFieldWithDefault(msg, 6, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.programming_lab.prolab_accounts.type.Client} + */ +proto.programming_lab.prolab_accounts.type.Client.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.programming_lab.prolab_accounts.type.Client; + return proto.programming_lab.prolab_accounts.type.Client.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.programming_lab.prolab_accounts.type.Client} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.programming_lab.prolab_accounts.type.Client} + */ +proto.programming_lab.prolab_accounts.type.Client.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setUri(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.addContacts(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setLogoUri(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setOwner(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.programming_lab.prolab_accounts.type.Client.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.programming_lab.prolab_accounts.type.Client.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.programming_lab.prolab_accounts.type.Client} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.programming_lab.prolab_accounts.type.Client.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getUri(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getContactsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 4, + f + ); + } + f = message.getLogoUri(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getOwner(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.programming_lab.prolab_accounts.type.Client.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.programming_lab.prolab_accounts.type.Client.prototype.setId = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.programming_lab.prolab_accounts.type.Client.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.programming_lab.prolab_accounts.type.Client.prototype.setName = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string uri = 3; + * @return {string} + */ +proto.programming_lab.prolab_accounts.type.Client.prototype.getUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +proto.programming_lab.prolab_accounts.type.Client.prototype.setUri = function(value) { + jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * repeated string contacts = 4; + * @return {!Array} + */ +proto.programming_lab.prolab_accounts.type.Client.prototype.getContactsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); +}; + + +/** @param {!Array} value */ +proto.programming_lab.prolab_accounts.type.Client.prototype.setContactsList = function(value) { + jspb.Message.setField(this, 4, value || []); +}; + + +/** + * @param {!string} value + * @param {number=} opt_index + */ +proto.programming_lab.prolab_accounts.type.Client.prototype.addContacts = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 4, value, opt_index); +}; + + +proto.programming_lab.prolab_accounts.type.Client.prototype.clearContactsList = function() { + this.setContactsList([]); +}; + + +/** + * optional string logo_uri = 5; + * @return {string} + */ +proto.programming_lab.prolab_accounts.type.Client.prototype.getLogoUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** @param {string} value */ +proto.programming_lab.prolab_accounts.type.Client.prototype.setLogoUri = function(value) { + jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string owner = 6; + * @return {string} + */ +proto.programming_lab.prolab_accounts.type.Client.prototype.getOwner = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** @param {string} value */ +proto.programming_lab.prolab_accounts.type.Client.prototype.setOwner = function(value) { + jspb.Message.setProto3StringField(this, 6, value); +}; + + +goog.object.extend(exports, proto.programming_lab.prolab_accounts.type); diff --git a/src/api/users_grpc_web_pb.js b/src/api/users_grpc_web_pb.js new file mode 100644 index 0000000..76f2730 --- /dev/null +++ b/src/api/users_grpc_web_pb.js @@ -0,0 +1,420 @@ +/** + * @fileoverview gRPC-Web generated client stub for com.github.ProgrammingLab.prolab_accounts.api + * @enhanceable + * @public + */ + +// GENERATED CODE -- DO NOT EDIT! + + + +const grpc = {}; +grpc.web = require('grpc-web'); + + +var google_api_annotations_pb = require('./google/api/annotations_pb.js') + +var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js') +const proto = {}; +proto.com = {}; +proto.com.github = {}; +proto.com.github.ProgrammingLab = {}; +proto.com.github.ProgrammingLab.prolab_accounts = {}; +proto.com.github.ProgrammingLab.prolab_accounts.api = require('./users_pb.js'); + +/** + * @param {string} hostname + * @param {?Object} credentials + * @param {?Object} options + * @constructor + * @struct + * @final + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UserServiceClient = + function(hostname, credentials, options) { + if (!options) options = {}; + options['format'] = 'text'; + + /** + * @private @const {!grpc.web.GrpcWebClientBase} The client + */ + this.client_ = new grpc.web.GrpcWebClientBase(options); + + /** + * @private @const {string} The hostname + */ + this.hostname_ = hostname; + + /** + * @private @const {?Object} The credentials to be used to connect + * to the server + */ + this.credentials_ = credentials; + + /** + * @private @const {?Object} Options for the client + */ + this.options_ = options; +}; + + +/** + * @param {string} hostname + * @param {?Object} credentials + * @param {?Object} options + * @constructor + * @struct + * @final + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UserServicePromiseClient = + function(hostname, credentials, options) { + if (!options) options = {}; + options['format'] = 'text'; + + /** + * @private @const {!proto.com.github.ProgrammingLab.prolab_accounts.api.UserServiceClient} The delegate callback based client + */ + this.delegateClient_ = new proto.com.github.ProgrammingLab.prolab_accounts.api.UserServiceClient( + hostname, credentials, options); + +}; + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest, + * !proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse>} + */ +const methodInfo_UserService_ListUsers = new grpc.web.AbstractClientBase.MethodInfo( + proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse, + /** @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest} request */ + function(request) { + return request.serializeBinary(); + }, + proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.deserializeBinary +); + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UserServiceClient.prototype.listUsers = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/com.github.ProgrammingLab.prolab_accounts.api.UserService/ListUsers', + request, + metadata, + methodInfo_UserService_ListUsers, + callback); +}; + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @return {!Promise} + * The XHR Node Readable Stream + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UserServicePromiseClient.prototype.listUsers = + function(request, metadata) { + return new Promise((resolve, reject) => { + this.delegateClient_.listUsers( + request, metadata, (error, response) => { + error ? reject(error) : resolve(response); + }); + }); +}; + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest, + * !proto.com.github.ProgrammingLab.prolab_accounts.api.User>} + */ +const methodInfo_UserService_GetUser = new grpc.web.AbstractClientBase.MethodInfo( + proto.com.github.ProgrammingLab.prolab_accounts.api.User, + /** @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest} request */ + function(request) { + return request.serializeBinary(); + }, + proto.com.github.ProgrammingLab.prolab_accounts.api.User.deserializeBinary +); + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.com.github.ProgrammingLab.prolab_accounts.api.User)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UserServiceClient.prototype.getUser = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/com.github.ProgrammingLab.prolab_accounts.api.UserService/GetUser', + request, + metadata, + methodInfo_UserService_GetUser, + callback); +}; + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @return {!Promise} + * The XHR Node Readable Stream + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UserServicePromiseClient.prototype.getUser = + function(request, metadata) { + return new Promise((resolve, reject) => { + this.delegateClient_.getUser( + request, metadata, (error, response) => { + error ? reject(error) : resolve(response); + }); + }); +}; + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest, + * !proto.com.github.ProgrammingLab.prolab_accounts.api.User>} + */ +const methodInfo_UserService_CreateUser = new grpc.web.AbstractClientBase.MethodInfo( + proto.com.github.ProgrammingLab.prolab_accounts.api.User, + /** @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest} request */ + function(request) { + return request.serializeBinary(); + }, + proto.com.github.ProgrammingLab.prolab_accounts.api.User.deserializeBinary +); + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.com.github.ProgrammingLab.prolab_accounts.api.User)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UserServiceClient.prototype.createUser = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/com.github.ProgrammingLab.prolab_accounts.api.UserService/CreateUser', + request, + metadata, + methodInfo_UserService_CreateUser, + callback); +}; + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @return {!Promise} + * The XHR Node Readable Stream + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UserServicePromiseClient.prototype.createUser = + function(request, metadata) { + return new Promise((resolve, reject) => { + this.delegateClient_.createUser( + request, metadata, (error, response) => { + error ? reject(error) : resolve(response); + }); + }); +}; + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest, + * !proto.com.github.ProgrammingLab.prolab_accounts.api.User>} + */ +const methodInfo_UserService_GetCurrentUser = new grpc.web.AbstractClientBase.MethodInfo( + proto.com.github.ProgrammingLab.prolab_accounts.api.User, + /** @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest} request */ + function(request) { + return request.serializeBinary(); + }, + proto.com.github.ProgrammingLab.prolab_accounts.api.User.deserializeBinary +); + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.com.github.ProgrammingLab.prolab_accounts.api.User)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UserServiceClient.prototype.getCurrentUser = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/com.github.ProgrammingLab.prolab_accounts.api.UserService/GetCurrentUser', + request, + metadata, + methodInfo_UserService_GetCurrentUser, + callback); +}; + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @return {!Promise} + * The XHR Node Readable Stream + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UserServicePromiseClient.prototype.getCurrentUser = + function(request, metadata) { + return new Promise((resolve, reject) => { + this.delegateClient_.getCurrentUser( + request, metadata, (error, response) => { + error ? reject(error) : resolve(response); + }); + }); +}; + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest, + * !proto.com.github.ProgrammingLab.prolab_accounts.api.User>} + */ +const methodInfo_UserService_UpdateUser = new grpc.web.AbstractClientBase.MethodInfo( + proto.com.github.ProgrammingLab.prolab_accounts.api.User, + /** @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest} request */ + function(request) { + return request.serializeBinary(); + }, + proto.com.github.ProgrammingLab.prolab_accounts.api.User.deserializeBinary +); + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.com.github.ProgrammingLab.prolab_accounts.api.User)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UserServiceClient.prototype.updateUser = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/com.github.ProgrammingLab.prolab_accounts.api.UserService/UpdateUser', + request, + metadata, + methodInfo_UserService_UpdateUser, + callback); +}; + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @return {!Promise} + * The XHR Node Readable Stream + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UserServicePromiseClient.prototype.updateUser = + function(request, metadata) { + return new Promise((resolve, reject) => { + this.delegateClient_.updateUser( + request, metadata, (error, response) => { + error ? reject(error) : resolve(response); + }); + }); +}; + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest, + * !proto.google.protobuf.Empty>} + */ +const methodInfo_UserService_UpdatePassword = new grpc.web.AbstractClientBase.MethodInfo( + google_protobuf_empty_pb.Empty, + /** @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest} request */ + function(request) { + return request.serializeBinary(); + }, + google_protobuf_empty_pb.Empty.deserializeBinary +); + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.google.protobuf.Empty)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UserServiceClient.prototype.updatePassword = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/com.github.ProgrammingLab.prolab_accounts.api.UserService/UpdatePassword', + request, + metadata, + methodInfo_UserService_UpdatePassword, + callback); +}; + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest} request The + * request proto + * @param {!Object} metadata User defined + * call metadata + * @return {!Promise} + * The XHR Node Readable Stream + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UserServicePromiseClient.prototype.updatePassword = + function(request, metadata) { + return new Promise((resolve, reject) => { + this.delegateClient_.updatePassword( + request, metadata, (error, response) => { + error ? reject(error) : resolve(response); + }); + }); +}; + + +module.exports = proto.com.github.ProgrammingLab.prolab_accounts.api; + diff --git a/src/api/users_pb.js b/src/api/users_pb.js new file mode 100644 index 0000000..a9c9a99 --- /dev/null +++ b/src/api/users_pb.js @@ -0,0 +1,1655 @@ +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var google_api_annotations_pb = require('./google/api/annotations_pb.js'); +var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js'); +goog.exportSymbol('proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest', null, global); +goog.exportSymbol('proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest', null, global); +goog.exportSymbol('proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest', null, global); +goog.exportSymbol('proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest', null, global); +goog.exportSymbol('proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse', null, global); +goog.exportSymbol('proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest', null, global); +goog.exportSymbol('proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest', null, global); +goog.exportSymbol('proto.com.github.ProgrammingLab.prolab_accounts.api.User', null, global); + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.com.github.ProgrammingLab.prolab_accounts.api.User, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.com.github.ProgrammingLab.prolab_accounts.api.User.displayName = 'proto.com.github.ProgrammingLab.prolab_accounts.api.User'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.toObject = function(opt_includeInstance) { + return proto.com.github.ProgrammingLab.prolab_accounts.api.User.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.User} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.toObject = function(includeInstance, msg) { + var f, obj = { + userId: jspb.Message.getFieldWithDefault(msg, 1, 0), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + email: jspb.Message.getFieldWithDefault(msg, 3, ""), + fullName: jspb.Message.getFieldWithDefault(msg, 4, ""), + avatarUrl: jspb.Message.getFieldWithDefault(msg, 5, ""), + description: jspb.Message.getFieldWithDefault(msg, 6, ""), + grade: jspb.Message.getFieldWithDefault(msg, 7, 0), + left: jspb.Message.getFieldWithDefault(msg, 8, false), + department: jspb.Message.getFieldWithDefault(msg, 9, ""), + shortDepartment: jspb.Message.getFieldWithDefault(msg, 10, ""), + role: jspb.Message.getFieldWithDefault(msg, 11, ""), + twitterScreenName: jspb.Message.getFieldWithDefault(msg, 12, ""), + githubUserName: jspb.Message.getFieldWithDefault(msg, 13, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.User} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.com.github.ProgrammingLab.prolab_accounts.api.User; + return proto.com.github.ProgrammingLab.prolab_accounts.api.User.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.User} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.User} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint32()); + msg.setUserId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setEmail(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setFullName(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setAvatarUrl(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setDescription(value); + break; + case 7: + var value = /** @type {number} */ (reader.readInt32()); + msg.setGrade(value); + break; + case 8: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setLeft(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.setDepartment(value); + break; + case 10: + var value = /** @type {string} */ (reader.readString()); + msg.setShortDepartment(value); + break; + case 11: + var value = /** @type {string} */ (reader.readString()); + msg.setRole(value); + break; + case 12: + var value = /** @type {string} */ (reader.readString()); + msg.setTwitterScreenName(value); + break; + case 13: + var value = /** @type {string} */ (reader.readString()); + msg.setGithubUserName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.com.github.ProgrammingLab.prolab_accounts.api.User.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.User} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUserId(); + if (f !== 0) { + writer.writeUint32( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getEmail(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getFullName(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getAvatarUrl(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getDescription(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getGrade(); + if (f !== 0) { + writer.writeInt32( + 7, + f + ); + } + f = message.getLeft(); + if (f) { + writer.writeBool( + 8, + f + ); + } + f = message.getDepartment(); + if (f.length > 0) { + writer.writeString( + 9, + f + ); + } + f = message.getShortDepartment(); + if (f.length > 0) { + writer.writeString( + 10, + f + ); + } + f = message.getRole(); + if (f.length > 0) { + writer.writeString( + 11, + f + ); + } + f = message.getTwitterScreenName(); + if (f.length > 0) { + writer.writeString( + 12, + f + ); + } + f = message.getGithubUserName(); + if (f.length > 0) { + writer.writeString( + 13, + f + ); + } +}; + + +/** + * optional uint32 user_id = 1; + * @return {number} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.getUserId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.setUserId = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.setName = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string email = 3; + * @return {string} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.getEmail = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.setEmail = function(value) { + jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string full_name = 4; + * @return {string} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.getFullName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** @param {string} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.setFullName = function(value) { + jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string avatar_url = 5; + * @return {string} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.getAvatarUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** @param {string} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.setAvatarUrl = function(value) { + jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string description = 6; + * @return {string} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.getDescription = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** @param {string} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.setDescription = function(value) { + jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional int32 grade = 7; + * @return {number} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.getGrade = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); +}; + + +/** @param {number} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.setGrade = function(value) { + jspb.Message.setProto3IntField(this, 7, value); +}; + + +/** + * optional bool left = 8; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.getLeft = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 8, false)); +}; + + +/** @param {boolean} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.setLeft = function(value) { + jspb.Message.setProto3BooleanField(this, 8, value); +}; + + +/** + * optional string department = 9; + * @return {string} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.getDepartment = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** @param {string} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.setDepartment = function(value) { + jspb.Message.setProto3StringField(this, 9, value); +}; + + +/** + * optional string short_department = 10; + * @return {string} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.getShortDepartment = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, "")); +}; + + +/** @param {string} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.setShortDepartment = function(value) { + jspb.Message.setProto3StringField(this, 10, value); +}; + + +/** + * optional string role = 11; + * @return {string} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.getRole = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); +}; + + +/** @param {string} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.setRole = function(value) { + jspb.Message.setProto3StringField(this, 11, value); +}; + + +/** + * optional string twitter_screen_name = 12; + * @return {string} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.getTwitterScreenName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 12, "")); +}; + + +/** @param {string} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.setTwitterScreenName = function(value) { + jspb.Message.setProto3StringField(this, 12, value); +}; + + +/** + * optional string github_user_name = 13; + * @return {string} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.getGithubUserName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 13, "")); +}; + + +/** @param {string} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.User.prototype.setGithubUserName = function(value) { + jspb.Message.setProto3StringField(this, 13, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest.displayName = 'proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest.prototype.toObject = function(opt_includeInstance) { + return proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest.toObject = function(includeInstance, msg) { + var f, obj = { + pageToken: jspb.Message.getFieldWithDefault(msg, 1, 0), + pageSize: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest; + return proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint32()); + msg.setPageToken(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt32()); + msg.setPageSize(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPageToken(); + if (f !== 0) { + writer.writeUint32( + 1, + f + ); + } + f = message.getPageSize(); + if (f !== 0) { + writer.writeInt32( + 2, + f + ); + } +}; + + +/** + * optional uint32 page_token = 1; + * @return {number} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest.prototype.getPageToken = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest.prototype.setPageToken = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional int32 page_size = 2; + * @return {number} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest.prototype.getPageSize = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersRequest.prototype.setPageSize = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.repeatedFields_, null); +}; +goog.inherits(proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.displayName = 'proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.prototype.toObject = function(opt_includeInstance) { + return proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.toObject = function(includeInstance, msg) { + var f, obj = { + usersList: jspb.Message.toObjectList(msg.getUsersList(), + proto.com.github.ProgrammingLab.prolab_accounts.api.User.toObject, includeInstance), + nextPageToken: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse; + return proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.com.github.ProgrammingLab.prolab_accounts.api.User; + reader.readMessage(value,proto.com.github.ProgrammingLab.prolab_accounts.api.User.deserializeBinaryFromReader); + msg.addUsers(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint32()); + msg.setNextPageToken(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUsersList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.com.github.ProgrammingLab.prolab_accounts.api.User.serializeBinaryToWriter + ); + } + f = message.getNextPageToken(); + if (f !== 0) { + writer.writeUint32( + 2, + f + ); + } +}; + + +/** + * repeated User users = 1; + * @return {!Array} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.prototype.getUsersList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.com.github.ProgrammingLab.prolab_accounts.api.User, 1)); +}; + + +/** @param {!Array} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.prototype.setUsersList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.User=} opt_value + * @param {number=} opt_index + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.User} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.prototype.addUsers = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.com.github.ProgrammingLab.prolab_accounts.api.User, opt_index); +}; + + +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.prototype.clearUsersList = function() { + this.setUsersList([]); +}; + + +/** + * optional uint32 next_page_token = 2; + * @return {number} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.prototype.getNextPageToken = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.ListUsersResponse.prototype.setNextPageToken = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest.displayName = 'proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest.prototype.toObject = function(opt_includeInstance) { + return proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest.toObject = function(includeInstance, msg) { + var f, obj = { + userId: jspb.Message.getFieldWithDefault(msg, 1, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest; + return proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint32()); + msg.setUserId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUserId(); + if (f !== 0) { + writer.writeUint32( + 1, + f + ); + } +}; + + +/** + * optional uint32 user_id = 1; + * @return {number} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest.prototype.getUserId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetUserRequest.prototype.setUserId = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest.displayName = 'proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest.prototype.toObject = function(opt_includeInstance) { + return proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest.toObject = function(includeInstance, msg) { + var f, obj = { + user: (f = msg.getUser()) && proto.com.github.ProgrammingLab.prolab_accounts.api.User.toObject(includeInstance, f), + registerationToken: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest; + return proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.com.github.ProgrammingLab.prolab_accounts.api.User; + reader.readMessage(value,proto.com.github.ProgrammingLab.prolab_accounts.api.User.deserializeBinaryFromReader); + msg.setUser(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setRegisterationToken(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUser(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.com.github.ProgrammingLab.prolab_accounts.api.User.serializeBinaryToWriter + ); + } + f = message.getRegisterationToken(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional User user = 1; + * @return {?proto.com.github.ProgrammingLab.prolab_accounts.api.User} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest.prototype.getUser = function() { + return /** @type{?proto.com.github.ProgrammingLab.prolab_accounts.api.User} */ ( + jspb.Message.getWrapperField(this, proto.com.github.ProgrammingLab.prolab_accounts.api.User, 1)); +}; + + +/** @param {?proto.com.github.ProgrammingLab.prolab_accounts.api.User|undefined} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest.prototype.setUser = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest.prototype.clearUser = function() { + this.setUser(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest.prototype.hasUser = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string registeration_token = 2; + * @return {string} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest.prototype.getRegisterationToken = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.CreateUserRequest.prototype.setRegisterationToken = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest.displayName = 'proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest.prototype.toObject = function(opt_includeInstance) { + return proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest; + return proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.GetCurrentUserRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest.displayName = 'proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest.prototype.toObject = function(opt_includeInstance) { + return proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest.toObject = function(includeInstance, msg) { + var f, obj = { + user: (f = msg.getUser()) && proto.com.github.ProgrammingLab.prolab_accounts.api.User.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest; + return proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.com.github.ProgrammingLab.prolab_accounts.api.User; + reader.readMessage(value,proto.com.github.ProgrammingLab.prolab_accounts.api.User.deserializeBinaryFromReader); + msg.setUser(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUser(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.com.github.ProgrammingLab.prolab_accounts.api.User.serializeBinaryToWriter + ); + } +}; + + +/** + * optional User user = 1; + * @return {?proto.com.github.ProgrammingLab.prolab_accounts.api.User} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest.prototype.getUser = function() { + return /** @type{?proto.com.github.ProgrammingLab.prolab_accounts.api.User} */ ( + jspb.Message.getWrapperField(this, proto.com.github.ProgrammingLab.prolab_accounts.api.User, 1)); +}; + + +/** @param {?proto.com.github.ProgrammingLab.prolab_accounts.api.User|undefined} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest.prototype.setUser = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest.prototype.clearUser = function() { + this.setUser(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdateUserRequest.prototype.hasUser = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest.displayName = 'proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest.prototype.toObject = function(opt_includeInstance) { + return proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest.toObject = function(includeInstance, msg) { + var f, obj = { + password: jspb.Message.getFieldWithDefault(msg, 1, ""), + newPassword: jspb.Message.getFieldWithDefault(msg, 2, ""), + newPasswordRepeat: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest; + return proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setPassword(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setNewPassword(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setNewPasswordRepeat(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPassword(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getNewPassword(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getNewPasswordRepeat(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string password = 1; + * @return {string} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest.prototype.getPassword = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest.prototype.setPassword = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string new_password = 2; + * @return {string} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest.prototype.getNewPassword = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest.prototype.setNewPassword = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string new_password_repeat = 3; + * @return {string} + */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest.prototype.getNewPasswordRepeat = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +proto.com.github.ProgrammingLab.prolab_accounts.api.UpdatePasswordRequest.prototype.setNewPasswordRepeat = function(value) { + jspb.Message.setProto3StringField(this, 3, value); +}; + + +goog.object.extend(exports, proto.com.github.ProgrammingLab.prolab_accounts.api);