19 | getRulesList();
20 | /**
21 | *
22 | * A list of HTTP configuration rules that apply to individual API methods.
23 | * **NOTE:** All service configuration rules follow "last one wins" order.
24 | *
25 | *
26 | * repeated .google.api.HttpRule rules = 1;
27 | */
28 | com.google.api.HttpRule getRules(int index);
29 | /**
30 | *
31 | * A list of HTTP configuration rules that apply to individual API methods.
32 | * **NOTE:** All service configuration rules follow "last one wins" order.
33 | *
34 | *
35 | * repeated .google.api.HttpRule rules = 1;
36 | */
37 | int getRulesCount();
38 | /**
39 | *
40 | * A list of HTTP configuration rules that apply to individual API methods.
41 | * **NOTE:** All service configuration rules follow "last one wins" order.
42 | *
43 | *
44 | * repeated .google.api.HttpRule rules = 1;
45 | */
46 | java.util.List extends com.google.api.HttpRuleOrBuilder>
47 | getRulesOrBuilderList();
48 | /**
49 | *
50 | * A list of HTTP configuration rules that apply to individual API methods.
51 | * **NOTE:** All service configuration rules follow "last one wins" order.
52 | *
53 | *
54 | * repeated .google.api.HttpRule rules = 1;
55 | */
56 | com.google.api.HttpRuleOrBuilder getRulesOrBuilder(
57 | int index);
58 | }
59 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/com/google/api/HttpProto.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: google/api/http.proto
3 |
4 | package com.google.api;
5 |
6 | public final class HttpProto {
7 | private HttpProto() {}
8 | public static void registerAllExtensions(
9 | com.google.protobuf.ExtensionRegistryLite registry) {
10 | }
11 |
12 | public static void registerAllExtensions(
13 | com.google.protobuf.ExtensionRegistry registry) {
14 | registerAllExtensions(
15 | (com.google.protobuf.ExtensionRegistryLite) registry);
16 | }
17 | static final com.google.protobuf.Descriptors.Descriptor
18 | internal_static_google_api_Http_descriptor;
19 | static final
20 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
21 | internal_static_google_api_Http_fieldAccessorTable;
22 | static final com.google.protobuf.Descriptors.Descriptor
23 | internal_static_google_api_HttpRule_descriptor;
24 | static final
25 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
26 | internal_static_google_api_HttpRule_fieldAccessorTable;
27 | static final com.google.protobuf.Descriptors.Descriptor
28 | internal_static_google_api_CustomHttpPattern_descriptor;
29 | static final
30 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
31 | internal_static_google_api_CustomHttpPattern_fieldAccessorTable;
32 |
33 | public static com.google.protobuf.Descriptors.FileDescriptor
34 | getDescriptor() {
35 | return descriptor;
36 | }
37 | private static com.google.protobuf.Descriptors.FileDescriptor
38 | descriptor;
39 | static {
40 | java.lang.String[] descriptorData = {
41 | "\n\025google/api/http.proto\022\ngoogle.api\"+\n\004H" +
42 | "ttp\022#\n\005rules\030\001 \003(\0132\024.google.api.HttpRule" +
43 | "\"\352\001\n\010HttpRule\022\020\n\010selector\030\001 \001(\t\022\r\n\003get\030\002" +
44 | " \001(\tH\000\022\r\n\003put\030\003 \001(\tH\000\022\016\n\004post\030\004 \001(\tH\000\022\020\n" +
45 | "\006delete\030\005 \001(\tH\000\022\017\n\005patch\030\006 \001(\tH\000\022/\n\006cust" +
46 | "om\030\010 \001(\0132\035.google.api.CustomHttpPatternH" +
47 | "\000\022\014\n\004body\030\007 \001(\t\0221\n\023additional_bindings\030\013" +
48 | " \003(\0132\024.google.api.HttpRuleB\t\n\007pattern\"/\n" +
49 | "\021CustomHttpPattern\022\014\n\004kind\030\001 \001(\t\022\014\n\004path" +
50 | "\030\002 \001(\tBj\n\016com.google.apiB\tHttpProtoP\001ZAg" +
51 | "oogle.golang.org/genproto/googleapis/api" +
52 | "/annotations;annotations\370\001\001\242\002\004GAPIb\006prot" +
53 | "o3"
54 | };
55 | com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
56 | new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
57 | public com.google.protobuf.ExtensionRegistry assignDescriptors(
58 | com.google.protobuf.Descriptors.FileDescriptor root) {
59 | descriptor = root;
60 | return null;
61 | }
62 | };
63 | com.google.protobuf.Descriptors.FileDescriptor
64 | .internalBuildGeneratedFileFrom(descriptorData,
65 | new com.google.protobuf.Descriptors.FileDescriptor[] {
66 | }, assigner);
67 | internal_static_google_api_Http_descriptor =
68 | getDescriptor().getMessageTypes().get(0);
69 | internal_static_google_api_Http_fieldAccessorTable = new
70 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
71 | internal_static_google_api_Http_descriptor,
72 | new java.lang.String[] { "Rules", });
73 | internal_static_google_api_HttpRule_descriptor =
74 | getDescriptor().getMessageTypes().get(1);
75 | internal_static_google_api_HttpRule_fieldAccessorTable = new
76 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
77 | internal_static_google_api_HttpRule_descriptor,
78 | new java.lang.String[] { "Selector", "Get", "Put", "Post", "Delete", "Patch", "Custom", "Body", "AdditionalBindings", "Pattern", });
79 | internal_static_google_api_CustomHttpPattern_descriptor =
80 | getDescriptor().getMessageTypes().get(2);
81 | internal_static_google_api_CustomHttpPattern_fieldAccessorTable = new
82 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
83 | internal_static_google_api_CustomHttpPattern_descriptor,
84 | new java.lang.String[] { "Kind", "Path", });
85 | }
86 |
87 | // @@protoc_insertion_point(outer_class_scope)
88 | }
89 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/com/google/api/HttpRuleOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: google/api/http.proto
3 |
4 | package com.google.api;
5 |
6 | public interface HttpRuleOrBuilder extends
7 | // @@protoc_insertion_point(interface_extends:google.api.HttpRule)
8 | com.google.protobuf.MessageOrBuilder {
9 |
10 | /**
11 | *
12 | * Selects methods to which this rule applies.
13 | * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
14 | *
15 | *
16 | * string selector = 1;
17 | */
18 | java.lang.String getSelector();
19 | /**
20 | *
21 | * Selects methods to which this rule applies.
22 | * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
23 | *
24 | *
25 | * string selector = 1;
26 | */
27 | com.google.protobuf.ByteString
28 | getSelectorBytes();
29 |
30 | /**
31 | *
32 | * Used for listing and getting information about resources.
33 | *
34 | *
35 | * string get = 2;
36 | */
37 | java.lang.String getGet();
38 | /**
39 | *
40 | * Used for listing and getting information about resources.
41 | *
42 | *
43 | * string get = 2;
44 | */
45 | com.google.protobuf.ByteString
46 | getGetBytes();
47 |
48 | /**
49 | *
50 | * Used for updating a resource.
51 | *
52 | *
53 | * string put = 3;
54 | */
55 | java.lang.String getPut();
56 | /**
57 | *
58 | * Used for updating a resource.
59 | *
60 | *
61 | * string put = 3;
62 | */
63 | com.google.protobuf.ByteString
64 | getPutBytes();
65 |
66 | /**
67 | *
68 | * Used for creating a resource.
69 | *
70 | *
71 | * string post = 4;
72 | */
73 | java.lang.String getPost();
74 | /**
75 | *
76 | * Used for creating a resource.
77 | *
78 | *
79 | * string post = 4;
80 | */
81 | com.google.protobuf.ByteString
82 | getPostBytes();
83 |
84 | /**
85 | *
86 | * Used for deleting a resource.
87 | *
88 | *
89 | * string delete = 5;
90 | */
91 | java.lang.String getDelete();
92 | /**
93 | *
94 | * Used for deleting a resource.
95 | *
96 | *
97 | * string delete = 5;
98 | */
99 | com.google.protobuf.ByteString
100 | getDeleteBytes();
101 |
102 | /**
103 | *
104 | * Used for updating a resource.
105 | *
106 | *
107 | * string patch = 6;
108 | */
109 | java.lang.String getPatch();
110 | /**
111 | *
112 | * Used for updating a resource.
113 | *
114 | *
115 | * string patch = 6;
116 | */
117 | com.google.protobuf.ByteString
118 | getPatchBytes();
119 |
120 | /**
121 | *
122 | * Custom pattern is used for defining custom verbs.
123 | *
124 | *
125 | * .google.api.CustomHttpPattern custom = 8;
126 | */
127 | boolean hasCustom();
128 | /**
129 | *
130 | * Custom pattern is used for defining custom verbs.
131 | *
132 | *
133 | * .google.api.CustomHttpPattern custom = 8;
134 | */
135 | com.google.api.CustomHttpPattern getCustom();
136 | /**
137 | *
138 | * Custom pattern is used for defining custom verbs.
139 | *
140 | *
141 | * .google.api.CustomHttpPattern custom = 8;
142 | */
143 | com.google.api.CustomHttpPatternOrBuilder getCustomOrBuilder();
144 |
145 | /**
146 | *
147 | * The name of the request field whose value is mapped to the HTTP body, or
148 | * `*` for mapping all fields not captured by the path pattern to the HTTP
149 | * body. NOTE: the referred field must not be a repeated field and must be
150 | * present at the top-level of request message type.
151 | *
152 | *
153 | * string body = 7;
154 | */
155 | java.lang.String getBody();
156 | /**
157 | *
158 | * The name of the request field whose value is mapped to the HTTP body, or
159 | * `*` for mapping all fields not captured by the path pattern to the HTTP
160 | * body. NOTE: the referred field must not be a repeated field and must be
161 | * present at the top-level of request message type.
162 | *
163 | *
164 | * string body = 7;
165 | */
166 | com.google.protobuf.ByteString
167 | getBodyBytes();
168 |
169 | /**
170 | *
171 | * Additional HTTP bindings for the selector. Nested bindings must
172 | * not contain an `additional_bindings` field themselves (that is,
173 | * the nesting may only be one level deep).
174 | *
175 | *
176 | * repeated .google.api.HttpRule additional_bindings = 11;
177 | */
178 | java.util.List
179 | getAdditionalBindingsList();
180 | /**
181 | *
182 | * Additional HTTP bindings for the selector. Nested bindings must
183 | * not contain an `additional_bindings` field themselves (that is,
184 | * the nesting may only be one level deep).
185 | *
186 | *
187 | * repeated .google.api.HttpRule additional_bindings = 11;
188 | */
189 | com.google.api.HttpRule getAdditionalBindings(int index);
190 | /**
191 | *
192 | * Additional HTTP bindings for the selector. Nested bindings must
193 | * not contain an `additional_bindings` field themselves (that is,
194 | * the nesting may only be one level deep).
195 | *
196 | *
197 | * repeated .google.api.HttpRule additional_bindings = 11;
198 | */
199 | int getAdditionalBindingsCount();
200 | /**
201 | *
202 | * Additional HTTP bindings for the selector. Nested bindings must
203 | * not contain an `additional_bindings` field themselves (that is,
204 | * the nesting may only be one level deep).
205 | *
206 | *
207 | * repeated .google.api.HttpRule additional_bindings = 11;
208 | */
209 | java.util.List extends com.google.api.HttpRuleOrBuilder>
210 | getAdditionalBindingsOrBuilderList();
211 | /**
212 | *
213 | * Additional HTTP bindings for the selector. Nested bindings must
214 | * not contain an `additional_bindings` field themselves (that is,
215 | * the nesting may only be one level deep).
216 | *
217 | *
218 | * repeated .google.api.HttpRule additional_bindings = 11;
219 | */
220 | com.google.api.HttpRuleOrBuilder getAdditionalBindingsOrBuilder(
221 | int index);
222 |
223 | public com.google.api.HttpRule.PatternCase getPatternCase();
224 | }
225 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/com/google/protobuf/FieldMaskOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: google/protobuf/xfield_mask.proto
3 |
4 | package com.google.protobuf;
5 |
6 | public interface FieldMaskOrBuilder extends
7 | // @@protoc_insertion_point(interface_extends:google.protobuf.FieldMask)
8 | com.google.protobuf.MessageOrBuilder {
9 |
10 | /**
11 | *
12 | * The set of field mask paths.
13 | *
14 | *
15 | * repeated string paths = 1;
16 | */
17 | java.util.List
18 | getPathsList();
19 | /**
20 | *
21 | * The set of field mask paths.
22 | *
23 | *
24 | * repeated string paths = 1;
25 | */
26 | int getPathsCount();
27 | /**
28 | *
29 | * The set of field mask paths.
30 | *
31 | *
32 | * repeated string paths = 1;
33 | */
34 | java.lang.String getPaths(int index);
35 | /**
36 | *
37 | * The set of field mask paths.
38 | *
39 | *
40 | * repeated string paths = 1;
41 | */
42 | com.google.protobuf.ByteString
43 | getPathsBytes(int index);
44 | }
45 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/com/google/protobuf/FieldMaskProto.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: google/protobuf/xfield_mask.proto
3 |
4 | package com.google.protobuf;
5 |
6 | public final class FieldMaskProto {
7 | private FieldMaskProto() {}
8 | public static void registerAllExtensions(
9 | com.google.protobuf.ExtensionRegistryLite registry) {
10 | }
11 |
12 | public static void registerAllExtensions(
13 | com.google.protobuf.ExtensionRegistry registry) {
14 | registerAllExtensions(
15 | (com.google.protobuf.ExtensionRegistryLite) registry);
16 | }
17 | static final com.google.protobuf.Descriptors.Descriptor
18 | internal_static_google_protobuf_FieldMask_descriptor;
19 | static final
20 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
21 | internal_static_google_protobuf_FieldMask_fieldAccessorTable;
22 |
23 | public static com.google.protobuf.Descriptors.FileDescriptor
24 | getDescriptor() {
25 | return descriptor;
26 | }
27 | private static com.google.protobuf.Descriptors.FileDescriptor
28 | descriptor;
29 | static {
30 | java.lang.String[] descriptorData = {
31 | "\n!google/protobuf/xfield_mask.proto\022\017goo" +
32 | "gle.protobuf\"\032\n\tFieldMask\022\r\n\005paths\030\001 \003(\t" +
33 | "B\211\001\n\023com.google.protobufB\016FieldMaskProto" +
34 | "P\001Z9google.golang.org/genproto/protobuf/" +
35 | "field_mask;field_mask\242\002\003GPB\252\002\036Google.Pro" +
36 | "tobuf.WellKnownTypesb\006proto3"
37 | };
38 | com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
39 | new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
40 | public com.google.protobuf.ExtensionRegistry assignDescriptors(
41 | com.google.protobuf.Descriptors.FileDescriptor root) {
42 | descriptor = root;
43 | return null;
44 | }
45 | };
46 | com.google.protobuf.Descriptors.FileDescriptor
47 | .internalBuildGeneratedFileFrom(descriptorData,
48 | new com.google.protobuf.Descriptors.FileDescriptor[] {
49 | }, assigner);
50 | internal_static_google_protobuf_FieldMask_descriptor =
51 | getDescriptor().getMessageTypes().get(0);
52 | internal_static_google_protobuf_FieldMask_fieldAccessorTable = new
53 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
54 | internal_static_google_protobuf_FieldMask_descriptor,
55 | new java.lang.String[] { "Paths", });
56 | }
57 |
58 | // @@protoc_insertion_point(outer_class_scope)
59 | }
60 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/com/proto/dummy/Dummy.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: dummy.proto
3 |
4 | package com.proto.dummy;
5 |
6 | public final class Dummy {
7 | private Dummy() {}
8 | public static void registerAllExtensions(
9 | com.google.protobuf.ExtensionRegistryLite registry) {
10 | }
11 |
12 | public static void registerAllExtensions(
13 | com.google.protobuf.ExtensionRegistry registry) {
14 | registerAllExtensions(
15 | (com.google.protobuf.ExtensionRegistryLite) registry);
16 | }
17 | static final com.google.protobuf.Descriptors.Descriptor
18 | internal_static_dummy_DummyMessage_descriptor;
19 | static final
20 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
21 | internal_static_dummy_DummyMessage_fieldAccessorTable;
22 |
23 | public static com.google.protobuf.Descriptors.FileDescriptor
24 | getDescriptor() {
25 | return descriptor;
26 | }
27 | private static com.google.protobuf.Descriptors.FileDescriptor
28 | descriptor;
29 | static {
30 | java.lang.String[] descriptorData = {
31 | "\n\013dummy.proto\022\005dummy\"\016\n\014DummyMessage2\016\n\014" +
32 | "DummyServiceB\023\n\017com.proto.dummyP\001b\006proto" +
33 | "3"
34 | };
35 | com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
36 | new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
37 | public com.google.protobuf.ExtensionRegistry assignDescriptors(
38 | com.google.protobuf.Descriptors.FileDescriptor root) {
39 | descriptor = root;
40 | return null;
41 | }
42 | };
43 | com.google.protobuf.Descriptors.FileDescriptor
44 | .internalBuildGeneratedFileFrom(descriptorData,
45 | new com.google.protobuf.Descriptors.FileDescriptor[] {
46 | }, assigner);
47 | internal_static_dummy_DummyMessage_descriptor =
48 | getDescriptor().getMessageTypes().get(0);
49 | internal_static_dummy_DummyMessage_fieldAccessorTable = new
50 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
51 | internal_static_dummy_DummyMessage_descriptor,
52 | new java.lang.String[] { });
53 | }
54 |
55 | // @@protoc_insertion_point(outer_class_scope)
56 | }
57 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/com/proto/dummy/DummyMessageOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: dummy.proto
3 |
4 | package com.proto.dummy;
5 |
6 | public interface DummyMessageOrBuilder extends
7 | // @@protoc_insertion_point(interface_extends:dummy.DummyMessage)
8 | com.google.protobuf.MessageOrBuilder {
9 | }
10 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/contactsapi/company/Companies.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: contactsapi/company/companies.proto
3 |
4 | package contactsapi.company;
5 |
6 | public final class Companies {
7 | private Companies() {}
8 | public static void registerAllExtensions(
9 | com.google.protobuf.ExtensionRegistryLite registry) {
10 | }
11 |
12 | public static void registerAllExtensions(
13 | com.google.protobuf.ExtensionRegistry registry) {
14 | registerAllExtensions(
15 | (com.google.protobuf.ExtensionRegistryLite) registry);
16 | }
17 | static final com.google.protobuf.Descriptors.Descriptor
18 | internal_static_contactsapi_company_CreateCompanyRequest_descriptor;
19 | static final
20 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
21 | internal_static_contactsapi_company_CreateCompanyRequest_fieldAccessorTable;
22 | static final com.google.protobuf.Descriptors.Descriptor
23 | internal_static_contactsapi_company_GetCompanyRequest_descriptor;
24 | static final
25 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
26 | internal_static_contactsapi_company_GetCompanyRequest_fieldAccessorTable;
27 | static final com.google.protobuf.Descriptors.Descriptor
28 | internal_static_contactsapi_company_ListCompaniesRequest_descriptor;
29 | static final
30 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
31 | internal_static_contactsapi_company_ListCompaniesRequest_fieldAccessorTable;
32 | static final com.google.protobuf.Descriptors.Descriptor
33 | internal_static_contactsapi_company_GetCompaniesRequest_descriptor;
34 | static final
35 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
36 | internal_static_contactsapi_company_GetCompaniesRequest_fieldAccessorTable;
37 | static final com.google.protobuf.Descriptors.Descriptor
38 | internal_static_contactsapi_company_UpdateCompanyRequest_descriptor;
39 | static final
40 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
41 | internal_static_contactsapi_company_UpdateCompanyRequest_fieldAccessorTable;
42 | static final com.google.protobuf.Descriptors.Descriptor
43 | internal_static_contactsapi_company_DeleteCompanyRequest_descriptor;
44 | static final
45 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
46 | internal_static_contactsapi_company_DeleteCompanyRequest_fieldAccessorTable;
47 | static final com.google.protobuf.Descriptors.Descriptor
48 | internal_static_contactsapi_company_CompanyResponse_descriptor;
49 | static final
50 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
51 | internal_static_contactsapi_company_CompanyResponse_fieldAccessorTable;
52 | static final com.google.protobuf.Descriptors.Descriptor
53 | internal_static_contactsapi_company_ListCompaniesResponse_descriptor;
54 | static final
55 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
56 | internal_static_contactsapi_company_ListCompaniesResponse_fieldAccessorTable;
57 |
58 | public static com.google.protobuf.Descriptors.FileDescriptor
59 | getDescriptor() {
60 | return descriptor;
61 | }
62 | private static com.google.protobuf.Descriptors.FileDescriptor
63 | descriptor;
64 | static {
65 | java.lang.String[] descriptorData = {
66 | "\n#contactsapi/company/companies.proto\022\023c" +
67 | "ontactsapi.company\032\034google/api/annotatio" +
68 | "ns.proto\032\033google/protobuf/empty.proto\032 g" +
69 | "oogle/protobuf/field_mask.proto\"T\n\024Creat" +
70 | "eCompanyRequest\022\014\n\004name\030\001 \001(\t\022.\n\nfield_m" +
71 | "ask\030\002 \001(\0132\032.google.protobuf.FieldMask\"O\n" +
72 | "\021GetCompanyRequest\022\n\n\002id\030\001 \001(\t\022.\n\nfield_" +
73 | "mask\030\002 \001(\0132\032.google.protobuf.FieldMask\"F" +
74 | "\n\024ListCompaniesRequest\022.\n\nfield_mask\030\002 \001" +
75 | "(\0132\032.google.protobuf.FieldMask\"l\n\023GetCom" +
76 | "paniesRequest\022\022\n\npage_token\030\001 \001(\t\022\021\n\tpag" +
77 | "e_size\030\002 \001(\005\022.\n\nfield_mask\030\003 \001(\0132\032.googl" +
78 | "e.protobuf.FieldMask\"a\n\024UpdateCompanyReq" +
79 | "uest\022\n\n\002id\030\001 \001(\t\022\014\n\004name\030\002 \001(\t\022/\n\013update" +
80 | "_mask\030\003 \001(\0132\032.google.protobuf.FieldMask\"" +
81 | "\"\n\024DeleteCompanyRequest\022\n\n\002id\030\001 \001(\t\"<\n\017C" +
82 | "ompanyResponse\022\n\n\002id\030\001 \001(\t\022\014\n\004name\030\002 \001(\t" +
83 | "\022\017\n\007version\030\003 \001(\005\"x\n\025ListCompaniesRespon" +
84 | "se\0227\n\tcompanies\030\001 \003(\0132$.contactsapi.comp" +
85 | "any.CompanyResponse\022\027\n\017next_page_token\030\002" +
86 | " \001(\t\022\r\n\005count\030\003 \001(\0052\361\004\n\016CompanyService\022z" +
87 | "\n\rCreateCompany\022).contactsapi.company.Cr" +
88 | "eateCompanyRequest\032$.contactsapi.company" +
89 | ".CompanyResponse\"\030\202\323\344\223\002\022\"\r/v1/companies:" +
90 | "\001*\022v\n\nGetCompany\022&.contactsapi.company.G" +
91 | "etCompanyRequest\032$.contactsapi.company.C" +
92 | "ompanyResponse\"\032\202\323\344\223\002\024\022\022/v1/companies/{i" +
93 | "d}\022}\n\rListCompanies\022).contactsapi.compan" +
94 | "y.ListCompaniesRequest\032*.contactsapi.com" +
95 | "pany.ListCompaniesResponse\"\025\202\323\344\223\002\017\022\r/v1/" +
96 | "companies\022|\n\rUpdateCompany\022).contactsapi" +
97 | ".company.UpdateCompanyRequest\032$.contacts" +
98 | "api.company.CompanyResponse\"\032\202\323\344\223\002\024\022\022/v1" +
99 | "/companies/{id}\022n\n\rDeleteCompany\022).conta" +
100 | "ctsapi.company.DeleteCompanyRequest\032\026.go" +
101 | "ogle.protobuf.Empty\"\032\202\323\344\223\002\024*\022/v1/compani" +
102 | "es/{id}B\002P\001b\006proto3"
103 | };
104 | com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
105 | new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
106 | public com.google.protobuf.ExtensionRegistry assignDescriptors(
107 | com.google.protobuf.Descriptors.FileDescriptor root) {
108 | descriptor = root;
109 | return null;
110 | }
111 | };
112 | com.google.protobuf.Descriptors.FileDescriptor
113 | .internalBuildGeneratedFileFrom(descriptorData,
114 | new com.google.protobuf.Descriptors.FileDescriptor[] {
115 | com.google.api.AnnotationsProto.getDescriptor(),
116 | com.google.protobuf.EmptyProto.getDescriptor(),
117 | google.protobuf.FieldMaskOuterClass.getDescriptor(),
118 | }, assigner);
119 | internal_static_contactsapi_company_CreateCompanyRequest_descriptor =
120 | getDescriptor().getMessageTypes().get(0);
121 | internal_static_contactsapi_company_CreateCompanyRequest_fieldAccessorTable = new
122 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
123 | internal_static_contactsapi_company_CreateCompanyRequest_descriptor,
124 | new java.lang.String[] { "Name", "FieldMask", });
125 | internal_static_contactsapi_company_GetCompanyRequest_descriptor =
126 | getDescriptor().getMessageTypes().get(1);
127 | internal_static_contactsapi_company_GetCompanyRequest_fieldAccessorTable = new
128 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
129 | internal_static_contactsapi_company_GetCompanyRequest_descriptor,
130 | new java.lang.String[] { "Id", "FieldMask", });
131 | internal_static_contactsapi_company_ListCompaniesRequest_descriptor =
132 | getDescriptor().getMessageTypes().get(2);
133 | internal_static_contactsapi_company_ListCompaniesRequest_fieldAccessorTable = new
134 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
135 | internal_static_contactsapi_company_ListCompaniesRequest_descriptor,
136 | new java.lang.String[] { "FieldMask", });
137 | internal_static_contactsapi_company_GetCompaniesRequest_descriptor =
138 | getDescriptor().getMessageTypes().get(3);
139 | internal_static_contactsapi_company_GetCompaniesRequest_fieldAccessorTable = new
140 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
141 | internal_static_contactsapi_company_GetCompaniesRequest_descriptor,
142 | new java.lang.String[] { "PageToken", "PageSize", "FieldMask", });
143 | internal_static_contactsapi_company_UpdateCompanyRequest_descriptor =
144 | getDescriptor().getMessageTypes().get(4);
145 | internal_static_contactsapi_company_UpdateCompanyRequest_fieldAccessorTable = new
146 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
147 | internal_static_contactsapi_company_UpdateCompanyRequest_descriptor,
148 | new java.lang.String[] { "Id", "Name", "UpdateMask", });
149 | internal_static_contactsapi_company_DeleteCompanyRequest_descriptor =
150 | getDescriptor().getMessageTypes().get(5);
151 | internal_static_contactsapi_company_DeleteCompanyRequest_fieldAccessorTable = new
152 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
153 | internal_static_contactsapi_company_DeleteCompanyRequest_descriptor,
154 | new java.lang.String[] { "Id", });
155 | internal_static_contactsapi_company_CompanyResponse_descriptor =
156 | getDescriptor().getMessageTypes().get(6);
157 | internal_static_contactsapi_company_CompanyResponse_fieldAccessorTable = new
158 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
159 | internal_static_contactsapi_company_CompanyResponse_descriptor,
160 | new java.lang.String[] { "Id", "Name", "Version", });
161 | internal_static_contactsapi_company_ListCompaniesResponse_descriptor =
162 | getDescriptor().getMessageTypes().get(7);
163 | internal_static_contactsapi_company_ListCompaniesResponse_fieldAccessorTable = new
164 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
165 | internal_static_contactsapi_company_ListCompaniesResponse_descriptor,
166 | new java.lang.String[] { "Companies", "NextPageToken", "Count", });
167 | com.google.protobuf.ExtensionRegistry registry =
168 | com.google.protobuf.ExtensionRegistry.newInstance();
169 | registry.add(com.google.api.AnnotationsProto.http);
170 | com.google.protobuf.Descriptors.FileDescriptor
171 | .internalUpdateFileDescriptor(descriptor, registry);
172 | com.google.api.AnnotationsProto.getDescriptor();
173 | com.google.protobuf.EmptyProto.getDescriptor();
174 | google.protobuf.FieldMaskOuterClass.getDescriptor();
175 | }
176 |
177 | // @@protoc_insertion_point(outer_class_scope)
178 | }
179 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/contactsapi/company/CompanyResponseOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: contactsapi/company/companies.proto
3 |
4 | package contactsapi.company;
5 |
6 | public interface CompanyResponseOrBuilder extends
7 | // @@protoc_insertion_point(interface_extends:contactsapi.company.CompanyResponse)
8 | com.google.protobuf.MessageOrBuilder {
9 |
10 | /**
11 | * string id = 1;
12 | */
13 | java.lang.String getId();
14 | /**
15 | * string id = 1;
16 | */
17 | com.google.protobuf.ByteString
18 | getIdBytes();
19 |
20 | /**
21 | * string name = 2;
22 | */
23 | java.lang.String getName();
24 | /**
25 | * string name = 2;
26 | */
27 | com.google.protobuf.ByteString
28 | getNameBytes();
29 |
30 | /**
31 | *
32 | * TODO: Should this be a string or a int32?
33 | *
34 | *
35 | * int32 version = 3;
36 | */
37 | int getVersion();
38 | }
39 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/contactsapi/company/CreateCompanyRequestOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: contactsapi/company/companies.proto
3 |
4 | package contactsapi.company;
5 |
6 | public interface CreateCompanyRequestOrBuilder extends
7 | // @@protoc_insertion_point(interface_extends:contactsapi.company.CreateCompanyRequest)
8 | com.google.protobuf.MessageOrBuilder {
9 |
10 | /**
11 | * string name = 1;
12 | */
13 | java.lang.String getName();
14 | /**
15 | * string name = 1;
16 | */
17 | com.google.protobuf.ByteString
18 | getNameBytes();
19 |
20 | /**
21 | *
22 | * TODO: does create have a mask?..
23 | *
24 | *
25 | * .google.protobuf.FieldMask field_mask = 2;
26 | */
27 | boolean hasFieldMask();
28 | /**
29 | *
30 | * TODO: does create have a mask?..
31 | *
32 | *
33 | * .google.protobuf.FieldMask field_mask = 2;
34 | */
35 | google.protobuf.FieldMaskOuterClass.FieldMask getFieldMask();
36 | /**
37 | *
38 | * TODO: does create have a mask?..
39 | *
40 | *
41 | * .google.protobuf.FieldMask field_mask = 2;
42 | */
43 | google.protobuf.FieldMaskOuterClass.FieldMaskOrBuilder getFieldMaskOrBuilder();
44 | }
45 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/contactsapi/company/DeleteCompanyRequestOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: contactsapi/company/companies.proto
3 |
4 | package contactsapi.company;
5 |
6 | public interface DeleteCompanyRequestOrBuilder extends
7 | // @@protoc_insertion_point(interface_extends:contactsapi.company.DeleteCompanyRequest)
8 | com.google.protobuf.MessageOrBuilder {
9 |
10 | /**
11 | * string id = 1;
12 | */
13 | java.lang.String getId();
14 | /**
15 | * string id = 1;
16 | */
17 | com.google.protobuf.ByteString
18 | getIdBytes();
19 | }
20 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/contactsapi/company/GetCompaniesRequestOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: contactsapi/company/companies.proto
3 |
4 | package contactsapi.company;
5 |
6 | public interface GetCompaniesRequestOrBuilder extends
7 | // @@protoc_insertion_point(interface_extends:contactsapi.company.GetCompaniesRequest)
8 | com.google.protobuf.MessageOrBuilder {
9 |
10 | /**
11 | * string page_token = 1;
12 | */
13 | java.lang.String getPageToken();
14 | /**
15 | * string page_token = 1;
16 | */
17 | com.google.protobuf.ByteString
18 | getPageTokenBytes();
19 |
20 | /**
21 | * int32 page_size = 2;
22 | */
23 | int getPageSize();
24 |
25 | /**
26 | * .google.protobuf.FieldMask field_mask = 3;
27 | */
28 | boolean hasFieldMask();
29 | /**
30 | * .google.protobuf.FieldMask field_mask = 3;
31 | */
32 | google.protobuf.FieldMaskOuterClass.FieldMask getFieldMask();
33 | /**
34 | * .google.protobuf.FieldMask field_mask = 3;
35 | */
36 | google.protobuf.FieldMaskOuterClass.FieldMaskOrBuilder getFieldMaskOrBuilder();
37 | }
38 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/contactsapi/company/GetCompanyRequestOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: contactsapi/company/companies.proto
3 |
4 | package contactsapi.company;
5 |
6 | public interface GetCompanyRequestOrBuilder extends
7 | // @@protoc_insertion_point(interface_extends:contactsapi.company.GetCompanyRequest)
8 | com.google.protobuf.MessageOrBuilder {
9 |
10 | /**
11 | * string id = 1;
12 | */
13 | java.lang.String getId();
14 | /**
15 | * string id = 1;
16 | */
17 | com.google.protobuf.ByteString
18 | getIdBytes();
19 |
20 | /**
21 | * .google.protobuf.FieldMask field_mask = 2;
22 | */
23 | boolean hasFieldMask();
24 | /**
25 | * .google.protobuf.FieldMask field_mask = 2;
26 | */
27 | google.protobuf.FieldMaskOuterClass.FieldMask getFieldMask();
28 | /**
29 | * .google.protobuf.FieldMask field_mask = 2;
30 | */
31 | google.protobuf.FieldMaskOuterClass.FieldMaskOrBuilder getFieldMaskOrBuilder();
32 | }
33 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/contactsapi/company/ListCompaniesRequestOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: contactsapi/company/companies.proto
3 |
4 | package contactsapi.company;
5 |
6 | public interface ListCompaniesRequestOrBuilder extends
7 | // @@protoc_insertion_point(interface_extends:contactsapi.company.ListCompaniesRequest)
8 | com.google.protobuf.MessageOrBuilder {
9 |
10 | /**
11 | * .google.protobuf.FieldMask field_mask = 2;
12 | */
13 | boolean hasFieldMask();
14 | /**
15 | * .google.protobuf.FieldMask field_mask = 2;
16 | */
17 | google.protobuf.FieldMaskOuterClass.FieldMask getFieldMask();
18 | /**
19 | * .google.protobuf.FieldMask field_mask = 2;
20 | */
21 | google.protobuf.FieldMaskOuterClass.FieldMaskOrBuilder getFieldMaskOrBuilder();
22 | }
23 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/contactsapi/company/ListCompaniesResponseOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: contactsapi/company/companies.proto
3 |
4 | package contactsapi.company;
5 |
6 | public interface ListCompaniesResponseOrBuilder extends
7 | // @@protoc_insertion_point(interface_extends:contactsapi.company.ListCompaniesResponse)
8 | com.google.protobuf.MessageOrBuilder {
9 |
10 | /**
11 | * repeated .contactsapi.company.CompanyResponse companies = 1;
12 | */
13 | java.util.List
14 | getCompaniesList();
15 | /**
16 | * repeated .contactsapi.company.CompanyResponse companies = 1;
17 | */
18 | contactsapi.company.CompanyResponse getCompanies(int index);
19 | /**
20 | * repeated .contactsapi.company.CompanyResponse companies = 1;
21 | */
22 | int getCompaniesCount();
23 | /**
24 | * repeated .contactsapi.company.CompanyResponse companies = 1;
25 | */
26 | java.util.List extends contactsapi.company.CompanyResponseOrBuilder>
27 | getCompaniesOrBuilderList();
28 | /**
29 | * repeated .contactsapi.company.CompanyResponse companies = 1;
30 | */
31 | contactsapi.company.CompanyResponseOrBuilder getCompaniesOrBuilder(
32 | int index);
33 |
34 | /**
35 | * string next_page_token = 2;
36 | */
37 | java.lang.String getNextPageToken();
38 | /**
39 | * string next_page_token = 2;
40 | */
41 | com.google.protobuf.ByteString
42 | getNextPageTokenBytes();
43 |
44 | /**
45 | * int32 count = 3;
46 | */
47 | int getCount();
48 | }
49 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/contactsapi/company/UpdateCompanyRequestOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: contactsapi/company/companies.proto
3 |
4 | package contactsapi.company;
5 |
6 | public interface UpdateCompanyRequestOrBuilder extends
7 | // @@protoc_insertion_point(interface_extends:contactsapi.company.UpdateCompanyRequest)
8 | com.google.protobuf.MessageOrBuilder {
9 |
10 | /**
11 | * string id = 1;
12 | */
13 | java.lang.String getId();
14 | /**
15 | * string id = 1;
16 | */
17 | com.google.protobuf.ByteString
18 | getIdBytes();
19 |
20 | /**
21 | * string name = 2;
22 | */
23 | java.lang.String getName();
24 | /**
25 | * string name = 2;
26 | */
27 | com.google.protobuf.ByteString
28 | getNameBytes();
29 |
30 | /**
31 | * .google.protobuf.FieldMask update_mask = 3;
32 | */
33 | boolean hasUpdateMask();
34 | /**
35 | * .google.protobuf.FieldMask update_mask = 3;
36 | */
37 | google.protobuf.FieldMaskOuterClass.FieldMask getUpdateMask();
38 | /**
39 | * .google.protobuf.FieldMask update_mask = 3;
40 | */
41 | google.protobuf.FieldMaskOuterClass.FieldMaskOrBuilder getUpdateMaskOrBuilder();
42 | }
43 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/contactsapi/customfield/CreateCustomFieldRequestOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: contactsapi/customfield/customfieldschema.proto
3 |
4 | package contactsapi.customfield;
5 |
6 | public interface CreateCustomFieldRequestOrBuilder extends
7 | // @@protoc_insertion_point(interface_extends:contactsapi.customfield.CreateCustomFieldRequest)
8 | com.google.protobuf.MessageOrBuilder {
9 |
10 | /**
11 | * string name = 1;
12 | */
13 | java.lang.String getName();
14 | /**
15 | * string name = 1;
16 | */
17 | com.google.protobuf.ByteString
18 | getNameBytes();
19 |
20 | /**
21 | * .contactsapi.customfield.CreateCustomFieldRequest.Type type = 2;
22 | */
23 | int getTypeValue();
24 | /**
25 | * .contactsapi.customfield.CreateCustomFieldRequest.Type type = 2;
26 | */
27 | contactsapi.customfield.CreateCustomFieldRequest.Type getType();
28 |
29 | /**
30 | *
31 | * ??
32 | * repeated string field_mask = 4;
33 | *
34 | *
35 | * string label = 3;
36 | */
37 | java.lang.String getLabel();
38 | /**
39 | *
40 | * ??
41 | * repeated string field_mask = 4;
42 | *
43 | *
44 | * string label = 3;
45 | */
46 | com.google.protobuf.ByteString
47 | getLabelBytes();
48 | }
49 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/contactsapi/customfield/CustomFieldOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: contactsapi/customfield/customfieldschema.proto
3 |
4 | package contactsapi.customfield;
5 |
6 | public interface CustomFieldOrBuilder extends
7 | // @@protoc_insertion_point(interface_extends:contactsapi.customfield.CustomField)
8 | com.google.protobuf.MessageOrBuilder {
9 |
10 | /**
11 | * string name = 1;
12 | */
13 | java.lang.String getName();
14 | /**
15 | * string name = 1;
16 | */
17 | com.google.protobuf.ByteString
18 | getNameBytes();
19 |
20 | /**
21 | * .contactsapi.customfield.CustomField.Type type = 2;
22 | */
23 | int getTypeValue();
24 | /**
25 | * .contactsapi.customfield.CustomField.Type type = 2;
26 | */
27 | contactsapi.customfield.CustomField.Type getType();
28 |
29 | /**
30 | * string label = 3;
31 | */
32 | java.lang.String getLabel();
33 | /**
34 | * string label = 3;
35 | */
36 | com.google.protobuf.ByteString
37 | getLabelBytes();
38 |
39 | /**
40 | * string id = 4;
41 | */
42 | java.lang.String getId();
43 | /**
44 | * string id = 4;
45 | */
46 | com.google.protobuf.ByteString
47 | getIdBytes();
48 |
49 | /**
50 | *
51 | * TODO: or Timestamp.proto?
52 | *
53 | *
54 | * string created = 5;
55 | */
56 | java.lang.String getCreated();
57 | /**
58 | *
59 | * TODO: or Timestamp.proto?
60 | *
61 | *
62 | * string created = 5;
63 | */
64 | com.google.protobuf.ByteString
65 | getCreatedBytes();
66 |
67 | /**
68 | *
69 | * TODO: or Timestamp.proto?
70 | *
71 | *
72 | * string updated = 6;
73 | */
74 | java.lang.String getUpdated();
75 | /**
76 | *
77 | * TODO: or Timestamp.proto?
78 | *
79 | *
80 | * string updated = 6;
81 | */
82 | com.google.protobuf.ByteString
83 | getUpdatedBytes();
84 | }
85 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/contactsapi/customfield/Customfieldschema.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: contactsapi/customfield/customfieldschema.proto
3 |
4 | package contactsapi.customfield;
5 |
6 | public final class Customfieldschema {
7 | private Customfieldschema() {}
8 | public static void registerAllExtensions(
9 | com.google.protobuf.ExtensionRegistryLite registry) {
10 | }
11 |
12 | public static void registerAllExtensions(
13 | com.google.protobuf.ExtensionRegistry registry) {
14 | registerAllExtensions(
15 | (com.google.protobuf.ExtensionRegistryLite) registry);
16 | }
17 | static final com.google.protobuf.Descriptors.Descriptor
18 | internal_static_contactsapi_customfield_CreateCustomFieldRequest_descriptor;
19 | static final
20 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
21 | internal_static_contactsapi_customfield_CreateCustomFieldRequest_fieldAccessorTable;
22 | static final com.google.protobuf.Descriptors.Descriptor
23 | internal_static_contactsapi_customfield_ListCustomFieldsRequest_descriptor;
24 | static final
25 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
26 | internal_static_contactsapi_customfield_ListCustomFieldsRequest_fieldAccessorTable;
27 | static final com.google.protobuf.Descriptors.Descriptor
28 | internal_static_contactsapi_customfield_ListCustomFieldsResponse_descriptor;
29 | static final
30 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
31 | internal_static_contactsapi_customfield_ListCustomFieldsResponse_fieldAccessorTable;
32 | static final com.google.protobuf.Descriptors.Descriptor
33 | internal_static_contactsapi_customfield_GetCustomFieldRequest_descriptor;
34 | static final
35 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
36 | internal_static_contactsapi_customfield_GetCustomFieldRequest_fieldAccessorTable;
37 | static final com.google.protobuf.Descriptors.Descriptor
38 | internal_static_contactsapi_customfield_UpdateCustomFieldRequest_descriptor;
39 | static final
40 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
41 | internal_static_contactsapi_customfield_UpdateCustomFieldRequest_fieldAccessorTable;
42 | static final com.google.protobuf.Descriptors.Descriptor
43 | internal_static_contactsapi_customfield_DeleteCustomFieldRequest_descriptor;
44 | static final
45 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
46 | internal_static_contactsapi_customfield_DeleteCustomFieldRequest_fieldAccessorTable;
47 | static final com.google.protobuf.Descriptors.Descriptor
48 | internal_static_contactsapi_customfield_CustomField_descriptor;
49 | static final
50 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
51 | internal_static_contactsapi_customfield_CustomField_fieldAccessorTable;
52 |
53 | public static com.google.protobuf.Descriptors.FileDescriptor
54 | getDescriptor() {
55 | return descriptor;
56 | }
57 | private static com.google.protobuf.Descriptors.FileDescriptor
58 | descriptor;
59 | static {
60 | java.lang.String[] descriptorData = {
61 | "\n/contactsapi/customfield/customfieldsch" +
62 | "ema.proto\022\027contactsapi.customfield\032\033goog" +
63 | "le/protobuf/empty.proto\032\034google/api/anno" +
64 | "tations.proto\032 google/protobuf/field_mas" +
65 | "k.proto\"\335\001\n\030CreateCustomFieldRequest\022\014\n\004" +
66 | "name\030\001 \001(\t\022D\n\004type\030\002 \001(\01626.contactsapi.c" +
67 | "ustomfield.CreateCustomFieldRequest.Type" +
68 | "\022\r\n\005label\030\003 \001(\t\"^\n\004Type\022\010\n\004TEXT\020\000\022\n\n\006NUM" +
69 | "BER\020\001\022\013\n\007BOOLEAN\020\002\022\r\n\tDATE_TIME\020\003\022\t\n\005EMA" +
70 | "IL\020\004\022\020\n\014PHONE_NUMBER\020\005\022\007\n\003URL\020\006\"p\n\027ListC" +
71 | "ustomFieldsRequest\022\022\n\npage_token\030\001 \001(\t\022\021" +
72 | "\n\tpage_size\030\002 \001(\005\022.\n\nfield_mask\030\003 \001(\0132\032." +
73 | "google.protobuf.FieldMask\"\177\n\030ListCustomF" +
74 | "ieldsResponse\022;\n\rcustom_fields\030\001 \003(\0132$.c" +
75 | "ontactsapi.customfield.CustomField\022\r\n\005co" +
76 | "unt\030\002 \001(\005\022\027\n\017next_page_token\030\003 \001(\t\"S\n\025Ge" +
77 | "tCustomFieldRequest\022\n\n\002id\030\001 \001(\t\022.\n\nfield" +
78 | "_mask\030\002 \001(\0132\032.google.protobuf.FieldMask\"" +
79 | "e\n\030UpdateCustomFieldRequest\022\n\n\002id\030\001 \001(\t\022" +
80 | "\014\n\004name\030\002 \001(\t\022/\n\013update_mask\030\003 \001(\0132\032.goo" +
81 | "gle.protobuf.FieldMask\"&\n\030DeleteCustomFi" +
82 | "eldRequest\022\n\n\002id\030\001 \001(\t\"\361\001\n\013CustomField\022\014" +
83 | "\n\004name\030\001 \001(\t\0227\n\004type\030\002 \001(\0162).contactsapi" +
84 | ".customfield.CustomField.Type\022\r\n\005label\030\003" +
85 | " \001(\t\022\n\n\002id\030\004 \001(\t\022\017\n\007created\030\005 \001(\t\022\017\n\007upd" +
86 | "ated\030\006 \001(\t\"^\n\004Type\022\010\n\004TEXT\020\000\022\n\n\006NUMBER\020\001" +
87 | "\022\013\n\007BOOLEAN\020\002\022\r\n\tDATE_TIME\020\003\022\t\n\005EMAIL\020\004\022" +
88 | "\020\n\014PHONE_NUMBER\020\005\022\007\n\003URL\020\0062\311\005\n\022CustomFie" +
89 | "ldService\022\211\001\n\021CreateCustomField\0221.contac" +
90 | "tsapi.customfield.CreateCustomFieldReque" +
91 | "st\032$.contactsapi.customfield.CustomField" +
92 | "\"\033\202\323\344\223\002\025\"\020/v1/customfields:\001*\022\221\001\n\020ListCu" +
93 | "stomFields\0220.contactsapi.customfield.Lis" +
94 | "tCustomFieldsRequest\0321.contactsapi.custo" +
95 | "mfield.ListCustomFieldsResponse\"\030\202\323\344\223\002\022\022" +
96 | "\020/v1/customfields\022\205\001\n\016GetCustomField\022..c" +
97 | "ontactsapi.customfield.GetCustomFieldReq" +
98 | "uest\032$.contactsapi.customfield.CustomFie" +
99 | "ld\"\035\202\323\344\223\002\027\022\025/v1/customfields/{id}\022\213\001\n\021Up" +
100 | "dateCustomField\0221.contactsapi.customfiel" +
101 | "d.UpdateCustomFieldRequest\032$.contactsapi" +
102 | ".customfield.CustomField\"\035\202\323\344\223\002\0272\025/v1/cu" +
103 | "stomfields/{id}\022}\n\021DeleteCustomField\0221.c" +
104 | "ontactsapi.customfield.DeleteCustomField" +
105 | "Request\032\026.google.protobuf.Empty\"\035\202\323\344\223\002\027*" +
106 | "\025/v1/customfields/{id}B\002P\001b\006proto3"
107 | };
108 | com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
109 | new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
110 | public com.google.protobuf.ExtensionRegistry assignDescriptors(
111 | com.google.protobuf.Descriptors.FileDescriptor root) {
112 | descriptor = root;
113 | return null;
114 | }
115 | };
116 | com.google.protobuf.Descriptors.FileDescriptor
117 | .internalBuildGeneratedFileFrom(descriptorData,
118 | new com.google.protobuf.Descriptors.FileDescriptor[] {
119 | com.google.protobuf.EmptyProto.getDescriptor(),
120 | com.google.api.AnnotationsProto.getDescriptor(),
121 | google.protobuf.FieldMaskOuterClass.getDescriptor(),
122 | }, assigner);
123 | internal_static_contactsapi_customfield_CreateCustomFieldRequest_descriptor =
124 | getDescriptor().getMessageTypes().get(0);
125 | internal_static_contactsapi_customfield_CreateCustomFieldRequest_fieldAccessorTable = new
126 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
127 | internal_static_contactsapi_customfield_CreateCustomFieldRequest_descriptor,
128 | new java.lang.String[] { "Name", "Type", "Label", });
129 | internal_static_contactsapi_customfield_ListCustomFieldsRequest_descriptor =
130 | getDescriptor().getMessageTypes().get(1);
131 | internal_static_contactsapi_customfield_ListCustomFieldsRequest_fieldAccessorTable = new
132 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
133 | internal_static_contactsapi_customfield_ListCustomFieldsRequest_descriptor,
134 | new java.lang.String[] { "PageToken", "PageSize", "FieldMask", });
135 | internal_static_contactsapi_customfield_ListCustomFieldsResponse_descriptor =
136 | getDescriptor().getMessageTypes().get(2);
137 | internal_static_contactsapi_customfield_ListCustomFieldsResponse_fieldAccessorTable = new
138 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
139 | internal_static_contactsapi_customfield_ListCustomFieldsResponse_descriptor,
140 | new java.lang.String[] { "CustomFields", "Count", "NextPageToken", });
141 | internal_static_contactsapi_customfield_GetCustomFieldRequest_descriptor =
142 | getDescriptor().getMessageTypes().get(3);
143 | internal_static_contactsapi_customfield_GetCustomFieldRequest_fieldAccessorTable = new
144 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
145 | internal_static_contactsapi_customfield_GetCustomFieldRequest_descriptor,
146 | new java.lang.String[] { "Id", "FieldMask", });
147 | internal_static_contactsapi_customfield_UpdateCustomFieldRequest_descriptor =
148 | getDescriptor().getMessageTypes().get(4);
149 | internal_static_contactsapi_customfield_UpdateCustomFieldRequest_fieldAccessorTable = new
150 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
151 | internal_static_contactsapi_customfield_UpdateCustomFieldRequest_descriptor,
152 | new java.lang.String[] { "Id", "Name", "UpdateMask", });
153 | internal_static_contactsapi_customfield_DeleteCustomFieldRequest_descriptor =
154 | getDescriptor().getMessageTypes().get(5);
155 | internal_static_contactsapi_customfield_DeleteCustomFieldRequest_fieldAccessorTable = new
156 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
157 | internal_static_contactsapi_customfield_DeleteCustomFieldRequest_descriptor,
158 | new java.lang.String[] { "Id", });
159 | internal_static_contactsapi_customfield_CustomField_descriptor =
160 | getDescriptor().getMessageTypes().get(6);
161 | internal_static_contactsapi_customfield_CustomField_fieldAccessorTable = new
162 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
163 | internal_static_contactsapi_customfield_CustomField_descriptor,
164 | new java.lang.String[] { "Name", "Type", "Label", "Id", "Created", "Updated", });
165 | com.google.protobuf.ExtensionRegistry registry =
166 | com.google.protobuf.ExtensionRegistry.newInstance();
167 | registry.add(com.google.api.AnnotationsProto.http);
168 | com.google.protobuf.Descriptors.FileDescriptor
169 | .internalUpdateFileDescriptor(descriptor, registry);
170 | com.google.protobuf.EmptyProto.getDescriptor();
171 | com.google.api.AnnotationsProto.getDescriptor();
172 | google.protobuf.FieldMaskOuterClass.getDescriptor();
173 | }
174 |
175 | // @@protoc_insertion_point(outer_class_scope)
176 | }
177 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/contactsapi/customfield/DeleteCustomFieldRequestOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: contactsapi/customfield/customfieldschema.proto
3 |
4 | package contactsapi.customfield;
5 |
6 | public interface DeleteCustomFieldRequestOrBuilder extends
7 | // @@protoc_insertion_point(interface_extends:contactsapi.customfield.DeleteCustomFieldRequest)
8 | com.google.protobuf.MessageOrBuilder {
9 |
10 | /**
11 | * string id = 1;
12 | */
13 | java.lang.String getId();
14 | /**
15 | * string id = 1;
16 | */
17 | com.google.protobuf.ByteString
18 | getIdBytes();
19 | }
20 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/contactsapi/customfield/GetCustomFieldRequestOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: contactsapi/customfield/customfieldschema.proto
3 |
4 | package contactsapi.customfield;
5 |
6 | public interface GetCustomFieldRequestOrBuilder extends
7 | // @@protoc_insertion_point(interface_extends:contactsapi.customfield.GetCustomFieldRequest)
8 | com.google.protobuf.MessageOrBuilder {
9 |
10 | /**
11 | * string id = 1;
12 | */
13 | java.lang.String getId();
14 | /**
15 | * string id = 1;
16 | */
17 | com.google.protobuf.ByteString
18 | getIdBytes();
19 |
20 | /**
21 | * .google.protobuf.FieldMask field_mask = 2;
22 | */
23 | boolean hasFieldMask();
24 | /**
25 | * .google.protobuf.FieldMask field_mask = 2;
26 | */
27 | google.protobuf.FieldMaskOuterClass.FieldMask getFieldMask();
28 | /**
29 | * .google.protobuf.FieldMask field_mask = 2;
30 | */
31 | google.protobuf.FieldMaskOuterClass.FieldMaskOrBuilder getFieldMaskOrBuilder();
32 | }
33 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/contactsapi/customfield/ListCustomFieldsRequestOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: contactsapi/customfield/customfieldschema.proto
3 |
4 | package contactsapi.customfield;
5 |
6 | public interface ListCustomFieldsRequestOrBuilder extends
7 | // @@protoc_insertion_point(interface_extends:contactsapi.customfield.ListCustomFieldsRequest)
8 | com.google.protobuf.MessageOrBuilder {
9 |
10 | /**
11 | * string page_token = 1;
12 | */
13 | java.lang.String getPageToken();
14 | /**
15 | * string page_token = 1;
16 | */
17 | com.google.protobuf.ByteString
18 | getPageTokenBytes();
19 |
20 | /**
21 | * int32 page_size = 2;
22 | */
23 | int getPageSize();
24 |
25 | /**
26 | *
27 | * TODO: string or array of strings?
28 | *
29 | *
30 | * .google.protobuf.FieldMask field_mask = 3;
31 | */
32 | boolean hasFieldMask();
33 | /**
34 | *
35 | * TODO: string or array of strings?
36 | *
37 | *
38 | * .google.protobuf.FieldMask field_mask = 3;
39 | */
40 | google.protobuf.FieldMaskOuterClass.FieldMask getFieldMask();
41 | /**
42 | *
43 | * TODO: string or array of strings?
44 | *
45 | *
46 | * .google.protobuf.FieldMask field_mask = 3;
47 | */
48 | google.protobuf.FieldMaskOuterClass.FieldMaskOrBuilder getFieldMaskOrBuilder();
49 | }
50 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/contactsapi/customfield/ListCustomFieldsResponseOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: contactsapi/customfield/customfieldschema.proto
3 |
4 | package contactsapi.customfield;
5 |
6 | public interface ListCustomFieldsResponseOrBuilder extends
7 | // @@protoc_insertion_point(interface_extends:contactsapi.customfield.ListCustomFieldsResponse)
8 | com.google.protobuf.MessageOrBuilder {
9 |
10 | /**
11 | * repeated .contactsapi.customfield.CustomField custom_fields = 1;
12 | */
13 | java.util.List
14 | getCustomFieldsList();
15 | /**
16 | * repeated .contactsapi.customfield.CustomField custom_fields = 1;
17 | */
18 | contactsapi.customfield.CustomField getCustomFields(int index);
19 | /**
20 | * repeated .contactsapi.customfield.CustomField custom_fields = 1;
21 | */
22 | int getCustomFieldsCount();
23 | /**
24 | * repeated .contactsapi.customfield.CustomField custom_fields = 1;
25 | */
26 | java.util.List extends contactsapi.customfield.CustomFieldOrBuilder>
27 | getCustomFieldsOrBuilderList();
28 | /**
29 | * repeated .contactsapi.customfield.CustomField custom_fields = 1;
30 | */
31 | contactsapi.customfield.CustomFieldOrBuilder getCustomFieldsOrBuilder(
32 | int index);
33 |
34 | /**
35 | * int32 count = 2;
36 | */
37 | int getCount();
38 |
39 | /**
40 | * string next_page_token = 3;
41 | */
42 | java.lang.String getNextPageToken();
43 | /**
44 | * string next_page_token = 3;
45 | */
46 | com.google.protobuf.ByteString
47 | getNextPageTokenBytes();
48 | }
49 |
--------------------------------------------------------------------------------
/build/generated/source/proto/main/java/contactsapi/customfield/UpdateCustomFieldRequestOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // source: contactsapi/customfield/customfieldschema.proto
3 |
4 | package contactsapi.customfield;
5 |
6 | public interface UpdateCustomFieldRequestOrBuilder extends
7 | // @@protoc_insertion_point(interface_extends:contactsapi.customfield.UpdateCustomFieldRequest)
8 | com.google.protobuf.MessageOrBuilder {
9 |
10 | /**
11 | * string id = 1;
12 | */
13 | java.lang.String getId();
14 | /**
15 | * string id = 1;
16 | */
17 | com.google.protobuf.ByteString
18 | getIdBytes();
19 |
20 | /**
21 | * string name = 2;
22 | */
23 | java.lang.String getName();
24 | /**
25 | * string name = 2;
26 | */
27 | com.google.protobuf.ByteString
28 | getNameBytes();
29 |
30 | /**
31 | * .google.protobuf.FieldMask update_mask = 3;
32 | */
33 | boolean hasUpdateMask();
34 | /**
35 | * .google.protobuf.FieldMask update_mask = 3;
36 | */
37 | google.protobuf.FieldMaskOuterClass.FieldMask getUpdateMask();
38 | /**
39 | * .google.protobuf.FieldMask update_mask = 3;
40 | */
41 | google.protobuf.FieldMaskOuterClass.FieldMaskOrBuilder getUpdateMaskOrBuilder();
42 | }
43 |
--------------------------------------------------------------------------------
/entry.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "flag"
5 | "net/http"
6 |
7 | "github.com/golang/glog"
8 | "golang.org/x/net/context"
9 | "github.com/grpc-ecosystem/grpc-gateway/runtime"
10 | "google.golang.org/grpc"
11 |
12 | customFieldGateway "./src/main/proto/contactsapi/customfield"
13 | companyGateway "./src/main/proto/contactsapi/company"
14 | )
15 |
16 | var (
17 | gRpcServer = flag.String("echo_endpoint", "localhost:50051", "endpoint of YourService")
18 | )
19 |
20 | func run() error {
21 | ctx := context.Background()
22 | ctx, cancel := context.WithCancel(ctx)
23 | defer cancel()
24 |
25 | mux := runtime.NewServeMux()
26 | opts := []grpc.DialOption{grpc.WithInsecure()}
27 |
28 | companyErr := companyGateway.RegisterCompanyServiceHandlerFromEndpoint(ctx, mux, *gRpcServer, opts)
29 | customFieldErr := customFieldGateway.RegisterCustomFieldServiceHandlerFromEndpoint(ctx, mux, *gRpcServer, opts)
30 |
31 | if companyErr != nil {
32 | return companyErr
33 | }
34 |
35 | if customFieldErr != nil {
36 | return customFieldErr
37 | }
38 |
39 | return http.ListenAndServe(":8080", mux)
40 | }
41 |
42 | func main() {
43 | flag.Parse()
44 | defer glog.Flush()
45 |
46 | if err := run(); err != nil {
47 | glog.Fatal(err)
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wejrowski/grpc-gateway-java-gradle/e9958c4dcfd5b8ad2c08ee0e61d7ed61fe58f74d/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip
6 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | ## Get the gateway running
2 |
3 | 1. Start java server
4 | ```CustomFieldServer.java```
5 | 2. Run the go proxy
6 | ```go run entry.go```
7 | 3. curl the rest proxy endpoints (below)
8 |
9 |
10 | ## Sample Endpoint requests
11 | *Documentation: https://cloud.google.com/endpoints/docs/grpc-service-config/reference/rpc/google.api*)
12 |
13 | ### Create Custom Field
14 |
15 | *// TODO: Why when asking for type TEXT, it doesn't return the label?
16 | // Is that by default for default or first values?*
17 |
18 | ```
19 | curl -X POST -d '{"label": "a label", "name": "a name", "type": "DATE_TIME"}' -k http://localhost:8080/v1/customfields
20 | ```
21 |
22 | Response:
23 | ```json
24 | {
25 | "name":"a name",
26 | "type":"DATE_TIME",
27 | "label":"a label"
28 | }
29 | ```
30 |
31 | ### Get Custom Field
32 |
33 | *// TODO: Test params*
34 |
35 | ```
36 | curl -X GET -k http://localhost:8080/v1/customfields/12
37 | ```
38 |
39 | Response:
40 | ```json
41 | {
42 | "name": "FieldName",
43 | "label":"Field Label"
44 | }
45 | ```
46 |
47 | ### List Custom Fields
48 |
49 | *// TODO: Test params*
50 |
51 | ```
52 | curl -X GET -k http://localhost:8080/v1/customfields
53 | ```
54 |
55 | Response:
56 | ```json
57 | {
58 | "count": 25,
59 | "custom_fields": [
60 | {
61 | "label": "Favorite Color",
62 | "name": "fav_color"
63 | },
64 | {
65 | "label": "Favorite day",
66 | "name": "fav_day",
67 | "type": "DATE_TIME"
68 | }
69 | ]
70 | }
71 | ```
72 |
73 | ### List fields with mask
74 | ```
75 | curl -X GET -k http://localhost:8080/v1/customfields\?field_mask.paths\=id\&field_mask.paths\=name
76 | ```
77 |
78 | Response:
79 | ```
80 | {
81 | "count":25
82 | "custom_fields": [
83 | {
84 | "name": "fav_color",
85 | "id":"3214"
86 | },
87 | {
88 | "name": "fav_day",
89 | "id":"8849"
90 | }
91 | ]
92 | }
93 | ```
94 |
95 |
96 | ### Update Custom Field
97 |
98 | *// NOTE: type also is left out if it's set to TEXT*
99 |
100 | ```
101 | curl -X PATCH -k -d '{"name": "my name"}' http://localhost:8080/v1/customfields/1
102 | ```
103 |
104 | Response:
105 | ```json
106 | {
107 | "name":"1",
108 | "label":"Field Label"
109 | }
110 | ```
111 |
112 | # Original steps to create
113 |
114 | Create gradle project in intellij
115 |
116 | Add java grpc gradle settings via https://github.com/grpc/grpc-java
117 | *Ensure protobuf-gradle-plugin is at latest release, check https://github.com/google/protobuf-gradle-plugin/releases*
118 |
119 |
120 | Create dummy proto file
121 |
122 | Run gradle Task other/generateProto
123 | - This creates build/generated/source/proto/main...
124 | - The files in generated/source/proto/main/java/com/proto/dumby appear
125 | to be exactly the same as running ```protoc --proto_path=src/main/proto --java_out=build src/main/proto/dummy.proto```
126 | It created
127 | - Dummy.java, DummyMessage.java and DummyMessageOrBuilder.java
128 | - **Additionally creates a grpc dir with a ```DummyServiceGrpc.java/GreetServiceGrpc.java``` file.**
129 | - This has a grpc service class with stubs
130 | (This is one of the missing pieces the command doesn't run. It *might* be connected to.... [what was the project?])
131 |
132 | ```bash
133 | protoc --plugin=protoc-gen-grpc-java=build/exe/java_plugin/protoc-gen-grpc-java \
134 | --grpc-java_out=build --proto_path=src/main/proto src/main/proto/dummy.proto
135 | ```
136 |
137 |
138 |
139 |
140 | Create Java server (GreetServiceImpl.java) that implements a io.grpc.Server (GreetingServer.java)
141 | - Create Client (make sure you run gw generateProto before)
142 | - Run Server, run Client, watch hello message result
143 |
144 |
145 | ## Creating the gateway
146 |
147 | Install go: ```brew install go```, ```export PATH="$PATH:$GOPATH/bin"```
148 |
149 |
150 | Install go dependencies
151 | ```
152 | go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
153 | go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
154 | go get -u github.com/golang/protobuf/protoc-gen-go
155 | ```
156 |
157 | Note: Right now I copied the annotations.proto and http.proto into the project from the grpc-gateway
158 | go installation.
159 |
160 | Generate go server (pb.go)
161 |
162 | ```
163 | protoc -I/usr/local/include -I. \
164 | -I$GOPATH/src \
165 | -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
166 | --plugin=protoc-gen-go=$GOPATH/bin/protoc-gen-go \
167 | --go_out=plugins=grpc:. \
168 | ./src/main/proto/contactsapi/customfield/customfieldschema.proto
169 | ```
170 |
171 | Create the proxy pb.gw.go file:
172 |
173 | ```
174 | protoc -I/usr/local/include -I. \
175 | -I$GOPATH/src \
176 | -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
177 | --plugin=protoc-gen-grpc-gateway=$GOPATH/bin/protoc-gen-grpc-gateway \
178 | --grpc-gateway_out=logtostderr=true:. \
179 | ./src/main/proto/contactsapi/customfield/customfieldschema.proto
180 | ```
181 |
182 | // Generate swagger (not needed for proxy)
183 | ```
184 | protoc -I/usr/local/include -I. \
185 | -I$GOPATH/src \
186 | -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
187 | --plugin=protoc-gen-swagger=$GOPATH/bin/protoc-gen-go \
188 | --swagger_out=logtostderr=true:. \
189 | ./src/main/proto/greet/greet.proto
190 | ```
191 |
192 | NOTE: GreetingServer.java sets the port for the gRPC server ServerBuilder.forPort(50051)
193 | 9090
194 | entry.go sets ```echoEndpoint = flag.String("echo_endpoint", "localhost:9090", "endpoint of YourService")```
195 | That was changed to gRPC server port ```50051``` (from the grpc-gateway repo)
196 |
197 |
198 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'grpc-java-course'
2 |
3 |
--------------------------------------------------------------------------------
/src/main/java/contactsapi/company/server/CompanyServiceImpl.java:
--------------------------------------------------------------------------------
1 | package contactsapi.company.server;
2 |
3 | import com.google.protobuf.Empty;
4 | import contactsapi.company.CompanyResponse;
5 | import contactsapi.company.CompanyServiceGrpc;
6 | import contactsapi.company.CreateCompanyRequest;
7 | import contactsapi.company.DeleteCompanyRequest;
8 | import contactsapi.company.GetCompanyRequest;
9 | import contactsapi.company.ListCompaniesRequest;
10 | import contactsapi.company.ListCompaniesResponse;
11 | import contactsapi.company.UpdateCompanyRequest;
12 | import io.grpc.stub.StreamObserver;
13 |
14 | public class CompanyServiceImpl extends CompanyServiceGrpc.CompanyServiceImplBase {
15 | @Override
16 | public void createCompany(CreateCompanyRequest request, StreamObserver responseObserver) {
17 | CompanyResponse response = CompanyResponse.newBuilder()
18 | .setId("1234")
19 | .setName(request.getName())
20 | .setVersion(1)
21 | .build();
22 |
23 | // Send the response
24 | responseObserver.onNext(response);
25 | // Complete the RPC call
26 | responseObserver.onCompleted();
27 | }
28 |
29 | @Override
30 | public void getCompany(GetCompanyRequest request, StreamObserver responseObserver) {
31 | CompanyResponse response = CompanyResponse.newBuilder()
32 | .setId(request.getId())
33 | .setName("The Biz LLC")
34 | .setVersion(4)
35 | .build();
36 |
37 | responseObserver.onNext(response);
38 | responseObserver.onCompleted();
39 | }
40 |
41 | @Override
42 | public void listCompanies(ListCompaniesRequest request, StreamObserver responseObserver) {
43 | ListCompaniesResponse response = ListCompaniesResponse.newBuilder()
44 | .setCount(15)
45 | .addCompanies(CompanyResponse.newBuilder()
46 | .setId("1234")
47 | .setName("Bob's Builders")
48 | .setVersion(1)
49 | .build())
50 | .addCompanies(CompanyResponse.newBuilder()
51 | .setId("4472")
52 | .setName("Sara's Sandwhich Shop")
53 | .setVersion(1)
54 | .build())
55 | .build();
56 |
57 | responseObserver.onNext(response);
58 | responseObserver.onCompleted();
59 | }
60 |
61 | @Override
62 | public void updateCompany(UpdateCompanyRequest request, StreamObserver responseObserver) {
63 | CompanyResponse response = CompanyResponse.newBuilder()
64 | .setId("123")
65 | .setName(request.getName())
66 | .setVersion(2)
67 | .build();
68 |
69 | responseObserver.onNext(response);
70 | responseObserver.onCompleted();
71 | }
72 |
73 | @Override
74 | public void deleteCompany(DeleteCompanyRequest request, StreamObserver responseObserver) {
75 | responseObserver.onNext(Empty.getDefaultInstance());
76 | responseObserver.onCompleted();
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/src/main/java/contactsapi/customfield/server/CustomFieldServiceImpl.java:
--------------------------------------------------------------------------------
1 | package contactsapi.customfield.server;
2 |
3 | import com.google.protobuf.Empty;
4 | import contactsapi.customfield.CreateCustomFieldRequest;
5 | import contactsapi.customfield.CustomField;
6 | import contactsapi.customfield.CustomFieldServiceGrpc;
7 | import contactsapi.customfield.DeleteCustomFieldRequest;
8 | import contactsapi.customfield.GetCustomFieldRequest;
9 | import contactsapi.customfield.ListCustomFieldsRequest;
10 | import contactsapi.customfield.ListCustomFieldsResponse;
11 | import contactsapi.customfield.UpdateCustomFieldRequest;
12 | import io.grpc.stub.StreamObserver;
13 |
14 | public class CustomFieldServiceImpl extends CustomFieldServiceGrpc.CustomFieldServiceImplBase {
15 | @Override
16 | public void createCustomField(CreateCustomFieldRequest request, StreamObserver responseObserver) {
17 | // Create response
18 | CustomField response = CustomField.newBuilder()
19 | .setId("1000")
20 | .setLabel(request.getLabel())
21 | .setName(request.getName())
22 | // TODO: WHy isn't this responding?
23 | .setType(CustomField.Type.valueOf(request.getType().toString()))
24 | .build();
25 |
26 | // Send the response
27 | responseObserver.onNext(response);
28 |
29 | // Complete the RPC call
30 | responseObserver.onCompleted();
31 | }
32 |
33 | @Override
34 | public void listCustomFields(ListCustomFieldsRequest request, StreamObserver responseObserver) {
35 |
36 | CustomField.Builder customField1Builder = CustomField.newBuilder();
37 | CustomField.Builder customField2Builder = CustomField.newBuilder();
38 |
39 |
40 | if (request.getFieldMask().getPathsList().size() == 0 || request.getFieldMask().getPathsList().contains("id")) {
41 | customField1Builder.setId("3214");
42 | customField2Builder.setId("8849");
43 | }
44 |
45 | if (request.getFieldMask().getPathsList().size() == 0 || request.getFieldMask().getPathsList().contains("label")) {
46 | customField1Builder.setLabel("Favorite Color");
47 | customField2Builder.setLabel("Favorite day");
48 | }
49 |
50 | if (request.getFieldMask().getPathsList().size() == 0 || request.getFieldMask().getPathsList().contains("name")) {
51 | customField1Builder.setName("fav_color");
52 | customField2Builder.setName("fav_day");
53 | }
54 |
55 | if (request.getFieldMask().getPathsList().size() == 0 || request.getFieldMask().getPathsList().contains("type")) {
56 | customField1Builder.setType(CustomField.Type.TEXT);
57 | customField2Builder.setType(CustomField.Type.DATE_TIME);
58 | }
59 |
60 | customField1Builder.setId("maskCount:" + request.getFieldMask().getPathsCount());
61 |
62 | CustomField customField1 = customField1Builder.build();
63 | CustomField customField2 = customField2Builder.build();
64 |
65 |
66 | ListCustomFieldsResponse response = ListCustomFieldsResponse.newBuilder()
67 | .setCount(25)
68 | .addCustomFields(customField1)
69 | .addCustomFields(customField2)
70 | .build();
71 | // Send the response
72 | responseObserver.onNext(response);
73 |
74 | // Complete the RPC call
75 | responseObserver.onCompleted();
76 | }
77 |
78 | @Override
79 | public void getCustomField(GetCustomFieldRequest request, StreamObserver responseObserver) {
80 | // Create response
81 | CustomField response = CustomField.newBuilder()
82 | .setId(request.getId())
83 | .setLabel("Field Label")
84 | .setName("FieldName")
85 | .setType(CustomField.Type.PHONE_NUMBER)
86 | .build();
87 |
88 | // Send the response
89 | responseObserver.onNext(response);
90 |
91 | // Complete the RPC call
92 | responseObserver.onCompleted();
93 | }
94 |
95 | @Override
96 | public void updateCustomField(UpdateCustomFieldRequest request, StreamObserver responseObserver) {
97 | // Create response
98 | CustomField response = CustomField.newBuilder()
99 | .setId(request.getId())
100 | .setLabel("Field Label")
101 | .setName(request.getName())
102 | .setType(CustomField.Type.EMAIL)
103 | .build();
104 |
105 | // Send the response
106 | responseObserver.onNext(response);
107 |
108 | // Complete the RPC call
109 | responseObserver.onCompleted();
110 | }
111 |
112 | @Override
113 | public void deleteCustomField(DeleteCustomFieldRequest request, StreamObserver responseObserver) {
114 | responseObserver.onNext(Empty.getDefaultInstance());
115 | responseObserver.onCompleted();
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/src/main/java/contactsapi/grpcserver/ContactsApiServer.java:
--------------------------------------------------------------------------------
1 | package contactsapi.grpcserver;
2 |
3 | import contactsapi.company.server.CompanyServiceImpl;
4 | import contactsapi.customfield.server.CustomFieldServiceImpl;
5 | import io.grpc.Server;
6 | import io.grpc.ServerBuilder;
7 |
8 | import java.io.IOException;
9 |
10 | public class ContactsApiServer {
11 | public static void main(String[] args) throws IOException, InterruptedException {
12 | System.out.println("Hello gRPC");
13 |
14 | Server server = ServerBuilder.forPort(50051)
15 | .addService(new CustomFieldServiceImpl())
16 | .addService(new CompanyServiceImpl())
17 | .build();
18 |
19 | server.start();
20 |
21 | Runtime.getRuntime().addShutdownHook(new Thread(() -> {
22 | System.out.println("Received Shutdown Request");
23 | server.shutdown();
24 | System.out.println("Successfully stopped server");
25 | }));
26 |
27 | // Block main thread until terminated
28 | server.awaitTermination();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/proto/contactsapi/company/companies.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package contactsapi.company;
4 | option java_multiple_files = true;
5 |
6 | import "google/api/annotations.proto";
7 | import "google/protobuf/empty.proto";
8 | import "google/protobuf/field_mask.proto";
9 |
10 | message CreateCompanyRequest {
11 | string name = 1;
12 | // TODO: does create have a mask?..
13 | google.protobuf.FieldMask field_mask = 2;
14 | }
15 |
16 | message GetCompanyRequest {
17 | string id = 1;
18 | google.protobuf.FieldMask field_mask = 2;
19 | }
20 |
21 | message ListCompaniesRequest {
22 | google.protobuf.FieldMask field_mask = 2;
23 | }
24 |
25 | message GetCompaniesRequest {
26 | string page_token = 1;
27 | int32 page_size = 2;
28 | google.protobuf.FieldMask field_mask = 3;
29 | }
30 |
31 | message UpdateCompanyRequest {
32 | string id = 1;
33 | string name = 2;
34 | google.protobuf.FieldMask update_mask = 3;
35 | }
36 |
37 | message DeleteCompanyRequest {
38 | string id = 1;
39 | }
40 |
41 | message CompanyResponse {
42 | string id = 1;
43 | string name = 2;
44 | int32 version = 3;// TODO: Should this be a string or a int32?
45 | }
46 |
47 | message ListCompaniesResponse {
48 | repeated CompanyResponse companies = 1;
49 | string next_page_token = 2;
50 | int32 count = 3;
51 | }
52 |
53 | service CompanyService {
54 | rpc CreateCompany(CreateCompanyRequest) returns (CompanyResponse) {
55 | option (google.api.http) = {
56 | post: "/v1/companies"
57 | body: "*"
58 | };
59 | };
60 |
61 | rpc GetCompany(GetCompanyRequest) returns (CompanyResponse) {
62 | option (google.api.http) = {
63 | get: "/v1/companies/{id}"
64 | };
65 | };
66 |
67 | rpc ListCompanies(ListCompaniesRequest) returns (ListCompaniesResponse) {
68 | option (google.api.http) = {
69 | get: "/v1/companies"
70 | };
71 | };
72 |
73 | rpc UpdateCompany(UpdateCompanyRequest) returns (CompanyResponse) {
74 | option (google.api.http) = {
75 | get: "/v1/companies/{id}"
76 | };
77 | };
78 |
79 | rpc DeleteCompany(DeleteCompanyRequest) returns (google.protobuf.Empty) {
80 | option (google.api.http) = {
81 | delete: "/v1/companies/{id}"
82 | };
83 | };
84 | }
85 |
--------------------------------------------------------------------------------
/src/main/proto/contactsapi/contact/contacts.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package contactsapi.contact;
4 | option java_multiple_files = true;
5 |
6 | //import "google/protobuf/timestamp.proto";
7 | //import "google.protobuf.Timestamp";
8 | // /usr/local/include/google/protobuf/timestamp.proto
9 | import "google/api/annotations.proto";
10 | //import "google/protobuf/field_mask.proto";
11 | import "google/protobuf/field_mask.proto";
12 | import "google/protobuf/empty.proto";
13 |
14 | // import "../../lib/google/api/annotations.proto"; // THIS APPARENTLY IS IN GOOGLE/PROTOBUF/API.PROTO!
15 | // although.. that might dissappear in build? let's try it.
16 | //import "google/protobuf/api.proto";
17 |
18 |
19 | message CreateContactRequest {
20 | string name = 1;
21 | enum Type {
22 | TEXT = 0;
23 | NUMBER = 1;
24 | BOOLEAN = 2;
25 | DATE_TIME = 3;
26 | EMAIL = 4;
27 | PHONE_NUMBER = 5;
28 | URL = 6;
29 | }
30 |
31 | Type type = 2;
32 | string label = 3;
33 | }
34 |
35 |
36 | message ListContactsRequest {
37 | string pageToken = 1;
38 | int32 limit = 2;
39 | repeated string fieldMask = 3;
40 | string givenName = 4;// filter contacts by givenName string
41 | string familyName = 5;// filter contacts by familyName string
42 | string email = 6;// filter contacts by email string
43 | repeated string tags = 7;// filter contacts by tag nams string[]
44 | // TODO: get Timestamp.proto import working
45 | // Timestamp created = 8;// filter contacts by create date date range - 1/12/18~2/12/18
46 | repeated string contactIds = 9;
47 | string companyId = 10;// filter contacts by company Id string
48 | }
49 |
50 | message ListContactsResponse {
51 | repeated ContactResponse contacts = 1;
52 | string next_page_token = 2;
53 | int32 count = 3;
54 | }
55 |
56 | message GetContactRequest {
57 | string id = 1;
58 | google.protobuf.FieldMask field_mask = 2;
59 | }
60 |
61 |
62 | // TODO: Will we allow updating type/label?
63 | message UpdateContactRequest {
64 | string id = 1;
65 | string name = 2;
66 | google.protobuf.FieldMask update_mask = 3;
67 | }
68 |
69 | message ContactResponse {
70 | string name = 1;
71 |
72 | }
73 |
74 | service ContactService {
75 | rpc CreateContact(CreateContactRequest) returns (ContactResponse) {
76 | option (google.api.http) = {
77 | post: "/v1/contacts"
78 | body: "*"
79 | };
80 | };
81 |
82 | rpc ListContacts(ListContactsRequest) returns (ListContactsResponse) {
83 | option (google.api.http) = {
84 | get: "/v1/contacts"
85 | };
86 | };
87 |
88 | rpc GetContact(GetContactRequest) returns (ContactResponse) {
89 | option (google.api.http) = {
90 | get: "/v1/contacts/{id}"
91 | };
92 | };
93 |
94 | rpc UpdateContact(UpdateContactRequest) returns (ContactResponse) {
95 | option (google.api.http) = {
96 | patch: "/v1/contacts/{id}"
97 | };
98 | };
99 |
100 | rpc DeleteContact(UpdateContactRequest) returns (google.protobuf.Empty) {
101 | option (google.api.http) = {
102 | patch: "/v1/contacts/{id}"
103 | };
104 | };
105 | }
106 |
--------------------------------------------------------------------------------
/src/main/proto/contactsapi/customfield/customfieldschema.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package contactsapi.customfield;
4 | option java_multiple_files = true;
5 |
6 | //import "google/protobuf/timestamp.proto";
7 | //import "google.protobuf.Timestamp";
8 | // /usr/local/include/google/protobuf/timestamp.proto
9 |
10 | import "google/protobuf/empty.proto";
11 | import "google/api/annotations.proto";
12 | // NOTE this is where these come from I beleive: https://github.com/googleapis/googleapis/tree/master/google/api
13 | // Gateway has it copied in their project on gateway and also swagger under third_party
14 | // https://github.com/grpc-ecosystem/grpc-gateway/blob/master/third_party/googleapis/google/api/annotations.proto
15 |
16 |
17 | //google.protobuf/
18 | import "google/protobuf/field_mask.proto";
19 | //import "contactsapi/customfield/field_mask.proto";
20 |
21 | // import "../../lib/google/api/annotations.proto"; // THIS APPARENTLY IS IN GOOGLE/PROTOBUF/API.PROTO!
22 | // although.. that might dissappear in build? let's try it.
23 | //import "google/protobuf/api.proto";
24 |
25 | // TODO: add version (string or int32?)
26 |
27 | message CreateCustomFieldRequest {
28 | string name = 1;
29 | enum Type {
30 | TEXT = 0;
31 | NUMBER = 1;
32 | BOOLEAN = 2;
33 | DATE_TIME = 3;
34 | EMAIL = 4;
35 | PHONE_NUMBER = 5;
36 | URL = 6;
37 | }
38 |
39 | Type type = 2;
40 | string label = 3;
41 | // ??
42 | // repeated string field_mask = 4;
43 | }
44 |
45 | message ListCustomFieldsRequest {
46 | string page_token = 1;
47 | int32 page_size = 2;
48 | // TODO: string or array of strings?
49 | google.protobuf.FieldMask field_mask = 3;
50 | }
51 | message ListCustomFieldsResponse {
52 | repeated CustomField custom_fields = 1;
53 | int32 count = 2;
54 | string next_page_token = 3;
55 | }
56 |
57 | message GetCustomFieldRequest {
58 | string id = 1;
59 | google.protobuf.FieldMask field_mask = 2;
60 | }
61 |
62 |
63 | // TODO: Will we allow updating type/label?
64 | message UpdateCustomFieldRequest {
65 | string id = 1;
66 | string name = 2;
67 | google.protobuf.FieldMask update_mask = 3;
68 | }
69 |
70 |
71 | message DeleteCustomFieldRequest {
72 | string id = 1;
73 | }
74 |
75 | message CustomField {
76 | string name = 1;
77 | enum Type {
78 | TEXT = 0;
79 | NUMBER = 1;
80 | BOOLEAN = 2;
81 | DATE_TIME = 3;
82 | EMAIL = 4;
83 | PHONE_NUMBER = 5;
84 | URL = 6;
85 | }
86 |
87 | Type type = 2;
88 | string label = 3;
89 | string id = 4;
90 | string created = 5; // TODO: or Timestamp.proto?
91 | string updated = 6; // TODO: or Timestamp.proto?
92 |
93 | }
94 |
95 | service CustomFieldService {
96 | rpc CreateCustomField(CreateCustomFieldRequest) returns (CustomField) {
97 | option (google.api.http) = {
98 | post: "/v1/customfields"
99 | body: "*"
100 | };
101 | };
102 |
103 | rpc ListCustomFields(ListCustomFieldsRequest) returns (ListCustomFieldsResponse) {
104 | option (google.api.http) = {
105 | get: "/v1/customfields"
106 | };
107 | };
108 |
109 | rpc GetCustomField(GetCustomFieldRequest) returns (CustomField) {
110 | option (google.api.http) = {
111 | get: "/v1/customfields/{id}"
112 | };
113 | };
114 |
115 | rpc UpdateCustomField(UpdateCustomFieldRequest) returns (CustomField) {
116 | option (google.api.http) = {
117 | patch: "/v1/customfields/{id}"
118 | };
119 | };
120 |
121 | rpc DeleteCustomField(DeleteCustomFieldRequest) returns (google.protobuf.Empty) {
122 | option (google.api.http) = {
123 | delete: "/v1/customfields/{id}"
124 | };
125 | };
126 | }
127 |
128 |
--------------------------------------------------------------------------------
/src/main/proto/dummy.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package dummy;
4 |
5 | option java_package = "com.proto.dummy";
6 | option java_multiple_files = true;
7 |
8 | message DummyMessage {}
9 |
10 | service DummyService {}
11 |
--------------------------------------------------------------------------------
/src/main/proto/google/api/annotations.proto:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2015, Google Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package google.api;
18 |
19 | import "google/api/http.proto";
20 | //import "google/api/http.proto";
21 | import "google/protobuf/descriptor.proto";
22 |
23 | option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
24 | option java_multiple_files = true;
25 | option java_outer_classname = "AnnotationsProto";
26 | option java_package = "com.google.api";
27 | option objc_class_prefix = "GAPI";
28 |
29 | extend google.protobuf.MethodOptions {
30 | // See `HttpRule`.
31 | HttpRule http = 72295728;
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/proto/google/api/http.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2016 Google Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | syntax = "proto3";
16 |
17 | package google.api;
18 |
19 | option cc_enable_arenas = true;
20 | option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
21 | option java_multiple_files = true;
22 | option java_outer_classname = "HttpProto";
23 | option java_package = "com.google.api";
24 | option objc_class_prefix = "GAPI";
25 |
26 |
27 | // Defines the HTTP configuration for a service. It contains a list of
28 | // [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
29 | // to one or more HTTP REST API methods.
30 | message Http {
31 | // A list of HTTP configuration rules that apply to individual API methods.
32 | //
33 | // **NOTE:** All service configuration rules follow "last one wins" order.
34 | repeated HttpRule rules = 1;
35 | }
36 |
37 | // `HttpRule` defines the mapping of an RPC method to one or more HTTP
38 | // REST APIs. The mapping determines what portions of the request
39 | // message are populated from the path, query parameters, or body of
40 | // the HTTP request. The mapping is typically specified as an
41 | // `google.api.http` annotation, see "google/api/annotations.proto"
42 | // for details.
43 | //
44 | // The mapping consists of a field specifying the path template and
45 | // method kind. The path template can refer to fields in the request
46 | // message, as in the example below which describes a REST GET
47 | // operation on a resource collection of messages:
48 | //
49 | //
50 | // service Messaging {
51 | // rpc GetMessage(GetMessageRequest) returns (Message) {
52 | // option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}";
53 | // }
54 | // }
55 | // message GetMessageRequest {
56 | // message SubMessage {
57 | // string subfield = 1;
58 | // }
59 | // string message_id = 1; // mapped to the URL
60 | // SubMessage sub = 2; // `sub.subfield` is url-mapped
61 | // }
62 | // message Message {
63 | // string text = 1; // content of the resource
64 | // }
65 | //
66 | // The same http annotation can alternatively be expressed inside the
67 | // `GRPC API Configuration` YAML file.
68 | //
69 | // http:
70 | // rules:
71 | // - selector: .Messaging.GetMessage
72 | // get: /v1/messages/{message_id}/{sub.subfield}
73 | //
74 | // This definition enables an automatic, bidrectional mapping of HTTP
75 | // JSON to RPC. Example:
76 | //
77 | // HTTP | RPC
78 | // -----|-----
79 | // `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))`
80 | //
81 | // In general, not only fields but also field paths can be referenced
82 | // from a path pattern. Fields mapped to the path pattern cannot be
83 | // repeated and must have a primitive (non-message) type.
84 | //
85 | // Any fields in the request message which are not bound by the path
86 | // pattern automatically become (optional) HTTP query
87 | // parameters. Assume the following definition of the request message:
88 | //
89 | //
90 | // message GetMessageRequest {
91 | // message SubMessage {
92 | // string subfield = 1;
93 | // }
94 | // string message_id = 1; // mapped to the URL
95 | // int64 revision = 2; // becomes a parameter
96 | // SubMessage sub = 3; // `sub.subfield` becomes a parameter
97 | // }
98 | //
99 | //
100 | // This enables a HTTP JSON to RPC mapping as below:
101 | //
102 | // HTTP | RPC
103 | // -----|-----
104 | // `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))`
105 | //
106 | // Note that fields which are mapped to HTTP parameters must have a
107 | // primitive type or a repeated primitive type. Message types are not
108 | // allowed. In the case of a repeated type, the parameter can be
109 | // repeated in the URL, as in `...?param=A¶m=B`.
110 | //
111 | // For HTTP method kinds which allow a request body, the `body` field
112 | // specifies the mapping. Consider a REST update method on the
113 | // message resource collection:
114 | //
115 | //
116 | // service Messaging {
117 | // rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
118 | // option (google.api.http) = {
119 | // put: "/v1/messages/{message_id}"
120 | // body: "message"
121 | // };
122 | // }
123 | // }
124 | // message UpdateMessageRequest {
125 | // string message_id = 1; // mapped to the URL
126 | // Message message = 2; // mapped to the body
127 | // }
128 | //
129 | //
130 | // The following HTTP JSON to RPC mapping is enabled, where the
131 | // representation of the JSON in the request body is determined by
132 | // protos JSON encoding:
133 | //
134 | // HTTP | RPC
135 | // -----|-----
136 | // `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
137 | //
138 | // The special name `*` can be used in the body mapping to define that
139 | // every field not bound by the path template should be mapped to the
140 | // request body. This enables the following alternative definition of
141 | // the update method:
142 | //
143 | // service Messaging {
144 | // rpc UpdateMessage(Message) returns (Message) {
145 | // option (google.api.http) = {
146 | // put: "/v1/messages/{message_id}"
147 | // body: "*"
148 | // };
149 | // }
150 | // }
151 | // message Message {
152 | // string message_id = 1;
153 | // string text = 2;
154 | // }
155 | //
156 | //
157 | // The following HTTP JSON to RPC mapping is enabled:
158 | //
159 | // HTTP | RPC
160 | // -----|-----
161 | // `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")`
162 | //
163 | // Note that when using `*` in the body mapping, it is not possible to
164 | // have HTTP parameters, as all fields not bound by the path end in
165 | // the body. This makes this option more rarely used in practice of
166 | // defining REST APIs. The common usage of `*` is in custom methods
167 | // which don't use the URL at all for transferring data.
168 | //
169 | // It is possible to define multiple HTTP methods for one RPC by using
170 | // the `additional_bindings` option. Example:
171 | //
172 | // service Messaging {
173 | // rpc GetMessage(GetMessageRequest) returns (Message) {
174 | // option (google.api.http) = {
175 | // get: "/v1/messages/{message_id}"
176 | // additional_bindings {
177 | // get: "/v1/users/{user_id}/messages/{message_id}"
178 | // }
179 | // };
180 | // }
181 | // }
182 | // message GetMessageRequest {
183 | // string message_id = 1;
184 | // string user_id = 2;
185 | // }
186 | //
187 | //
188 | // This enables the following two alternative HTTP JSON to RPC
189 | // mappings:
190 | //
191 | // HTTP | RPC
192 | // -----|-----
193 | // `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
194 | // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")`
195 | //
196 | // # Rules for HTTP mapping
197 | //
198 | // The rules for mapping HTTP path, query parameters, and body fields
199 | // to the request message are as follows:
200 | //
201 | // 1. The `body` field specifies either `*` or a field path, or is
202 | // omitted. If omitted, it assumes there is no HTTP body.
203 | // 2. Leaf fields (recursive expansion of nested messages in the
204 | // request) can be classified into three types:
205 | // (a) Matched in the URL template.
206 | // (b) Covered by body (if body is `*`, everything except (a) fields;
207 | // else everything under the body field)
208 | // (c) All other fields.
209 | // 3. URL query parameters found in the HTTP request are mapped to (c) fields.
210 | // 4. Any body sent with an HTTP request can contain only (b) fields.
211 | //
212 | // The syntax of the path template is as follows:
213 | //
214 | // Template = "/" Segments [ Verb ] ;
215 | // Segments = Segment { "/" Segment } ;
216 | // Segment = "*" | "**" | LITERAL | Variable ;
217 | // Variable = "{" FieldPath [ "=" Segments ] "}" ;
218 | // FieldPath = IDENT { "." IDENT } ;
219 | // Verb = ":" LITERAL ;
220 | //
221 | // The syntax `*` matches a single path segment. It follows the semantics of
222 | // [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
223 | // Expansion.
224 | //
225 | // The syntax `**` matches zero or more path segments. It follows the semantics
226 | // of [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.3 Reserved
227 | // Expansion. NOTE: it must be the last segment in the path except the Verb.
228 | //
229 | // The syntax `LITERAL` matches literal text in the URL path.
230 | //
231 | // The syntax `Variable` matches the entire path as specified by its template;
232 | // this nested template must not contain further variables. If a variable
233 | // matches a single path segment, its template may be omitted, e.g. `{var}`
234 | // is equivalent to `{var=*}`.
235 | //
236 | // NOTE: the field paths in variables and in the `body` must not refer to
237 | // repeated fields or map fields.
238 | //
239 | // Use CustomHttpPattern to specify any HTTP method that is not included in the
240 | // `pattern` field, such as HEAD, or "*" to leave the HTTP method unspecified for
241 | // a given URL path rule. The wild-card rule is useful for services that provide
242 | // content to Web (HTML) clients.
243 | message HttpRule {
244 | // Selects methods to which this rule applies.
245 | //
246 | // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
247 | string selector = 1;
248 |
249 | // Determines the URL pattern is matched by this rules. This pattern can be
250 | // used with any of the {get|put|post|delete|patch} methods. A custom method
251 | // can be defined using the 'custom' field.
252 | oneof pattern {
253 | // Used for listing and getting information about resources.
254 | string get = 2;
255 |
256 | // Used for updating a resource.
257 | string put = 3;
258 |
259 | // Used for creating a resource.
260 | string post = 4;
261 |
262 | // Used for deleting a resource.
263 | string delete = 5;
264 |
265 | // Used for updating a resource.
266 | string patch = 6;
267 |
268 | // Custom pattern is used for defining custom verbs.
269 | CustomHttpPattern custom = 8;
270 | }
271 |
272 | // The name of the request field whose value is mapped to the HTTP body, or
273 | // `*` for mapping all fields not captured by the path pattern to the HTTP
274 | // body. NOTE: the referred field must not be a repeated field and must be
275 | // present at the top-level of request message type.
276 | string body = 7;
277 |
278 | // Additional HTTP bindings for the selector. Nested bindings must
279 | // not contain an `additional_bindings` field themselves (that is,
280 | // the nesting may only be one level deep).
281 | repeated HttpRule additional_bindings = 11;
282 | }
283 |
284 | // A custom pattern is used for defining custom HTTP verb.
285 | message CustomHttpPattern {
286 | // The name of this custom HTTP verb.
287 | string kind = 1;
288 |
289 | // The path matched by this custom verb.
290 | string path = 2;
291 | }
292 |
--------------------------------------------------------------------------------
/src/main/proto/google/protobuf/field_mask.proto:
--------------------------------------------------------------------------------
1 | // Protocol Buffers - Google's data interchange format
2 | // Copyright 2008 Google Inc. All rights reserved.
3 | // https://developers.google.com/protocol-buffers/
4 | //
5 | // Redistribution and use in source and binary forms, with or without
6 | // modification, are permitted provided that the following conditions are
7 | // met:
8 | //
9 | // * Redistributions of source code must retain the above copyright
10 | // notice, this list of conditions and the following disclaimer.
11 | // * Redistributions in binary form must reproduce the above
12 | // copyright notice, this list of conditions and the following disclaimer
13 | // in the documentation and/or other materials provided with the
14 | // distribution.
15 | // * Neither the name of Google Inc. nor the names of its
16 | // contributors may be used to endorse or promote products derived from
17 | // this software without specific prior written permission.
18 | //
19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
31 | syntax = "proto3";
32 |
33 | package google.protobuf;
34 |
35 | //option csharp_namespace = "Google.Protobuf.WellKnownTypes";
36 | //option java_package = "com.google.protobuf";
37 | //option java_outer_classname = "FieldMaskProto";
38 | //option java_multiple_files = true;
39 | //option objc_class_prefix = "GPB";
40 | //option go_package = "google.golang.org/genproto/protobuf/field_mask;field_mask";
41 |
42 | // `FieldMask` represents a set of symbolic field paths, for example:
43 | //
44 | // paths: "f.a"
45 | // paths: "f.b.d"
46 | //
47 | // Here `f` represents a field in some root message, `a` and `b`
48 | // fields in the message found in `f`, and `d` a field found in the
49 | // message in `f.b`.
50 | //
51 | // Field masks are used to specify a subset of fields that should be
52 | // returned by a get operation or modified by an update operation.
53 | // Field masks also have a custom JSON encoding (see below).
54 | //
55 | // # Field Masks in Projections
56 | //
57 | // When used in the context of a projection, a response message or
58 | // sub-message is filtered by the API to only contain those fields as
59 | // specified in the mask. For example, if the mask in the previous
60 | // example is applied to a response message as follows:
61 | //
62 | // f {
63 | // a : 22
64 | // b {
65 | // d : 1
66 | // x : 2
67 | // }
68 | // y : 13
69 | // }
70 | // z: 8
71 | //
72 | // The result will not contain specific values for fields x,y and z
73 | // (their value will be set to the default, and omitted in proto text
74 | // output):
75 | //
76 | //
77 | // f {
78 | // a : 22
79 | // b {
80 | // d : 1
81 | // }
82 | // }
83 | //
84 | // A repeated field is not allowed except at the last position of a
85 | // paths string.
86 | //
87 | // If a FieldMask object is not present in a get operation, the
88 | // operation applies to all fields (as if a FieldMask of all fields
89 | // had been specified).
90 | //
91 | // Note that a field mask does not necessarily apply to the
92 | // top-level response message. In case of a REST get operation, the
93 | // field mask applies directly to the response, but in case of a REST
94 | // list operation, the mask instead applies to each individual message
95 | // in the returned resource list. In case of a REST custom method,
96 | // other definitions may be used. Where the mask applies will be
97 | // clearly documented together with its declaration in the API. In
98 | // any case, the effect on the returned resource/resources is required
99 | // behavior for APIs.
100 | //
101 | // # Field Masks in Update Operations
102 | //
103 | // A field mask in update operations specifies which fields of the
104 | // targeted resource are going to be updated. The API is required
105 | // to only change the values of the fields as specified in the mask
106 | // and leave the others untouched. If a resource is passed in to
107 | // describe the updated values, the API ignores the values of all
108 | // fields not covered by the mask.
109 | //
110 | // If a repeated field is specified for an update operation, the existing
111 | // repeated values in the target resource will be overwritten by the new values.
112 | // Note that a repeated field is only allowed in the last position of a `paths`
113 | // string.
114 | //
115 | // If a sub-message is specified in the last position of the field mask for an
116 | // update operation, then the existing sub-message in the target resource is
117 | // overwritten. Given the target message:
118 | //
119 | // f {
120 | // b {
121 | // d : 1
122 | // x : 2
123 | // }
124 | // c : 1
125 | // }
126 | //
127 | // And an update message:
128 | //
129 | // f {
130 | // b {
131 | // d : 10
132 | // }
133 | // }
134 | //
135 | // then if the field mask is:
136 | //
137 | // paths: "f.b"
138 | //
139 | // then the result will be:
140 | //
141 | // f {
142 | // b {
143 | // d : 10
144 | // }
145 | // c : 1
146 | // }
147 | //
148 | // However, if the update mask was:
149 | //
150 | // paths: "f.b.d"
151 | //
152 | // then the result would be:
153 | //
154 | // f {
155 | // b {
156 | // d : 10
157 | // x : 2
158 | // }
159 | // c : 1
160 | // }
161 | //
162 | // In order to reset a field's value to the default, the field must
163 | // be in the mask and set to the default value in the provided resource.
164 | // Hence, in order to reset all fields of a resource, provide a default
165 | // instance of the resource and set all fields in the mask, or do
166 | // not provide a mask as described below.
167 | //
168 | // If a field mask is not present on update, the operation applies to
169 | // all fields (as if a field mask of all fields has been specified).
170 | // Note that in the presence of schema evolution, this may mean that
171 | // fields the client does not know and has therefore not filled into
172 | // the request will be reset to their default. If this is unwanted
173 | // behavior, a specific service may require a client to always specify
174 | // a field mask, producing an error if not.
175 | //
176 | // As with get operations, the location of the resource which
177 | // describes the updated values in the request message depends on the
178 | // operation kind. In any case, the effect of the field mask is
179 | // required to be honored by the API.
180 | //
181 | // ## Considerations for HTTP REST
182 | //
183 | // The HTTP kind of an update operation which uses a field mask must
184 | // be set to PATCH instead of PUT in order to satisfy HTTP semantics
185 | // (PUT must only be used for full updates).
186 | //
187 | // # JSON Encoding of Field Masks
188 | //
189 | // In JSON, a field mask is encoded as a single string where paths are
190 | // separated by a comma. Fields name in each path are converted
191 | // to/from lower-camel naming conventions.
192 | //
193 | // As an example, consider the following message declarations:
194 | //
195 | // message Profile {
196 | // User user = 1;
197 | // Photo photo = 2;
198 | // }
199 | // message User {
200 | // string display_name = 1;
201 | // string address = 2;
202 | // }
203 | //
204 | // In proto a field mask for `Profile` may look as such:
205 | //
206 | // mask {
207 | // paths: "user.display_name"
208 | // paths: "photo"
209 | // }
210 | //
211 | // In JSON, the same mask is represented as below:
212 | //
213 | // {
214 | // mask: "user.displayName,photo"
215 | // }
216 | //
217 | // # Field Masks and Oneof Fields
218 | //
219 | // Field masks treat fields in oneofs just as regular fields. Consider the
220 | // following message:
221 | //
222 | // message SampleMessage {
223 | // oneof test_oneof {
224 | // string name = 4;
225 | // SubMessage sub_message = 9;
226 | // }
227 | // }
228 | //
229 | // The field mask can be:
230 | //
231 | // mask {
232 | // paths: "name"
233 | // }
234 | //
235 | // Or:
236 | //
237 | // mask {
238 | // paths: "sub_message"
239 | // }
240 | //
241 | // Note that oneof type names ("test_oneof" in this case) cannot be used in
242 | // paths.
243 | //
244 | // ## Field Mask Verification
245 | //
246 | // The implementation of the all the API methods, which have any FieldMask type
247 | // field in the request, should verify the included field paths, and return
248 | // `INVALID_ARGUMENT` error if any path is duplicated or unmappable.
249 | message FieldMask {
250 | // The set of field mask paths.
251 | repeated string paths = 1;
252 | }
253 |
--------------------------------------------------------------------------------
/src/main/proto/greet/greet.pb.go:
--------------------------------------------------------------------------------
1 | // Code generated by protoc-gen-go. DO NOT EDIT.
2 | // source: src/main/proto/greet/greet.proto
3 |
4 | package greet
5 |
6 | import proto "github.com/golang/protobuf/proto"
7 | import fmt "fmt"
8 | import math "math"
9 | import _ "google.golang.org/genproto/googleapis/api/annotations"
10 |
11 | import (
12 | context "golang.org/x/net/context"
13 | grpc "google.golang.org/grpc"
14 | )
15 |
16 | // Reference imports to suppress errors if they are not otherwise used.
17 | var _ = proto.Marshal
18 | var _ = fmt.Errorf
19 | var _ = math.Inf
20 |
21 | // This is a compile-time assertion to ensure that this generated file
22 | // is compatible with the proto package it is being compiled against.
23 | // A compilation error at this line likely means your copy of the
24 | // proto package needs to be updated.
25 | const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
26 |
27 | type Greeting struct {
28 | FirstName string `protobuf:"bytes,1,opt,name=first_name,json=firstName" json:"first_name,omitempty"`
29 | LastName string `protobuf:"bytes,2,opt,name=last_name,json=lastName" json:"last_name,omitempty"`
30 | XXX_NoUnkeyedLiteral struct{} `json:"-"`
31 | XXX_unrecognized []byte `json:"-"`
32 | XXX_sizecache int32 `json:"-"`
33 | }
34 |
35 | func (m *Greeting) Reset() { *m = Greeting{} }
36 | func (m *Greeting) String() string { return proto.CompactTextString(m) }
37 | func (*Greeting) ProtoMessage() {}
38 | func (*Greeting) Descriptor() ([]byte, []int) {
39 | return fileDescriptor_greet_b6cc28bd62e1bfe7, []int{0}
40 | }
41 | func (m *Greeting) XXX_Unmarshal(b []byte) error {
42 | return xxx_messageInfo_Greeting.Unmarshal(m, b)
43 | }
44 | func (m *Greeting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
45 | return xxx_messageInfo_Greeting.Marshal(b, m, deterministic)
46 | }
47 | func (dst *Greeting) XXX_Merge(src proto.Message) {
48 | xxx_messageInfo_Greeting.Merge(dst, src)
49 | }
50 | func (m *Greeting) XXX_Size() int {
51 | return xxx_messageInfo_Greeting.Size(m)
52 | }
53 | func (m *Greeting) XXX_DiscardUnknown() {
54 | xxx_messageInfo_Greeting.DiscardUnknown(m)
55 | }
56 |
57 | var xxx_messageInfo_Greeting proto.InternalMessageInfo
58 |
59 | func (m *Greeting) GetFirstName() string {
60 | if m != nil {
61 | return m.FirstName
62 | }
63 | return ""
64 | }
65 |
66 | func (m *Greeting) GetLastName() string {
67 | if m != nil {
68 | return m.LastName
69 | }
70 | return ""
71 | }
72 |
73 | type GreetRequest struct {
74 | Greeting *Greeting `protobuf:"bytes,1,opt,name=greeting" json:"greeting,omitempty"`
75 | XXX_NoUnkeyedLiteral struct{} `json:"-"`
76 | XXX_unrecognized []byte `json:"-"`
77 | XXX_sizecache int32 `json:"-"`
78 | }
79 |
80 | func (m *GreetRequest) Reset() { *m = GreetRequest{} }
81 | func (m *GreetRequest) String() string { return proto.CompactTextString(m) }
82 | func (*GreetRequest) ProtoMessage() {}
83 | func (*GreetRequest) Descriptor() ([]byte, []int) {
84 | return fileDescriptor_greet_b6cc28bd62e1bfe7, []int{1}
85 | }
86 | func (m *GreetRequest) XXX_Unmarshal(b []byte) error {
87 | return xxx_messageInfo_GreetRequest.Unmarshal(m, b)
88 | }
89 | func (m *GreetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
90 | return xxx_messageInfo_GreetRequest.Marshal(b, m, deterministic)
91 | }
92 | func (dst *GreetRequest) XXX_Merge(src proto.Message) {
93 | xxx_messageInfo_GreetRequest.Merge(dst, src)
94 | }
95 | func (m *GreetRequest) XXX_Size() int {
96 | return xxx_messageInfo_GreetRequest.Size(m)
97 | }
98 | func (m *GreetRequest) XXX_DiscardUnknown() {
99 | xxx_messageInfo_GreetRequest.DiscardUnknown(m)
100 | }
101 |
102 | var xxx_messageInfo_GreetRequest proto.InternalMessageInfo
103 |
104 | func (m *GreetRequest) GetGreeting() *Greeting {
105 | if m != nil {
106 | return m.Greeting
107 | }
108 | return nil
109 | }
110 |
111 | type GreetResponse struct {
112 | Result string `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"`
113 | XXX_NoUnkeyedLiteral struct{} `json:"-"`
114 | XXX_unrecognized []byte `json:"-"`
115 | XXX_sizecache int32 `json:"-"`
116 | }
117 |
118 | func (m *GreetResponse) Reset() { *m = GreetResponse{} }
119 | func (m *GreetResponse) String() string { return proto.CompactTextString(m) }
120 | func (*GreetResponse) ProtoMessage() {}
121 | func (*GreetResponse) Descriptor() ([]byte, []int) {
122 | return fileDescriptor_greet_b6cc28bd62e1bfe7, []int{2}
123 | }
124 | func (m *GreetResponse) XXX_Unmarshal(b []byte) error {
125 | return xxx_messageInfo_GreetResponse.Unmarshal(m, b)
126 | }
127 | func (m *GreetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
128 | return xxx_messageInfo_GreetResponse.Marshal(b, m, deterministic)
129 | }
130 | func (dst *GreetResponse) XXX_Merge(src proto.Message) {
131 | xxx_messageInfo_GreetResponse.Merge(dst, src)
132 | }
133 | func (m *GreetResponse) XXX_Size() int {
134 | return xxx_messageInfo_GreetResponse.Size(m)
135 | }
136 | func (m *GreetResponse) XXX_DiscardUnknown() {
137 | xxx_messageInfo_GreetResponse.DiscardUnknown(m)
138 | }
139 |
140 | var xxx_messageInfo_GreetResponse proto.InternalMessageInfo
141 |
142 | func (m *GreetResponse) GetResult() string {
143 | if m != nil {
144 | return m.Result
145 | }
146 | return ""
147 | }
148 |
149 | func init() {
150 | proto.RegisterType((*Greeting)(nil), "greet.Greeting")
151 | proto.RegisterType((*GreetRequest)(nil), "greet.GreetRequest")
152 | proto.RegisterType((*GreetResponse)(nil), "greet.GreetResponse")
153 | }
154 |
155 | // Reference imports to suppress errors if they are not otherwise used.
156 | var _ context.Context
157 | var _ grpc.ClientConn
158 |
159 | // This is a compile-time assertion to ensure that this generated file
160 | // is compatible with the grpc package it is being compiled against.
161 | const _ = grpc.SupportPackageIsVersion4
162 |
163 | // GreetServiceClient is the client API for GreetService service.
164 | //
165 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
166 | type GreetServiceClient interface {
167 | // Unary API
168 | Greet(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetResponse, error)
169 | }
170 |
171 | type greetServiceClient struct {
172 | cc *grpc.ClientConn
173 | }
174 |
175 | func NewGreetServiceClient(cc *grpc.ClientConn) GreetServiceClient {
176 | return &greetServiceClient{cc}
177 | }
178 |
179 | func (c *greetServiceClient) Greet(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetResponse, error) {
180 | out := new(GreetResponse)
181 | err := c.cc.Invoke(ctx, "/greet.GreetService/Greet", in, out, opts...)
182 | if err != nil {
183 | return nil, err
184 | }
185 | return out, nil
186 | }
187 |
188 | // GreetServiceServer is the server API for GreetService service.
189 | type GreetServiceServer interface {
190 | // Unary API
191 | Greet(context.Context, *GreetRequest) (*GreetResponse, error)
192 | }
193 |
194 | func RegisterGreetServiceServer(s *grpc.Server, srv GreetServiceServer) {
195 | s.RegisterService(&_GreetService_serviceDesc, srv)
196 | }
197 |
198 | func _GreetService_Greet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
199 | in := new(GreetRequest)
200 | if err := dec(in); err != nil {
201 | return nil, err
202 | }
203 | if interceptor == nil {
204 | return srv.(GreetServiceServer).Greet(ctx, in)
205 | }
206 | info := &grpc.UnaryServerInfo{
207 | Server: srv,
208 | FullMethod: "/greet.GreetService/Greet",
209 | }
210 | handler := func(ctx context.Context, req interface{}) (interface{}, error) {
211 | return srv.(GreetServiceServer).Greet(ctx, req.(*GreetRequest))
212 | }
213 | return interceptor(ctx, in, info, handler)
214 | }
215 |
216 | var _GreetService_serviceDesc = grpc.ServiceDesc{
217 | ServiceName: "greet.GreetService",
218 | HandlerType: (*GreetServiceServer)(nil),
219 | Methods: []grpc.MethodDesc{
220 | {
221 | MethodName: "Greet",
222 | Handler: _GreetService_Greet_Handler,
223 | },
224 | },
225 | Streams: []grpc.StreamDesc{},
226 | Metadata: "src/main/proto/greet/greet.proto",
227 | }
228 |
229 | func init() {
230 | proto.RegisterFile("src/main/proto/greet/greet.proto", fileDescriptor_greet_b6cc28bd62e1bfe7)
231 | }
232 |
233 | var fileDescriptor_greet_b6cc28bd62e1bfe7 = []byte{
234 | // 265 bytes of a gzipped FileDescriptorProto
235 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xc1, 0x4a, 0x03, 0x31,
236 | 0x10, 0x86, 0xd9, 0x42, 0x4b, 0x77, 0x54, 0x2a, 0xa9, 0x8a, 0xb4, 0x0a, 0x25, 0x17, 0x45, 0xa1,
237 | 0xc1, 0x7a, 0xd3, 0x9b, 0x07, 0xbd, 0xa9, 0xac, 0x0f, 0x50, 0xe2, 0x32, 0xc6, 0xc0, 0x26, 0xb3,
238 | 0x26, 0x69, 0xf1, 0xec, 0x2b, 0xf8, 0x68, 0xbe, 0x82, 0x0f, 0x22, 0x9b, 0xa4, 0xa2, 0x97, 0xc0,
239 | 0xff, 0xcf, 0x3f, 0xdf, 0xfc, 0x04, 0x66, 0xde, 0xd5, 0xc2, 0x48, 0x6d, 0x45, 0xeb, 0x28, 0x90,
240 | 0x50, 0x0e, 0x31, 0xa4, 0x77, 0x1e, 0x1d, 0xd6, 0x8f, 0x62, 0x72, 0xa4, 0x88, 0x54, 0x83, 0x42,
241 | 0xb6, 0x5a, 0x48, 0x6b, 0x29, 0xc8, 0xa0, 0xc9, 0xfa, 0x14, 0xe2, 0xb7, 0x30, 0xbc, 0xeb, 0x62,
242 | 0xda, 0x2a, 0x76, 0x0c, 0xf0, 0xa2, 0x9d, 0x0f, 0x4b, 0x2b, 0x0d, 0x1e, 0x16, 0xb3, 0xe2, 0xb4,
243 | 0xac, 0xca, 0xe8, 0xdc, 0x4b, 0x83, 0x6c, 0x0a, 0x65, 0x23, 0x37, 0xd3, 0x5e, 0x9c, 0x0e, 0x3b,
244 | 0xa3, 0x1b, 0xf2, 0x6b, 0xd8, 0x8e, 0x9c, 0x0a, 0xdf, 0x56, 0xe8, 0x03, 0x3b, 0x87, 0xa1, 0xca,
245 | 0xdc, 0x48, 0xda, 0x5a, 0x8c, 0xe6, 0xa9, 0xdc, 0xe6, 0x5c, 0xf5, 0x1b, 0xe0, 0x27, 0xb0, 0x93,
246 | 0x97, 0x7d, 0x4b, 0xd6, 0x23, 0x3b, 0x80, 0x81, 0x43, 0xbf, 0x6a, 0x42, 0x6e, 0x91, 0xd5, 0x62,
247 | 0x99, 0xaf, 0x3c, 0xa1, 0x5b, 0xeb, 0x1a, 0xd9, 0x03, 0xf4, 0xa3, 0x66, 0xe3, 0xbf, 0xf0, 0xdc,
248 | 0x61, 0xb2, 0xf7, 0xdf, 0x4c, 0x6c, 0x3e, 0xfd, 0xf8, 0xfa, 0xfe, 0xec, 0xed, 0xf3, 0x5d, 0xb1,
249 | 0xbe, 0x10, 0xf8, 0x2e, 0x4d, 0xdb, 0xa0, 0xc0, 0xfa, 0x95, 0xae, 0x8a, 0xb3, 0x9b, 0x31, 0x8c,
250 | 0x6a, 0x32, 0xe9, 0x6f, 0xd2, 0xf6, 0x63, 0xf1, 0x3c, 0x88, 0xf2, 0xf2, 0x27, 0x00, 0x00, 0xff,
251 | 0xff, 0x6e, 0xfc, 0xbd, 0x5b, 0x73, 0x01, 0x00, 0x00,
252 | }
253 |
--------------------------------------------------------------------------------
/src/main/proto/greet/greet.pb.gw.go:
--------------------------------------------------------------------------------
1 | // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
2 | // source: src/main/proto/greet/greet.proto
3 |
4 | /*
5 | Package greet is a reverse proxy.
6 |
7 | It translates gRPC into RESTful JSON APIs.
8 | */
9 | package greet
10 |
11 | import (
12 | "io"
13 | "net/http"
14 |
15 | "github.com/golang/protobuf/proto"
16 | "github.com/grpc-ecosystem/grpc-gateway/runtime"
17 | "github.com/grpc-ecosystem/grpc-gateway/utilities"
18 | "golang.org/x/net/context"
19 | "google.golang.org/grpc"
20 | "google.golang.org/grpc/codes"
21 | "google.golang.org/grpc/grpclog"
22 | "google.golang.org/grpc/status"
23 | )
24 |
25 | var _ codes.Code
26 | var _ io.Reader
27 | var _ status.Status
28 | var _ = runtime.String
29 | var _ = utilities.NewDoubleArray
30 |
31 | func request_GreetService_Greet_0(ctx context.Context, marshaler runtime.Marshaler, client GreetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
32 | var protoReq GreetRequest
33 | var metadata runtime.ServerMetadata
34 |
35 | if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
36 | return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
37 | }
38 |
39 | msg, err := client.Greet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
40 | return msg, metadata, err
41 |
42 | }
43 |
44 | // RegisterGreetServiceHandlerFromEndpoint is same as RegisterGreetServiceHandler but
45 | // automatically dials to "endpoint" and closes the connection when "ctx" gets done.
46 | func RegisterGreetServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
47 | conn, err := grpc.Dial(endpoint, opts...)
48 | if err != nil {
49 | return err
50 | }
51 | defer func() {
52 | if err != nil {
53 | if cerr := conn.Close(); cerr != nil {
54 | grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
55 | }
56 | return
57 | }
58 | go func() {
59 | <-ctx.Done()
60 | if cerr := conn.Close(); cerr != nil {
61 | grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
62 | }
63 | }()
64 | }()
65 |
66 | return RegisterGreetServiceHandler(ctx, mux, conn)
67 | }
68 |
69 | // RegisterGreetServiceHandler registers the http handlers for service GreetService to "mux".
70 | // The handlers forward requests to the grpc endpoint over "conn".
71 | func RegisterGreetServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
72 | return RegisterGreetServiceHandlerClient(ctx, mux, NewGreetServiceClient(conn))
73 | }
74 |
75 | // RegisterGreetServiceHandler registers the http handlers for service GreetService to "mux".
76 | // The handlers forward requests to the grpc endpoint over the given implementation of "GreetServiceClient".
77 | // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "GreetServiceClient"
78 | // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
79 | // "GreetServiceClient" to call the correct interceptors.
80 | func RegisterGreetServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreetServiceClient) error {
81 |
82 | mux.Handle("POST", pattern_GreetService_Greet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
83 | ctx, cancel := context.WithCancel(req.Context())
84 | defer cancel()
85 | if cn, ok := w.(http.CloseNotifier); ok {
86 | go func(done <-chan struct{}, closed <-chan bool) {
87 | select {
88 | case <-done:
89 | case <-closed:
90 | cancel()
91 | }
92 | }(ctx.Done(), cn.CloseNotify())
93 | }
94 | inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
95 | rctx, err := runtime.AnnotateContext(ctx, mux, req)
96 | if err != nil {
97 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
98 | return
99 | }
100 | resp, md, err := request_GreetService_Greet_0(rctx, inboundMarshaler, client, req, pathParams)
101 | ctx = runtime.NewServerMetadataContext(ctx, md)
102 | if err != nil {
103 | runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
104 | return
105 | }
106 |
107 | forward_GreetService_Greet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
108 |
109 | })
110 |
111 | return nil
112 | }
113 |
114 | var (
115 | pattern_GreetService_Greet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "example", "echo"}, ""))
116 | )
117 |
118 | var (
119 | forward_GreetService_Greet_0 = runtime.ForwardResponseMessage
120 | )
121 |
--------------------------------------------------------------------------------
/src/main/proto/greet/greet.swagger.json:
--------------------------------------------------------------------------------
1 | {
2 | "swagger": "2.0",
3 | "info": {
4 | "title": "src/main/proto/greet/greet.proto",
5 | "version": "version not set"
6 | },
7 | "schemes": [
8 | "http",
9 | "https"
10 | ],
11 | "consumes": [
12 | "application/json"
13 | ],
14 | "produces": [
15 | "application/json"
16 | ],
17 | "paths": {
18 | "/v1/example/echo": {
19 | "post": {
20 | "summary": "Unary API",
21 | "operationId": "Greet",
22 | "responses": {
23 | "200": {
24 | "description": "",
25 | "schema": {
26 | "$ref": "#/definitions/greetGreetResponse"
27 | }
28 | }
29 | },
30 | "parameters": [
31 | {
32 | "name": "body",
33 | "in": "body",
34 | "required": true,
35 | "schema": {
36 | "$ref": "#/definitions/greetGreetRequest"
37 | }
38 | }
39 | ],
40 | "tags": [
41 | "GreetService"
42 | ]
43 | }
44 | }
45 | },
46 | "definitions": {
47 | "greetGreetRequest": {
48 | "type": "object",
49 | "properties": {
50 | "greeting": {
51 | "$ref": "#/definitions/greetGreeting"
52 | }
53 | }
54 | },
55 | "greetGreetResponse": {
56 | "type": "object",
57 | "properties": {
58 | "result": {
59 | "type": "string"
60 | }
61 | }
62 | },
63 | "greetGreeting": {
64 | "type": "object",
65 | "properties": {
66 | "first_name": {
67 | "type": "string"
68 | },
69 | "last_name": {
70 | "type": "string"
71 | }
72 | }
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------