diff --git a/gen/dart/proto/services/user_svc/v1/organization_svc.pb.dart b/gen/dart/proto/services/user_svc/v1/organization_svc.pb.dart new file mode 100644 index 000000000..fba80ec16 --- /dev/null +++ b/gen/dart/proto/services/user_svc/v1/organization_svc.pb.dart @@ -0,0 +1,367 @@ +/// +// Generated code. Do not modify. +// source: proto/services/user_svc/v1/organization_svc.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:async' as $async; +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; + +class CreateOrganizationRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateOrganizationRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'proto.services.user_svc.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'longName') + ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'shortName') + ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'contactEmail') + ..hasRequiredFields = false + ; + + CreateOrganizationRequest._() : super(); + factory CreateOrganizationRequest({ + $core.String? longName, + $core.String? shortName, + $core.String? contactEmail, + }) { + final _result = create(); + if (longName != null) { + _result.longName = longName; + } + if (shortName != null) { + _result.shortName = shortName; + } + if (contactEmail != null) { + _result.contactEmail = contactEmail; + } + return _result; + } + factory CreateOrganizationRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory CreateOrganizationRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + CreateOrganizationRequest clone() => CreateOrganizationRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + CreateOrganizationRequest copyWith(void Function(CreateOrganizationRequest) updates) => super.copyWith((message) => updates(message as CreateOrganizationRequest)) as CreateOrganizationRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static CreateOrganizationRequest create() => CreateOrganizationRequest._(); + CreateOrganizationRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static CreateOrganizationRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static CreateOrganizationRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get longName => $_getSZ(0); + @$pb.TagNumber(1) + set longName($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasLongName() => $_has(0); + @$pb.TagNumber(1) + void clearLongName() => clearField(1); + + @$pb.TagNumber(2) + $core.String get shortName => $_getSZ(1); + @$pb.TagNumber(2) + set shortName($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasShortName() => $_has(1); + @$pb.TagNumber(2) + void clearShortName() => clearField(2); + + @$pb.TagNumber(3) + $core.String get contactEmail => $_getSZ(2); + @$pb.TagNumber(3) + set contactEmail($core.String v) { $_setString(2, v); } + @$pb.TagNumber(3) + $core.bool hasContactEmail() => $_has(2); + @$pb.TagNumber(3) + void clearContactEmail() => clearField(3); +} + +class CreateOrganizationResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateOrganizationResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'proto.services.user_svc.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id') + ..hasRequiredFields = false + ; + + CreateOrganizationResponse._() : super(); + factory CreateOrganizationResponse({ + $core.String? id, + }) { + final _result = create(); + if (id != null) { + _result.id = id; + } + return _result; + } + factory CreateOrganizationResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory CreateOrganizationResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + CreateOrganizationResponse clone() => CreateOrganizationResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + CreateOrganizationResponse copyWith(void Function(CreateOrganizationResponse) updates) => super.copyWith((message) => updates(message as CreateOrganizationResponse)) as CreateOrganizationResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static CreateOrganizationResponse create() => CreateOrganizationResponse._(); + CreateOrganizationResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static CreateOrganizationResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static CreateOrganizationResponse? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get id => $_getSZ(0); + @$pb.TagNumber(1) + set id($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasId() => $_has(0); + @$pb.TagNumber(1) + void clearId() => clearField(1); +} + +class Member extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Member', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'proto.services.user_svc.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'userId') + ..hasRequiredFields = false + ; + + Member._() : super(); + factory Member({ + $core.String? userId, + }) { + final _result = create(); + if (userId != null) { + _result.userId = userId; + } + return _result; + } + factory Member.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Member.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Member clone() => Member()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Member copyWith(void Function(Member) updates) => super.copyWith((message) => updates(message as Member)) as Member; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Member create() => Member._(); + Member createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Member getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Member? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get userId => $_getSZ(0); + @$pb.TagNumber(1) + set userId($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasUserId() => $_has(0); + @$pb.TagNumber(1) + void clearUserId() => clearField(1); +} + +class GetOrganizationRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetOrganizationRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'proto.services.user_svc.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id') + ..hasRequiredFields = false + ; + + GetOrganizationRequest._() : super(); + factory GetOrganizationRequest({ + $core.String? id, + }) { + final _result = create(); + if (id != null) { + _result.id = id; + } + return _result; + } + factory GetOrganizationRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetOrganizationRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetOrganizationRequest clone() => GetOrganizationRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetOrganizationRequest copyWith(void Function(GetOrganizationRequest) updates) => super.copyWith((message) => updates(message as GetOrganizationRequest)) as GetOrganizationRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetOrganizationRequest create() => GetOrganizationRequest._(); + GetOrganizationRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetOrganizationRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetOrganizationRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get id => $_getSZ(0); + @$pb.TagNumber(1) + set id($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasId() => $_has(0); + @$pb.TagNumber(1) + void clearId() => clearField(1); +} + +class GetOrganizationResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetOrganizationResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'proto.services.user_svc.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id') + ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'longName') + ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'shortName') + ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'contactEmail') + ..aOS(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'avatarUrl') + ..aOB(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'isPersonal') + ..pc(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'members', $pb.PbFieldType.PM, subBuilder: Member.create) + ..hasRequiredFields = false + ; + + GetOrganizationResponse._() : super(); + factory GetOrganizationResponse({ + $core.String? id, + $core.String? longName, + $core.String? shortName, + $core.String? contactEmail, + $core.String? avatarUrl, + $core.bool? isPersonal, + $core.Iterable? members, + }) { + final _result = create(); + if (id != null) { + _result.id = id; + } + if (longName != null) { + _result.longName = longName; + } + if (shortName != null) { + _result.shortName = shortName; + } + if (contactEmail != null) { + _result.contactEmail = contactEmail; + } + if (avatarUrl != null) { + _result.avatarUrl = avatarUrl; + } + if (isPersonal != null) { + _result.isPersonal = isPersonal; + } + if (members != null) { + _result.members.addAll(members); + } + return _result; + } + factory GetOrganizationResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetOrganizationResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetOrganizationResponse clone() => GetOrganizationResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetOrganizationResponse copyWith(void Function(GetOrganizationResponse) updates) => super.copyWith((message) => updates(message as GetOrganizationResponse)) as GetOrganizationResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetOrganizationResponse create() => GetOrganizationResponse._(); + GetOrganizationResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetOrganizationResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetOrganizationResponse? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get id => $_getSZ(0); + @$pb.TagNumber(1) + set id($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasId() => $_has(0); + @$pb.TagNumber(1) + void clearId() => clearField(1); + + @$pb.TagNumber(2) + $core.String get longName => $_getSZ(1); + @$pb.TagNumber(2) + set longName($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasLongName() => $_has(1); + @$pb.TagNumber(2) + void clearLongName() => clearField(2); + + @$pb.TagNumber(3) + $core.String get shortName => $_getSZ(2); + @$pb.TagNumber(3) + set shortName($core.String v) { $_setString(2, v); } + @$pb.TagNumber(3) + $core.bool hasShortName() => $_has(2); + @$pb.TagNumber(3) + void clearShortName() => clearField(3); + + @$pb.TagNumber(4) + $core.String get contactEmail => $_getSZ(3); + @$pb.TagNumber(4) + set contactEmail($core.String v) { $_setString(3, v); } + @$pb.TagNumber(4) + $core.bool hasContactEmail() => $_has(3); + @$pb.TagNumber(4) + void clearContactEmail() => clearField(4); + + @$pb.TagNumber(5) + $core.String get avatarUrl => $_getSZ(4); + @$pb.TagNumber(5) + set avatarUrl($core.String v) { $_setString(4, v); } + @$pb.TagNumber(5) + $core.bool hasAvatarUrl() => $_has(4); + @$pb.TagNumber(5) + void clearAvatarUrl() => clearField(5); + + @$pb.TagNumber(6) + $core.bool get isPersonal => $_getBF(5); + @$pb.TagNumber(6) + set isPersonal($core.bool v) { $_setBool(5, v); } + @$pb.TagNumber(6) + $core.bool hasIsPersonal() => $_has(5); + @$pb.TagNumber(6) + void clearIsPersonal() => clearField(6); + + @$pb.TagNumber(7) + $core.List get members => $_getList(6); +} + +class OrganizationServiceApi { + $pb.RpcClient _client; + OrganizationServiceApi(this._client); + + $async.Future createOrganization($pb.ClientContext? ctx, CreateOrganizationRequest request) { + var emptyResponse = CreateOrganizationResponse(); + return _client.invoke(ctx, 'OrganizationService', 'CreateOrganization', request, emptyResponse); + } + $async.Future getOrganization($pb.ClientContext? ctx, GetOrganizationRequest request) { + var emptyResponse = GetOrganizationResponse(); + return _client.invoke(ctx, 'OrganizationService', 'GetOrganization', request, emptyResponse); + } +} + diff --git a/gen/dart/proto/services/user_svc/v1/organization_svc.pbenum.dart b/gen/dart/proto/services/user_svc/v1/organization_svc.pbenum.dart new file mode 100644 index 000000000..4e0036789 --- /dev/null +++ b/gen/dart/proto/services/user_svc/v1/organization_svc.pbenum.dart @@ -0,0 +1,7 @@ +/// +// Generated code. Do not modify. +// source: proto/services/user_svc/v1/organization_svc.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + diff --git a/gen/dart/proto/services/user_svc/v1/organization_svc.pbjson.dart b/gen/dart/proto/services/user_svc/v1/organization_svc.pbjson.dart new file mode 100644 index 000000000..bebc331a4 --- /dev/null +++ b/gen/dart/proto/services/user_svc/v1/organization_svc.pbjson.dart @@ -0,0 +1,87 @@ +/// +// Generated code. Do not modify. +// source: proto/services/user_svc/v1/organization_svc.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:core' as $core; +import 'dart:convert' as $convert; +import 'dart:typed_data' as $typed_data; +@$core.Deprecated('Use createOrganizationRequestDescriptor instead') +const CreateOrganizationRequest$json = const { + '1': 'CreateOrganizationRequest', + '2': const [ + const {'1': 'long_name', '3': 1, '4': 1, '5': 9, '10': 'longName'}, + const {'1': 'short_name', '3': 2, '4': 1, '5': 9, '10': 'shortName'}, + const {'1': 'contact_email', '3': 3, '4': 1, '5': 9, '10': 'contactEmail'}, + ], +}; + +/// Descriptor for `CreateOrganizationRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List createOrganizationRequestDescriptor = $convert.base64Decode('ChlDcmVhdGVPcmdhbml6YXRpb25SZXF1ZXN0EhsKCWxvbmdfbmFtZRgBIAEoCVIIbG9uZ05hbWUSHQoKc2hvcnRfbmFtZRgCIAEoCVIJc2hvcnROYW1lEiMKDWNvbnRhY3RfZW1haWwYAyABKAlSDGNvbnRhY3RFbWFpbA=='); +@$core.Deprecated('Use createOrganizationResponseDescriptor instead') +const CreateOrganizationResponse$json = const { + '1': 'CreateOrganizationResponse', + '2': const [ + const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, + ], +}; + +/// Descriptor for `CreateOrganizationResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List createOrganizationResponseDescriptor = $convert.base64Decode('ChpDcmVhdGVPcmdhbml6YXRpb25SZXNwb25zZRIOCgJpZBgBIAEoCVICaWQ='); +@$core.Deprecated('Use memberDescriptor instead') +const Member$json = const { + '1': 'Member', + '2': const [ + const {'1': 'user_id', '3': 1, '4': 1, '5': 9, '10': 'userId'}, + ], +}; + +/// Descriptor for `Member`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List memberDescriptor = $convert.base64Decode('CgZNZW1iZXISFwoHdXNlcl9pZBgBIAEoCVIGdXNlcklk'); +@$core.Deprecated('Use getOrganizationRequestDescriptor instead') +const GetOrganizationRequest$json = const { + '1': 'GetOrganizationRequest', + '2': const [ + const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, + ], +}; + +/// Descriptor for `GetOrganizationRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getOrganizationRequestDescriptor = $convert.base64Decode('ChZHZXRPcmdhbml6YXRpb25SZXF1ZXN0Eg4KAmlkGAEgASgJUgJpZA=='); +@$core.Deprecated('Use getOrganizationResponseDescriptor instead') +const GetOrganizationResponse$json = const { + '1': 'GetOrganizationResponse', + '2': const [ + const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, + const {'1': 'long_name', '3': 2, '4': 1, '5': 9, '10': 'longName'}, + const {'1': 'short_name', '3': 3, '4': 1, '5': 9, '10': 'shortName'}, + const {'1': 'contact_email', '3': 4, '4': 1, '5': 9, '10': 'contactEmail'}, + const {'1': 'avatar_url', '3': 5, '4': 1, '5': 9, '10': 'avatarUrl'}, + const {'1': 'is_personal', '3': 6, '4': 1, '5': 8, '10': 'isPersonal'}, + const {'1': 'members', '3': 7, '4': 3, '5': 11, '6': '.proto.services.user_svc.v1.Member', '10': 'members'}, + ], +}; + +/// Descriptor for `GetOrganizationResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getOrganizationResponseDescriptor = $convert.base64Decode('ChdHZXRPcmdhbml6YXRpb25SZXNwb25zZRIOCgJpZBgBIAEoCVICaWQSGwoJbG9uZ19uYW1lGAIgASgJUghsb25nTmFtZRIdCgpzaG9ydF9uYW1lGAMgASgJUglzaG9ydE5hbWUSIwoNY29udGFjdF9lbWFpbBgEIAEoCVIMY29udGFjdEVtYWlsEh0KCmF2YXRhcl91cmwYBSABKAlSCWF2YXRhclVybBIfCgtpc19wZXJzb25hbBgGIAEoCFIKaXNQZXJzb25hbBI8CgdtZW1iZXJzGAcgAygLMiIucHJvdG8uc2VydmljZXMudXNlcl9zdmMudjEuTWVtYmVyUgdtZW1iZXJz'); +const $core.Map<$core.String, $core.dynamic> OrganizationServiceBase$json = const { + '1': 'OrganizationService', + '2': const [ + const {'1': 'CreateOrganization', '2': '.proto.services.user_svc.v1.CreateOrganizationRequest', '3': '.proto.services.user_svc.v1.CreateOrganizationResponse', '4': const {}}, + const {'1': 'GetOrganization', '2': '.proto.services.user_svc.v1.GetOrganizationRequest', '3': '.proto.services.user_svc.v1.GetOrganizationResponse', '4': const {}}, + ], +}; + +@$core.Deprecated('Use organizationServiceDescriptor instead') +const $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> OrganizationServiceBase$messageJson = const { + '.proto.services.user_svc.v1.CreateOrganizationRequest': CreateOrganizationRequest$json, + '.proto.services.user_svc.v1.CreateOrganizationResponse': CreateOrganizationResponse$json, + '.proto.services.user_svc.v1.GetOrganizationRequest': GetOrganizationRequest$json, + '.proto.services.user_svc.v1.GetOrganizationResponse': GetOrganizationResponse$json, + '.proto.services.user_svc.v1.Member': Member$json, +}; + +/// Descriptor for `OrganizationService`. Decode as a `google.protobuf.ServiceDescriptorProto`. +final $typed_data.Uint8List organizationServiceDescriptor = $convert.base64Decode('ChNPcmdhbml6YXRpb25TZXJ2aWNlEoUBChJDcmVhdGVPcmdhbml6YXRpb24SNS5wcm90by5zZXJ2aWNlcy51c2VyX3N2Yy52MS5DcmVhdGVPcmdhbml6YXRpb25SZXF1ZXN0GjYucHJvdG8uc2VydmljZXMudXNlcl9zdmMudjEuQ3JlYXRlT3JnYW5pemF0aW9uUmVzcG9uc2UiABJ8Cg9HZXRPcmdhbml6YXRpb24SMi5wcm90by5zZXJ2aWNlcy51c2VyX3N2Yy52MS5HZXRPcmdhbml6YXRpb25SZXF1ZXN0GjMucHJvdG8uc2VydmljZXMudXNlcl9zdmMudjEuR2V0T3JnYW5pemF0aW9uUmVzcG9uc2UiAA=='); diff --git a/gen/dart/proto/services/user_svc/v1/organization_svc.pbserver.dart b/gen/dart/proto/services/user_svc/v1/organization_svc.pbserver.dart new file mode 100644 index 000000000..6451461eb --- /dev/null +++ b/gen/dart/proto/services/user_svc/v1/organization_svc.pbserver.dart @@ -0,0 +1,41 @@ +/// +// Generated code. Do not modify. +// source: proto/services/user_svc/v1/organization_svc.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name + +import 'dart:async' as $async; + +import 'package:protobuf/protobuf.dart' as $pb; + +import 'dart:core' as $core; +import 'organization_svc.pb.dart' as $6; +import 'organization_svc.pbjson.dart'; + +export 'organization_svc.pb.dart'; + +abstract class OrganizationServiceBase extends $pb.GeneratedService { + $async.Future<$6.CreateOrganizationResponse> createOrganization($pb.ServerContext ctx, $6.CreateOrganizationRequest request); + $async.Future<$6.GetOrganizationResponse> getOrganization($pb.ServerContext ctx, $6.GetOrganizationRequest request); + + $pb.GeneratedMessage createRequest($core.String method) { + switch (method) { + case 'CreateOrganization': return $6.CreateOrganizationRequest(); + case 'GetOrganization': return $6.GetOrganizationRequest(); + default: throw $core.ArgumentError('Unknown method: $method'); + } + } + + $async.Future<$pb.GeneratedMessage> handleCall($pb.ServerContext ctx, $core.String method, $pb.GeneratedMessage request) { + switch (method) { + case 'CreateOrganization': return this.createOrganization(ctx, request as $6.CreateOrganizationRequest); + case 'GetOrganization': return this.getOrganization(ctx, request as $6.GetOrganizationRequest); + default: throw $core.ArgumentError('Unknown method: $method'); + } + } + + $core.Map<$core.String, $core.dynamic> get $json => OrganizationServiceBase$json; + $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> get $messageJson => OrganizationServiceBase$messageJson; +} + diff --git a/gen/dart/proto/services/user_svc/v1/user_svc.pb.dart b/gen/dart/proto/services/user_svc/v1/user_svc.pb.dart index e64964c42..f21557040 100644 --- a/gen/dart/proto/services/user_svc/v1/user_svc.pb.dart +++ b/gen/dart/proto/services/user_svc/v1/user_svc.pb.dart @@ -12,35 +12,11 @@ import 'package:protobuf/protobuf.dart' as $pb; class CreateUserRequest extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateUserRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'proto.services.user_svc.v1'), createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email') - ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'nickname') - ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fullName') - ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'password') ..hasRequiredFields = false ; CreateUserRequest._() : super(); - factory CreateUserRequest({ - $core.String? email, - $core.String? nickname, - $core.String? fullName, - $core.String? password, - }) { - final _result = create(); - if (email != null) { - _result.email = email; - } - if (nickname != null) { - _result.nickname = nickname; - } - if (fullName != null) { - _result.fullName = fullName; - } - if (password != null) { - _result.password = password; - } - return _result; - } + factory CreateUserRequest() => create(); factory CreateUserRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory CreateUserRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( @@ -61,60 +37,15 @@ class CreateUserRequest extends $pb.GeneratedMessage { @$core.pragma('dart2js:noInline') static CreateUserRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static CreateUserRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get email => $_getSZ(0); - @$pb.TagNumber(1) - set email($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasEmail() => $_has(0); - @$pb.TagNumber(1) - void clearEmail() => clearField(1); - - @$pb.TagNumber(2) - $core.String get nickname => $_getSZ(1); - @$pb.TagNumber(2) - set nickname($core.String v) { $_setString(1, v); } - @$pb.TagNumber(2) - $core.bool hasNickname() => $_has(1); - @$pb.TagNumber(2) - void clearNickname() => clearField(2); - - @$pb.TagNumber(3) - $core.String get fullName => $_getSZ(2); - @$pb.TagNumber(3) - set fullName($core.String v) { $_setString(2, v); } - @$pb.TagNumber(3) - $core.bool hasFullName() => $_has(2); - @$pb.TagNumber(3) - void clearFullName() => clearField(3); - - @$pb.TagNumber(4) - $core.String get password => $_getSZ(3); - @$pb.TagNumber(4) - set password($core.String v) { $_setString(3, v); } - @$pb.TagNumber(4) - $core.bool hasPassword() => $_has(3); - @$pb.TagNumber(4) - void clearPassword() => clearField(4); } class CreateUserResponse extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateUserResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'proto.services.user_svc.v1'), createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'userId') ..hasRequiredFields = false ; CreateUserResponse._() : super(); - factory CreateUserResponse({ - $core.String? userId, - }) { - final _result = create(); - if (userId != null) { - _result.userId = userId; - } - return _result; - } + factory CreateUserResponse() => create(); factory CreateUserResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory CreateUserResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( @@ -135,53 +66,15 @@ class CreateUserResponse extends $pb.GeneratedMessage { @$core.pragma('dart2js:noInline') static CreateUserResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static CreateUserResponse? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get userId => $_getSZ(0); - @$pb.TagNumber(1) - set userId($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasUserId() => $_has(0); - @$pb.TagNumber(1) - void clearUserId() => clearField(1); } class UpdateUserRequest extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UpdateUserRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'proto.services.user_svc.v1'), createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'userId') - ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fullName') - ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'nickname') - ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email') - ..aOS(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'password') ..hasRequiredFields = false ; UpdateUserRequest._() : super(); - factory UpdateUserRequest({ - $core.String? userId, - $core.String? fullName, - $core.String? nickname, - $core.String? email, - $core.String? password, - }) { - final _result = create(); - if (userId != null) { - _result.userId = userId; - } - if (fullName != null) { - _result.fullName = fullName; - } - if (nickname != null) { - _result.nickname = nickname; - } - if (email != null) { - _result.email = email; - } - if (password != null) { - _result.password = password; - } - return _result; - } + factory UpdateUserRequest() => create(); factory UpdateUserRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); factory UpdateUserRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); @$core.Deprecated( @@ -202,51 +95,6 @@ class UpdateUserRequest extends $pb.GeneratedMessage { @$core.pragma('dart2js:noInline') static UpdateUserRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static UpdateUserRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get userId => $_getSZ(0); - @$pb.TagNumber(1) - set userId($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasUserId() => $_has(0); - @$pb.TagNumber(1) - void clearUserId() => clearField(1); - - @$pb.TagNumber(2) - $core.String get fullName => $_getSZ(1); - @$pb.TagNumber(2) - set fullName($core.String v) { $_setString(1, v); } - @$pb.TagNumber(2) - $core.bool hasFullName() => $_has(1); - @$pb.TagNumber(2) - void clearFullName() => clearField(2); - - @$pb.TagNumber(3) - $core.String get nickname => $_getSZ(2); - @$pb.TagNumber(3) - set nickname($core.String v) { $_setString(2, v); } - @$pb.TagNumber(3) - $core.bool hasNickname() => $_has(2); - @$pb.TagNumber(3) - void clearNickname() => clearField(3); - - @$pb.TagNumber(4) - $core.String get email => $_getSZ(3); - @$pb.TagNumber(4) - set email($core.String v) { $_setString(3, v); } - @$pb.TagNumber(4) - $core.bool hasEmail() => $_has(3); - @$pb.TagNumber(4) - void clearEmail() => clearField(4); - - @$pb.TagNumber(5) - $core.String get password => $_getSZ(4); - @$pb.TagNumber(5) - set password($core.String v) { $_setString(4, v); } - @$pb.TagNumber(5) - $core.bool hasPassword() => $_has(4); - @$pb.TagNumber(5) - void clearPassword() => clearField(5); } class UpdateUserResponse extends $pb.GeneratedMessage { @@ -278,198 +126,6 @@ class UpdateUserResponse extends $pb.GeneratedMessage { static UpdateUserResponse? _defaultInstance; } -class CreateOrganizationRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateOrganizationRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'proto.services.user_svc.v1'), createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'longName') - ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'shortName') - ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'contactEmail') - ..hasRequiredFields = false - ; - - CreateOrganizationRequest._() : super(); - factory CreateOrganizationRequest({ - $core.String? longName, - $core.String? shortName, - $core.String? contactEmail, - }) { - final _result = create(); - if (longName != null) { - _result.longName = longName; - } - if (shortName != null) { - _result.shortName = shortName; - } - if (contactEmail != null) { - _result.contactEmail = contactEmail; - } - return _result; - } - factory CreateOrganizationRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CreateOrganizationRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - CreateOrganizationRequest clone() => CreateOrganizationRequest()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - CreateOrganizationRequest copyWith(void Function(CreateOrganizationRequest) updates) => super.copyWith((message) => updates(message as CreateOrganizationRequest)) as CreateOrganizationRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static CreateOrganizationRequest create() => CreateOrganizationRequest._(); - CreateOrganizationRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static CreateOrganizationRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static CreateOrganizationRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get longName => $_getSZ(0); - @$pb.TagNumber(1) - set longName($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasLongName() => $_has(0); - @$pb.TagNumber(1) - void clearLongName() => clearField(1); - - @$pb.TagNumber(2) - $core.String get shortName => $_getSZ(1); - @$pb.TagNumber(2) - set shortName($core.String v) { $_setString(1, v); } - @$pb.TagNumber(2) - $core.bool hasShortName() => $_has(1); - @$pb.TagNumber(2) - void clearShortName() => clearField(2); - - @$pb.TagNumber(3) - $core.String get contactEmail => $_getSZ(2); - @$pb.TagNumber(3) - set contactEmail($core.String v) { $_setString(2, v); } - @$pb.TagNumber(3) - $core.bool hasContactEmail() => $_has(2); - @$pb.TagNumber(3) - void clearContactEmail() => clearField(3); -} - -class CreateOrganizationResponse extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateOrganizationResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'proto.services.user_svc.v1'), createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id') - ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'longName') - ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'shortName') - ..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'contactEmail') - ..aOS(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'avatarUrl') - ..aOB(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'isPersonal') - ..hasRequiredFields = false - ; - - CreateOrganizationResponse._() : super(); - factory CreateOrganizationResponse({ - $core.String? id, - $core.String? longName, - $core.String? shortName, - $core.String? contactEmail, - $core.String? avatarUrl, - $core.bool? isPersonal, - }) { - final _result = create(); - if (id != null) { - _result.id = id; - } - if (longName != null) { - _result.longName = longName; - } - if (shortName != null) { - _result.shortName = shortName; - } - if (contactEmail != null) { - _result.contactEmail = contactEmail; - } - if (avatarUrl != null) { - _result.avatarUrl = avatarUrl; - } - if (isPersonal != null) { - _result.isPersonal = isPersonal; - } - return _result; - } - factory CreateOrganizationResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CreateOrganizationResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - CreateOrganizationResponse clone() => CreateOrganizationResponse()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - CreateOrganizationResponse copyWith(void Function(CreateOrganizationResponse) updates) => super.copyWith((message) => updates(message as CreateOrganizationResponse)) as CreateOrganizationResponse; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static CreateOrganizationResponse create() => CreateOrganizationResponse._(); - CreateOrganizationResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static CreateOrganizationResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static CreateOrganizationResponse? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get id => $_getSZ(0); - @$pb.TagNumber(1) - set id($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasId() => $_has(0); - @$pb.TagNumber(1) - void clearId() => clearField(1); - - @$pb.TagNumber(2) - $core.String get longName => $_getSZ(1); - @$pb.TagNumber(2) - set longName($core.String v) { $_setString(1, v); } - @$pb.TagNumber(2) - $core.bool hasLongName() => $_has(1); - @$pb.TagNumber(2) - void clearLongName() => clearField(2); - - @$pb.TagNumber(3) - $core.String get shortName => $_getSZ(2); - @$pb.TagNumber(3) - set shortName($core.String v) { $_setString(2, v); } - @$pb.TagNumber(3) - $core.bool hasShortName() => $_has(2); - @$pb.TagNumber(3) - void clearShortName() => clearField(3); - - @$pb.TagNumber(4) - $core.String get contactEmail => $_getSZ(3); - @$pb.TagNumber(4) - set contactEmail($core.String v) { $_setString(3, v); } - @$pb.TagNumber(4) - $core.bool hasContactEmail() => $_has(3); - @$pb.TagNumber(4) - void clearContactEmail() => clearField(4); - - @$pb.TagNumber(5) - $core.String get avatarUrl => $_getSZ(4); - @$pb.TagNumber(5) - set avatarUrl($core.String v) { $_setString(4, v); } - @$pb.TagNumber(5) - $core.bool hasAvatarUrl() => $_has(4); - @$pb.TagNumber(5) - void clearAvatarUrl() => clearField(5); - - @$pb.TagNumber(6) - $core.bool get isPersonal => $_getBF(5); - @$pb.TagNumber(6) - set isPersonal($core.bool v) { $_setBool(5, v); } - @$pb.TagNumber(6) - $core.bool hasIsPersonal() => $_has(5); - @$pb.TagNumber(6) - void clearIsPersonal() => clearField(6); -} - class UserServiceApi { $pb.RpcClient _client; UserServiceApi(this._client); @@ -482,9 +138,5 @@ class UserServiceApi { var emptyResponse = UpdateUserResponse(); return _client.invoke(ctx, 'UserService', 'UpdateUser', request, emptyResponse); } - $async.Future createOrganization($pb.ClientContext? ctx, CreateOrganizationRequest request) { - var emptyResponse = CreateOrganizationResponse(); - return _client.invoke(ctx, 'UserService', 'CreateOrganization', request, emptyResponse); - } } diff --git a/gen/dart/proto/services/user_svc/v1/user_svc.pbjson.dart b/gen/dart/proto/services/user_svc/v1/user_svc.pbjson.dart index 5d4eae14e..a4bd18306 100644 --- a/gen/dart/proto/services/user_svc/v1/user_svc.pbjson.dart +++ b/gen/dart/proto/services/user_svc/v1/user_svc.pbjson.dart @@ -11,47 +11,24 @@ import 'dart:typed_data' as $typed_data; @$core.Deprecated('Use createUserRequestDescriptor instead') const CreateUserRequest$json = const { '1': 'CreateUserRequest', - '2': const [ - const {'1': 'email', '3': 1, '4': 1, '5': 9, '10': 'email'}, - const {'1': 'nickname', '3': 2, '4': 1, '5': 9, '10': 'nickname'}, - const {'1': 'full_name', '3': 3, '4': 1, '5': 9, '10': 'fullName'}, - const {'1': 'password', '3': 4, '4': 1, '5': 9, '10': 'password'}, - ], }; /// Descriptor for `CreateUserRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List createUserRequestDescriptor = $convert.base64Decode('ChFDcmVhdGVVc2VyUmVxdWVzdBIUCgVlbWFpbBgBIAEoCVIFZW1haWwSGgoIbmlja25hbWUYAiABKAlSCG5pY2tuYW1lEhsKCWZ1bGxfbmFtZRgDIAEoCVIIZnVsbE5hbWUSGgoIcGFzc3dvcmQYBCABKAlSCHBhc3N3b3Jk'); +final $typed_data.Uint8List createUserRequestDescriptor = $convert.base64Decode('ChFDcmVhdGVVc2VyUmVxdWVzdA=='); @$core.Deprecated('Use createUserResponseDescriptor instead') const CreateUserResponse$json = const { '1': 'CreateUserResponse', - '2': const [ - const {'1': 'user_id', '3': 1, '4': 1, '5': 9, '10': 'userId'}, - ], }; /// Descriptor for `CreateUserResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List createUserResponseDescriptor = $convert.base64Decode('ChJDcmVhdGVVc2VyUmVzcG9uc2USFwoHdXNlcl9pZBgBIAEoCVIGdXNlcklk'); +final $typed_data.Uint8List createUserResponseDescriptor = $convert.base64Decode('ChJDcmVhdGVVc2VyUmVzcG9uc2U='); @$core.Deprecated('Use updateUserRequestDescriptor instead') const UpdateUserRequest$json = const { '1': 'UpdateUserRequest', - '2': const [ - const {'1': 'user_id', '3': 1, '4': 1, '5': 9, '9': 0, '10': 'userId', '17': true}, - const {'1': 'full_name', '3': 2, '4': 1, '5': 9, '9': 1, '10': 'fullName', '17': true}, - const {'1': 'nickname', '3': 3, '4': 1, '5': 9, '9': 2, '10': 'nickname', '17': true}, - const {'1': 'email', '3': 4, '4': 1, '5': 9, '9': 3, '10': 'email', '17': true}, - const {'1': 'password', '3': 5, '4': 1, '5': 9, '9': 4, '10': 'password', '17': true}, - ], - '8': const [ - const {'1': '_user_id'}, - const {'1': '_full_name'}, - const {'1': '_nickname'}, - const {'1': '_email'}, - const {'1': '_password'}, - ], }; /// Descriptor for `UpdateUserRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List updateUserRequestDescriptor = $convert.base64Decode('ChFVcGRhdGVVc2VyUmVxdWVzdBIcCgd1c2VyX2lkGAEgASgJSABSBnVzZXJJZIgBARIgCglmdWxsX25hbWUYAiABKAlIAVIIZnVsbE5hbWWIAQESHwoIbmlja25hbWUYAyABKAlIAlIIbmlja25hbWWIAQESGQoFZW1haWwYBCABKAlIA1IFZW1haWyIAQESHwoIcGFzc3dvcmQYBSABKAlIBFIIcGFzc3dvcmSIAQFCCgoIX3VzZXJfaWRCDAoKX2Z1bGxfbmFtZUILCglfbmlja25hbWVCCAoGX2VtYWlsQgsKCV9wYXNzd29yZA=='); +final $typed_data.Uint8List updateUserRequestDescriptor = $convert.base64Decode('ChFVcGRhdGVVc2VyUmVxdWVzdA=='); @$core.Deprecated('Use updateUserResponseDescriptor instead') const UpdateUserResponse$json = const { '1': 'UpdateUserResponse', @@ -59,39 +36,11 @@ const UpdateUserResponse$json = const { /// Descriptor for `UpdateUserResponse`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List updateUserResponseDescriptor = $convert.base64Decode('ChJVcGRhdGVVc2VyUmVzcG9uc2U='); -@$core.Deprecated('Use createOrganizationRequestDescriptor instead') -const CreateOrganizationRequest$json = const { - '1': 'CreateOrganizationRequest', - '2': const [ - const {'1': 'long_name', '3': 1, '4': 1, '5': 9, '10': 'longName'}, - const {'1': 'short_name', '3': 2, '4': 1, '5': 9, '10': 'shortName'}, - const {'1': 'contact_email', '3': 3, '4': 1, '5': 9, '10': 'contactEmail'}, - ], -}; - -/// Descriptor for `CreateOrganizationRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List createOrganizationRequestDescriptor = $convert.base64Decode('ChlDcmVhdGVPcmdhbml6YXRpb25SZXF1ZXN0EhsKCWxvbmdfbmFtZRgBIAEoCVIIbG9uZ05hbWUSHQoKc2hvcnRfbmFtZRgCIAEoCVIJc2hvcnROYW1lEiMKDWNvbnRhY3RfZW1haWwYAyABKAlSDGNvbnRhY3RFbWFpbA=='); -@$core.Deprecated('Use createOrganizationResponseDescriptor instead') -const CreateOrganizationResponse$json = const { - '1': 'CreateOrganizationResponse', - '2': const [ - const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, - const {'1': 'long_name', '3': 2, '4': 1, '5': 9, '10': 'longName'}, - const {'1': 'short_name', '3': 3, '4': 1, '5': 9, '10': 'shortName'}, - const {'1': 'contact_email', '3': 4, '4': 1, '5': 9, '10': 'contactEmail'}, - const {'1': 'avatar_url', '3': 5, '4': 1, '5': 9, '10': 'avatarUrl'}, - const {'1': 'is_personal', '3': 6, '4': 1, '5': 8, '10': 'isPersonal'}, - ], -}; - -/// Descriptor for `CreateOrganizationResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List createOrganizationResponseDescriptor = $convert.base64Decode('ChpDcmVhdGVPcmdhbml6YXRpb25SZXNwb25zZRIOCgJpZBgBIAEoCVICaWQSGwoJbG9uZ19uYW1lGAIgASgJUghsb25nTmFtZRIdCgpzaG9ydF9uYW1lGAMgASgJUglzaG9ydE5hbWUSIwoNY29udGFjdF9lbWFpbBgEIAEoCVIMY29udGFjdEVtYWlsEh0KCmF2YXRhcl91cmwYBSABKAlSCWF2YXRhclVybBIfCgtpc19wZXJzb25hbBgGIAEoCFIKaXNQZXJzb25hbA=='); const $core.Map<$core.String, $core.dynamic> UserServiceBase$json = const { '1': 'UserService', '2': const [ const {'1': 'CreateUser', '2': '.proto.services.user_svc.v1.CreateUserRequest', '3': '.proto.services.user_svc.v1.CreateUserResponse', '4': const {}}, const {'1': 'UpdateUser', '2': '.proto.services.user_svc.v1.UpdateUserRequest', '3': '.proto.services.user_svc.v1.UpdateUserResponse', '4': const {}}, - const {'1': 'CreateOrganization', '2': '.proto.services.user_svc.v1.CreateOrganizationRequest', '3': '.proto.services.user_svc.v1.CreateOrganizationResponse', '4': const {}}, ], }; @@ -101,9 +50,7 @@ const $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> UserServic '.proto.services.user_svc.v1.CreateUserResponse': CreateUserResponse$json, '.proto.services.user_svc.v1.UpdateUserRequest': UpdateUserRequest$json, '.proto.services.user_svc.v1.UpdateUserResponse': UpdateUserResponse$json, - '.proto.services.user_svc.v1.CreateOrganizationRequest': CreateOrganizationRequest$json, - '.proto.services.user_svc.v1.CreateOrganizationResponse': CreateOrganizationResponse$json, }; /// Descriptor for `UserService`. Decode as a `google.protobuf.ServiceDescriptorProto`. -final $typed_data.Uint8List userServiceDescriptor = $convert.base64Decode('CgtVc2VyU2VydmljZRJtCgpDcmVhdGVVc2VyEi0ucHJvdG8uc2VydmljZXMudXNlcl9zdmMudjEuQ3JlYXRlVXNlclJlcXVlc3QaLi5wcm90by5zZXJ2aWNlcy51c2VyX3N2Yy52MS5DcmVhdGVVc2VyUmVzcG9uc2UiABJtCgpVcGRhdGVVc2VyEi0ucHJvdG8uc2VydmljZXMudXNlcl9zdmMudjEuVXBkYXRlVXNlclJlcXVlc3QaLi5wcm90by5zZXJ2aWNlcy51c2VyX3N2Yy52MS5VcGRhdGVVc2VyUmVzcG9uc2UiABKFAQoSQ3JlYXRlT3JnYW5pemF0aW9uEjUucHJvdG8uc2VydmljZXMudXNlcl9zdmMudjEuQ3JlYXRlT3JnYW5pemF0aW9uUmVxdWVzdBo2LnByb3RvLnNlcnZpY2VzLnVzZXJfc3ZjLnYxLkNyZWF0ZU9yZ2FuaXphdGlvblJlc3BvbnNlIgA='); +final $typed_data.Uint8List userServiceDescriptor = $convert.base64Decode('CgtVc2VyU2VydmljZRJtCgpDcmVhdGVVc2VyEi0ucHJvdG8uc2VydmljZXMudXNlcl9zdmMudjEuQ3JlYXRlVXNlclJlcXVlc3QaLi5wcm90by5zZXJ2aWNlcy51c2VyX3N2Yy52MS5DcmVhdGVVc2VyUmVzcG9uc2UiABJtCgpVcGRhdGVVc2VyEi0ucHJvdG8uc2VydmljZXMudXNlcl9zdmMudjEuVXBkYXRlVXNlclJlcXVlc3QaLi5wcm90by5zZXJ2aWNlcy51c2VyX3N2Yy52MS5VcGRhdGVVc2VyUmVzcG9uc2UiAA=='); diff --git a/gen/dart/proto/services/user_svc/v1/user_svc.pbserver.dart b/gen/dart/proto/services/user_svc/v1/user_svc.pbserver.dart index 1bd0ac1ac..c1245881e 100644 --- a/gen/dart/proto/services/user_svc/v1/user_svc.pbserver.dart +++ b/gen/dart/proto/services/user_svc/v1/user_svc.pbserver.dart @@ -10,30 +10,27 @@ import 'dart:async' as $async; import 'package:protobuf/protobuf.dart' as $pb; import 'dart:core' as $core; -import 'user_svc.pb.dart' as $6; +import 'user_svc.pb.dart' as $7; import 'user_svc.pbjson.dart'; export 'user_svc.pb.dart'; abstract class UserServiceBase extends $pb.GeneratedService { - $async.Future<$6.CreateUserResponse> createUser($pb.ServerContext ctx, $6.CreateUserRequest request); - $async.Future<$6.UpdateUserResponse> updateUser($pb.ServerContext ctx, $6.UpdateUserRequest request); - $async.Future<$6.CreateOrganizationResponse> createOrganization($pb.ServerContext ctx, $6.CreateOrganizationRequest request); + $async.Future<$7.CreateUserResponse> createUser($pb.ServerContext ctx, $7.CreateUserRequest request); + $async.Future<$7.UpdateUserResponse> updateUser($pb.ServerContext ctx, $7.UpdateUserRequest request); $pb.GeneratedMessage createRequest($core.String method) { switch (method) { - case 'CreateUser': return $6.CreateUserRequest(); - case 'UpdateUser': return $6.UpdateUserRequest(); - case 'CreateOrganization': return $6.CreateOrganizationRequest(); + case 'CreateUser': return $7.CreateUserRequest(); + case 'UpdateUser': return $7.UpdateUserRequest(); default: throw $core.ArgumentError('Unknown method: $method'); } } $async.Future<$pb.GeneratedMessage> handleCall($pb.ServerContext ctx, $core.String method, $pb.GeneratedMessage request) { switch (method) { - case 'CreateUser': return this.createUser(ctx, request as $6.CreateUserRequest); - case 'UpdateUser': return this.updateUser(ctx, request as $6.UpdateUserRequest); - case 'CreateOrganization': return this.createOrganization(ctx, request as $6.CreateOrganizationRequest); + case 'CreateUser': return this.createUser(ctx, request as $7.CreateUserRequest); + case 'UpdateUser': return this.updateUser(ctx, request as $7.UpdateUserRequest); default: throw $core.ArgumentError('Unknown method: $method'); } } diff --git a/gen/go/proto/services/user_svc/v1/logging.go b/gen/go/proto/services/user_svc/v1/logging.go deleted file mode 100644 index bbc5b8d43..000000000 --- a/gen/go/proto/services/user_svc/v1/logging.go +++ /dev/null @@ -1,22 +0,0 @@ -package user_svc - -import ( - "logging" -) - -func (x *CreateUserRequest) LoggableFields() map[string]interface{} { - m := logging.StructToMap(x) - m["password"] = logging.OmitAll(x.Password) - return m -} - -func (x *UpdateUserRequest) LoggableFields() map[string]interface{} { - m := logging.StructToMap(x) - if x.Email != nil { - m["email"] = logging.OmitAll(*x.Email) - } - if x.Password != nil { - m["password"] = logging.OmitAll(*x.Password) - } - return m -} diff --git a/gen/go/proto/services/user_svc/v1/organization_svc.pb.go b/gen/go/proto/services/user_svc/v1/organization_svc.pb.go new file mode 100644 index 000000000..59fbcf6a3 --- /dev/null +++ b/gen/go/proto/services/user_svc/v1/organization_svc.pb.go @@ -0,0 +1,515 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: proto/services/user_svc/v1/organization_svc.proto + +package user_svc + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CreateOrganizationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LongName string `protobuf:"bytes,1,opt,name=long_name,json=longName,proto3" json:"long_name,omitempty" validate:"required,gte=4,lte=64"` // @gotags: validate:"required,gte=4,lte=64" + ShortName string `protobuf:"bytes,2,opt,name=short_name,json=shortName,proto3" json:"short_name,omitempty" validate:"omitempty,gte=2,lte=16"` // @gotags: validate:"omitempty,gte=2,lte=16" + ContactEmail string `protobuf:"bytes,3,opt,name=contact_email,json=contactEmail,proto3" json:"contact_email,omitempty" validate:"required,email"` // @gotags: validate:"required,email" +} + +func (x *CreateOrganizationRequest) Reset() { + *x = CreateOrganizationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_services_user_svc_v1_organization_svc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateOrganizationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOrganizationRequest) ProtoMessage() {} + +func (x *CreateOrganizationRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_services_user_svc_v1_organization_svc_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateOrganizationRequest.ProtoReflect.Descriptor instead. +func (*CreateOrganizationRequest) Descriptor() ([]byte, []int) { + return file_proto_services_user_svc_v1_organization_svc_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateOrganizationRequest) GetLongName() string { + if x != nil { + return x.LongName + } + return "" +} + +func (x *CreateOrganizationRequest) GetShortName() string { + if x != nil { + return x.ShortName + } + return "" +} + +func (x *CreateOrganizationRequest) GetContactEmail() string { + if x != nil { + return x.ContactEmail + } + return "" +} + +type CreateOrganizationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *CreateOrganizationResponse) Reset() { + *x = CreateOrganizationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_services_user_svc_v1_organization_svc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateOrganizationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOrganizationResponse) ProtoMessage() {} + +func (x *CreateOrganizationResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_services_user_svc_v1_organization_svc_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateOrganizationResponse.ProtoReflect.Descriptor instead. +func (*CreateOrganizationResponse) Descriptor() ([]byte, []int) { + return file_proto_services_user_svc_v1_organization_svc_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateOrganizationResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type Member struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` +} + +func (x *Member) Reset() { + *x = Member{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_services_user_svc_v1_organization_svc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Member) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Member) ProtoMessage() {} + +func (x *Member) ProtoReflect() protoreflect.Message { + mi := &file_proto_services_user_svc_v1_organization_svc_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Member.ProtoReflect.Descriptor instead. +func (*Member) Descriptor() ([]byte, []int) { + return file_proto_services_user_svc_v1_organization_svc_proto_rawDescGZIP(), []int{2} +} + +func (x *Member) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type GetOrganizationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" validate:"uuid4"` // @gotags: validate:"uuid4" +} + +func (x *GetOrganizationRequest) Reset() { + *x = GetOrganizationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_services_user_svc_v1_organization_svc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetOrganizationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetOrganizationRequest) ProtoMessage() {} + +func (x *GetOrganizationRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_services_user_svc_v1_organization_svc_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetOrganizationRequest.ProtoReflect.Descriptor instead. +func (*GetOrganizationRequest) Descriptor() ([]byte, []int) { + return file_proto_services_user_svc_v1_organization_svc_proto_rawDescGZIP(), []int{3} +} + +func (x *GetOrganizationRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetOrganizationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + LongName string `protobuf:"bytes,2,opt,name=long_name,json=longName,proto3" json:"long_name,omitempty"` + ShortName string `protobuf:"bytes,3,opt,name=short_name,json=shortName,proto3" json:"short_name,omitempty"` + ContactEmail string `protobuf:"bytes,4,opt,name=contact_email,json=contactEmail,proto3" json:"contact_email,omitempty"` + AvatarUrl string `protobuf:"bytes,5,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` + IsPersonal bool `protobuf:"varint,6,opt,name=is_personal,json=isPersonal,proto3" json:"is_personal,omitempty"` + Members []*Member `protobuf:"bytes,7,rep,name=members,proto3" json:"members,omitempty"` +} + +func (x *GetOrganizationResponse) Reset() { + *x = GetOrganizationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_services_user_svc_v1_organization_svc_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetOrganizationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetOrganizationResponse) ProtoMessage() {} + +func (x *GetOrganizationResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_services_user_svc_v1_organization_svc_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetOrganizationResponse.ProtoReflect.Descriptor instead. +func (*GetOrganizationResponse) Descriptor() ([]byte, []int) { + return file_proto_services_user_svc_v1_organization_svc_proto_rawDescGZIP(), []int{4} +} + +func (x *GetOrganizationResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *GetOrganizationResponse) GetLongName() string { + if x != nil { + return x.LongName + } + return "" +} + +func (x *GetOrganizationResponse) GetShortName() string { + if x != nil { + return x.ShortName + } + return "" +} + +func (x *GetOrganizationResponse) GetContactEmail() string { + if x != nil { + return x.ContactEmail + } + return "" +} + +func (x *GetOrganizationResponse) GetAvatarUrl() string { + if x != nil { + return x.AvatarUrl + } + return "" +} + +func (x *GetOrganizationResponse) GetIsPersonal() bool { + if x != nil { + return x.IsPersonal + } + return false +} + +func (x *GetOrganizationResponse) GetMembers() []*Member { + if x != nil { + return x.Members + } + return nil +} + +var File_proto_services_user_svc_v1_organization_svc_proto protoreflect.FileDescriptor + +var file_proto_services_user_svc_v1_organization_svc_proto_rawDesc = []byte{ + 0x0a, 0x31, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x76, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x67, + 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x22, + 0x7c, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, + 0x6c, 0x6f, 0x6e, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6c, 0x6f, 0x6e, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x68, 0x6f, + 0x72, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, + 0x68, 0x6f, 0x72, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x63, 0x74, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x2c, 0x0a, + 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x21, 0x0a, 0x06, 0x4d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x28, + 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x88, 0x02, 0x0a, 0x17, 0x47, 0x65, 0x74, + 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x6e, 0x67, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x5f, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, + 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x5f, + 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, + 0x72, 0x55, 0x72, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, + 0x6e, 0x61, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x50, 0x65, 0x72, + 0x73, 0x6f, 0x6e, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x76, 0x63, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x73, 0x32, 0x9b, 0x02, 0x0a, 0x13, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x85, 0x01, 0x0a, 0x12, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x35, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, + 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x7c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x76, 0x63, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x42, 0xda, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x76, + 0x63, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x76, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1b, 0x67, 0x65, + 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2d, 0x73, 0x76, 0x63, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x55, 0xaa, + 0x02, 0x19, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x76, 0x63, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5c, 0x55, 0x73, 0x65, + 0x72, 0x53, 0x76, 0x63, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x25, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5c, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x53, 0x76, 0x63, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x1c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x3a, 0x3a, 0x55, 0x73, 0x65, 0x72, 0x53, 0x76, 0x63, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_proto_services_user_svc_v1_organization_svc_proto_rawDescOnce sync.Once + file_proto_services_user_svc_v1_organization_svc_proto_rawDescData = file_proto_services_user_svc_v1_organization_svc_proto_rawDesc +) + +func file_proto_services_user_svc_v1_organization_svc_proto_rawDescGZIP() []byte { + file_proto_services_user_svc_v1_organization_svc_proto_rawDescOnce.Do(func() { + file_proto_services_user_svc_v1_organization_svc_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_services_user_svc_v1_organization_svc_proto_rawDescData) + }) + return file_proto_services_user_svc_v1_organization_svc_proto_rawDescData +} + +var file_proto_services_user_svc_v1_organization_svc_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_proto_services_user_svc_v1_organization_svc_proto_goTypes = []interface{}{ + (*CreateOrganizationRequest)(nil), // 0: proto.services.user_svc.v1.CreateOrganizationRequest + (*CreateOrganizationResponse)(nil), // 1: proto.services.user_svc.v1.CreateOrganizationResponse + (*Member)(nil), // 2: proto.services.user_svc.v1.Member + (*GetOrganizationRequest)(nil), // 3: proto.services.user_svc.v1.GetOrganizationRequest + (*GetOrganizationResponse)(nil), // 4: proto.services.user_svc.v1.GetOrganizationResponse +} +var file_proto_services_user_svc_v1_organization_svc_proto_depIdxs = []int32{ + 2, // 0: proto.services.user_svc.v1.GetOrganizationResponse.members:type_name -> proto.services.user_svc.v1.Member + 0, // 1: proto.services.user_svc.v1.OrganizationService.CreateOrganization:input_type -> proto.services.user_svc.v1.CreateOrganizationRequest + 3, // 2: proto.services.user_svc.v1.OrganizationService.GetOrganization:input_type -> proto.services.user_svc.v1.GetOrganizationRequest + 1, // 3: proto.services.user_svc.v1.OrganizationService.CreateOrganization:output_type -> proto.services.user_svc.v1.CreateOrganizationResponse + 4, // 4: proto.services.user_svc.v1.OrganizationService.GetOrganization:output_type -> proto.services.user_svc.v1.GetOrganizationResponse + 3, // [3:5] is the sub-list for method output_type + 1, // [1:3] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_proto_services_user_svc_v1_organization_svc_proto_init() } +func file_proto_services_user_svc_v1_organization_svc_proto_init() { + if File_proto_services_user_svc_v1_organization_svc_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_services_user_svc_v1_organization_svc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateOrganizationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_services_user_svc_v1_organization_svc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateOrganizationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_services_user_svc_v1_organization_svc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Member); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_services_user_svc_v1_organization_svc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetOrganizationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_services_user_svc_v1_organization_svc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetOrganizationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_services_user_svc_v1_organization_svc_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_proto_services_user_svc_v1_organization_svc_proto_goTypes, + DependencyIndexes: file_proto_services_user_svc_v1_organization_svc_proto_depIdxs, + MessageInfos: file_proto_services_user_svc_v1_organization_svc_proto_msgTypes, + }.Build() + File_proto_services_user_svc_v1_organization_svc_proto = out.File + file_proto_services_user_svc_v1_organization_svc_proto_rawDesc = nil + file_proto_services_user_svc_v1_organization_svc_proto_goTypes = nil + file_proto_services_user_svc_v1_organization_svc_proto_depIdxs = nil +} diff --git a/gen/go/proto/services/user_svc/v1/organization_svc_grpc.pb.go b/gen/go/proto/services/user_svc/v1/organization_svc_grpc.pb.go new file mode 100644 index 000000000..04532defc --- /dev/null +++ b/gen/go/proto/services/user_svc/v1/organization_svc_grpc.pb.go @@ -0,0 +1,146 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: proto/services/user_svc/v1/organization_svc.proto + +package user_svc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + OrganizationService_CreateOrganization_FullMethodName = "/proto.services.user_svc.v1.OrganizationService/CreateOrganization" + OrganizationService_GetOrganization_FullMethodName = "/proto.services.user_svc.v1.OrganizationService/GetOrganization" +) + +// OrganizationServiceClient is the client API for OrganizationService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type OrganizationServiceClient interface { + CreateOrganization(ctx context.Context, in *CreateOrganizationRequest, opts ...grpc.CallOption) (*CreateOrganizationResponse, error) + GetOrganization(ctx context.Context, in *GetOrganizationRequest, opts ...grpc.CallOption) (*GetOrganizationResponse, error) +} + +type organizationServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewOrganizationServiceClient(cc grpc.ClientConnInterface) OrganizationServiceClient { + return &organizationServiceClient{cc} +} + +func (c *organizationServiceClient) CreateOrganization(ctx context.Context, in *CreateOrganizationRequest, opts ...grpc.CallOption) (*CreateOrganizationResponse, error) { + out := new(CreateOrganizationResponse) + err := c.cc.Invoke(ctx, OrganizationService_CreateOrganization_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationServiceClient) GetOrganization(ctx context.Context, in *GetOrganizationRequest, opts ...grpc.CallOption) (*GetOrganizationResponse, error) { + out := new(GetOrganizationResponse) + err := c.cc.Invoke(ctx, OrganizationService_GetOrganization_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// OrganizationServiceServer is the server API for OrganizationService service. +// All implementations must embed UnimplementedOrganizationServiceServer +// for forward compatibility +type OrganizationServiceServer interface { + CreateOrganization(context.Context, *CreateOrganizationRequest) (*CreateOrganizationResponse, error) + GetOrganization(context.Context, *GetOrganizationRequest) (*GetOrganizationResponse, error) + mustEmbedUnimplementedOrganizationServiceServer() +} + +// UnimplementedOrganizationServiceServer must be embedded to have forward compatible implementations. +type UnimplementedOrganizationServiceServer struct { +} + +func (UnimplementedOrganizationServiceServer) CreateOrganization(context.Context, *CreateOrganizationRequest) (*CreateOrganizationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateOrganization not implemented") +} +func (UnimplementedOrganizationServiceServer) GetOrganization(context.Context, *GetOrganizationRequest) (*GetOrganizationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetOrganization not implemented") +} +func (UnimplementedOrganizationServiceServer) mustEmbedUnimplementedOrganizationServiceServer() {} + +// UnsafeOrganizationServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to OrganizationServiceServer will +// result in compilation errors. +type UnsafeOrganizationServiceServer interface { + mustEmbedUnimplementedOrganizationServiceServer() +} + +func RegisterOrganizationServiceServer(s grpc.ServiceRegistrar, srv OrganizationServiceServer) { + s.RegisterService(&OrganizationService_ServiceDesc, srv) +} + +func _OrganizationService_CreateOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateOrganizationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServiceServer).CreateOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OrganizationService_CreateOrganization_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServiceServer).CreateOrganization(ctx, req.(*CreateOrganizationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _OrganizationService_GetOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetOrganizationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServiceServer).GetOrganization(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OrganizationService_GetOrganization_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServiceServer).GetOrganization(ctx, req.(*GetOrganizationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// OrganizationService_ServiceDesc is the grpc.ServiceDesc for OrganizationService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var OrganizationService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "proto.services.user_svc.v1.OrganizationService", + HandlerType: (*OrganizationServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateOrganization", + Handler: _OrganizationService_CreateOrganization_Handler, + }, + { + MethodName: "GetOrganization", + Handler: _OrganizationService_GetOrganization_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/services/user_svc/v1/organization_svc.proto", +} diff --git a/gen/go/proto/services/user_svc/v1/user_svc.pb.go b/gen/go/proto/services/user_svc/v1/user_svc.pb.go index 0158fd513..6786d4ccc 100644 --- a/gen/go/proto/services/user_svc/v1/user_svc.pb.go +++ b/gen/go/proto/services/user_svc/v1/user_svc.pb.go @@ -24,11 +24,6 @@ type CreateUserRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty" validate:"required,email"` // @gotags: validate:"required,email" - Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname,omitempty" validate:"required"` // @gotags: validate:"required" - FullName string `protobuf:"bytes,3,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty" validate:"required"` // @gotags: validate:"required" - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty" validate:"required"` // @gotags: validate:"required" } func (x *CreateUserRequest) Reset() { @@ -63,40 +58,10 @@ func (*CreateUserRequest) Descriptor() ([]byte, []int) { return file_proto_services_user_svc_v1_user_svc_proto_rawDescGZIP(), []int{0} } -func (x *CreateUserRequest) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *CreateUserRequest) GetNickname() string { - if x != nil { - return x.Nickname - } - return "" -} - -func (x *CreateUserRequest) GetFullName() string { - if x != nil { - return x.FullName - } - return "" -} - -func (x *CreateUserRequest) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - type CreateUserResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` } func (x *CreateUserResponse) Reset() { @@ -131,24 +96,10 @@ func (*CreateUserResponse) Descriptor() ([]byte, []int) { return file_proto_services_user_svc_v1_user_svc_proto_rawDescGZIP(), []int{1} } -func (x *CreateUserResponse) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - type UpdateUserRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - // if userId is missing the requesting user's id is used - UserId *string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3,oneof" json:"user_id,omitempty" validate:"omitempty,uuid4"` // @gotags: validate:"omitempty,uuid4" - FullName *string `protobuf:"bytes,2,opt,name=full_name,json=fullName,proto3,oneof" json:"full_name,omitempty"` - Nickname *string `protobuf:"bytes,3,opt,name=nickname,proto3,oneof" json:"nickname,omitempty"` - Email *string `protobuf:"bytes,4,opt,name=email,proto3,oneof" json:"email,omitempty" validate:"omitempty,email"` // @gotags: validate:"omitempty,email" - Password *string `protobuf:"bytes,5,opt,name=password,proto3,oneof" json:"password,omitempty"` } func (x *UpdateUserRequest) Reset() { @@ -183,41 +134,6 @@ func (*UpdateUserRequest) Descriptor() ([]byte, []int) { return file_proto_services_user_svc_v1_user_svc_proto_rawDescGZIP(), []int{2} } -func (x *UpdateUserRequest) GetUserId() string { - if x != nil && x.UserId != nil { - return *x.UserId - } - return "" -} - -func (x *UpdateUserRequest) GetFullName() string { - if x != nil && x.FullName != nil { - return *x.FullName - } - return "" -} - -func (x *UpdateUserRequest) GetNickname() string { - if x != nil && x.Nickname != nil { - return *x.Nickname - } - return "" -} - -func (x *UpdateUserRequest) GetEmail() string { - if x != nil && x.Email != nil { - return *x.Email - } - return "" -} - -func (x *UpdateUserRequest) GetPassword() string { - if x != nil && x.Password != nil { - return *x.Password - } - return "" -} - type UpdateUserResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -256,157 +172,6 @@ func (*UpdateUserResponse) Descriptor() ([]byte, []int) { return file_proto_services_user_svc_v1_user_svc_proto_rawDescGZIP(), []int{3} } -// Just some test comment for to trigger the ci -type CreateOrganizationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LongName string `protobuf:"bytes,1,opt,name=long_name,json=longName,proto3" json:"long_name,omitempty" validate:"required,gte=4,lte=64"` // @gotags: validate:"required,gte=4,lte=64" - ShortName string `protobuf:"bytes,2,opt,name=short_name,json=shortName,proto3" json:"short_name,omitempty" validate:"omitempty,gte=2,lte=16"` // @gotags: validate:"omitempty,gte=2,lte=16" - ContactEmail string `protobuf:"bytes,3,opt,name=contact_email,json=contactEmail,proto3" json:"contact_email,omitempty" validate:"required,email"` // @gotags: validate:"required,email" -} - -func (x *CreateOrganizationRequest) Reset() { - *x = CreateOrganizationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_services_user_svc_v1_user_svc_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateOrganizationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateOrganizationRequest) ProtoMessage() {} - -func (x *CreateOrganizationRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_services_user_svc_v1_user_svc_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateOrganizationRequest.ProtoReflect.Descriptor instead. -func (*CreateOrganizationRequest) Descriptor() ([]byte, []int) { - return file_proto_services_user_svc_v1_user_svc_proto_rawDescGZIP(), []int{4} -} - -func (x *CreateOrganizationRequest) GetLongName() string { - if x != nil { - return x.LongName - } - return "" -} - -func (x *CreateOrganizationRequest) GetShortName() string { - if x != nil { - return x.ShortName - } - return "" -} - -func (x *CreateOrganizationRequest) GetContactEmail() string { - if x != nil { - return x.ContactEmail - } - return "" -} - -type CreateOrganizationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - LongName string `protobuf:"bytes,2,opt,name=long_name,json=longName,proto3" json:"long_name,omitempty"` - ShortName string `protobuf:"bytes,3,opt,name=short_name,json=shortName,proto3" json:"short_name,omitempty"` - ContactEmail string `protobuf:"bytes,4,opt,name=contact_email,json=contactEmail,proto3" json:"contact_email,omitempty"` - AvatarUrl string `protobuf:"bytes,5,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` - IsPersonal bool `protobuf:"varint,6,opt,name=is_personal,json=isPersonal,proto3" json:"is_personal,omitempty"` -} - -func (x *CreateOrganizationResponse) Reset() { - *x = CreateOrganizationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_services_user_svc_v1_user_svc_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateOrganizationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateOrganizationResponse) ProtoMessage() {} - -func (x *CreateOrganizationResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_services_user_svc_v1_user_svc_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateOrganizationResponse.ProtoReflect.Descriptor instead. -func (*CreateOrganizationResponse) Descriptor() ([]byte, []int) { - return file_proto_services_user_svc_v1_user_svc_proto_rawDescGZIP(), []int{5} -} - -func (x *CreateOrganizationResponse) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *CreateOrganizationResponse) GetLongName() string { - if x != nil { - return x.LongName - } - return "" -} - -func (x *CreateOrganizationResponse) GetShortName() string { - if x != nil { - return x.ShortName - } - return "" -} - -func (x *CreateOrganizationResponse) GetContactEmail() string { - if x != nil { - return x.ContactEmail - } - return "" -} - -func (x *CreateOrganizationResponse) GetAvatarUrl() string { - if x != nil { - return x.AvatarUrl - } - return "" -} - -func (x *CreateOrganizationResponse) GetIsPersonal() bool { - if x != nil { - return x.IsPersonal - } - return false -} - var File_proto_services_user_svc_v1_user_svc_proto protoreflect.FileDescriptor var file_proto_services_user_svc_v1_user_svc_proto_rawDesc = []byte{ @@ -414,92 +179,41 @@ var file_proto_services_user_svc_v1_user_svc_proto_rawDesc = []byte{ 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x76, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, - 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x22, 0x7e, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, - 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, - 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x2d, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, - 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xee, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x07, - 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, - 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x09, 0x66, 0x75, - 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, - 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, - 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, - 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, - 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x05, - 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, - 0x77, 0x6f, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x08, 0x70, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x75, 0x73, - 0x65, 0x72, 0x5f, 0x69, 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, - 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7c, 0x0a, - 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, - 0x6e, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, - 0x6f, 0x6e, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x68, 0x6f, 0x72, 0x74, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x68, 0x6f, - 0x72, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, - 0x74, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0xcd, 0x01, 0x0a, 0x1a, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, - 0x6e, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, - 0x6f, 0x6e, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x68, 0x6f, 0x72, 0x74, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x68, 0x6f, - 0x72, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, - 0x74, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x61, - 0x76, 0x61, 0x74, 0x61, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, - 0x5f, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0a, 0x69, 0x73, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x61, 0x6c, 0x32, 0xf3, 0x02, 0x0a, 0x0b, - 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6d, 0x0a, 0x0a, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x2d, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x22, 0x13, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x14, 0x0a, 0x12, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x13, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x14, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xeb, 0x01, + 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6d, 0x0a, + 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x2d, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6d, 0x0a, 0x0a, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x2d, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x5f, - 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, - 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6d, 0x0a, 0x0a, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x2d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, - 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x76, - 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x85, 0x01, 0x0a, 0x12, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x35, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x76, - 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x42, 0xd2, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x76, - 0x63, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x53, 0x76, 0x63, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1b, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2d, 0x73, 0x76, - 0x63, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x55, 0xaa, 0x02, 0x19, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x76, 0x63, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5c, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x53, 0x76, 0x63, 0x5c, 0x56, 0x31, 0xe2, - 0x02, 0x25, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x5c, 0x55, 0x73, 0x65, 0x72, 0x53, 0x76, 0x63, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x3a, - 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x3a, 0x55, 0x73, 0x65, 0x72, 0x53, - 0x76, 0x63, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0xd2, 0x01, 0x0a, 0x1e, + 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x76, 0x63, 0x2e, 0x76, 0x31, 0x42, 0x0c, + 0x55, 0x73, 0x65, 0x72, 0x53, 0x76, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1b, + 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2d, 0x73, 0x76, 0x63, 0xa2, 0x02, 0x03, 0x50, 0x53, + 0x55, 0xaa, 0x02, 0x19, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x76, 0x63, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5c, 0x55, + 0x73, 0x65, 0x72, 0x53, 0x76, 0x63, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x25, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x53, + 0x76, 0x63, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x1c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x3a, 0x3a, 0x55, 0x73, 0x65, 0x72, 0x53, 0x76, 0x63, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -514,24 +228,20 @@ func file_proto_services_user_svc_v1_user_svc_proto_rawDescGZIP() []byte { return file_proto_services_user_svc_v1_user_svc_proto_rawDescData } -var file_proto_services_user_svc_v1_user_svc_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_proto_services_user_svc_v1_user_svc_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_proto_services_user_svc_v1_user_svc_proto_goTypes = []interface{}{ - (*CreateUserRequest)(nil), // 0: proto.services.user_svc.v1.CreateUserRequest - (*CreateUserResponse)(nil), // 1: proto.services.user_svc.v1.CreateUserResponse - (*UpdateUserRequest)(nil), // 2: proto.services.user_svc.v1.UpdateUserRequest - (*UpdateUserResponse)(nil), // 3: proto.services.user_svc.v1.UpdateUserResponse - (*CreateOrganizationRequest)(nil), // 4: proto.services.user_svc.v1.CreateOrganizationRequest - (*CreateOrganizationResponse)(nil), // 5: proto.services.user_svc.v1.CreateOrganizationResponse + (*CreateUserRequest)(nil), // 0: proto.services.user_svc.v1.CreateUserRequest + (*CreateUserResponse)(nil), // 1: proto.services.user_svc.v1.CreateUserResponse + (*UpdateUserRequest)(nil), // 2: proto.services.user_svc.v1.UpdateUserRequest + (*UpdateUserResponse)(nil), // 3: proto.services.user_svc.v1.UpdateUserResponse } var file_proto_services_user_svc_v1_user_svc_proto_depIdxs = []int32{ 0, // 0: proto.services.user_svc.v1.UserService.CreateUser:input_type -> proto.services.user_svc.v1.CreateUserRequest 2, // 1: proto.services.user_svc.v1.UserService.UpdateUser:input_type -> proto.services.user_svc.v1.UpdateUserRequest - 4, // 2: proto.services.user_svc.v1.UserService.CreateOrganization:input_type -> proto.services.user_svc.v1.CreateOrganizationRequest - 1, // 3: proto.services.user_svc.v1.UserService.CreateUser:output_type -> proto.services.user_svc.v1.CreateUserResponse - 3, // 4: proto.services.user_svc.v1.UserService.UpdateUser:output_type -> proto.services.user_svc.v1.UpdateUserResponse - 5, // 5: proto.services.user_svc.v1.UserService.CreateOrganization:output_type -> proto.services.user_svc.v1.CreateOrganizationResponse - 3, // [3:6] is the sub-list for method output_type - 0, // [0:3] is the sub-list for method input_type + 1, // 2: proto.services.user_svc.v1.UserService.CreateUser:output_type -> proto.services.user_svc.v1.CreateUserResponse + 3, // 3: proto.services.user_svc.v1.UserService.UpdateUser:output_type -> proto.services.user_svc.v1.UpdateUserResponse + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name @@ -591,39 +301,14 @@ func file_proto_services_user_svc_v1_user_svc_proto_init() { return nil } } - file_proto_services_user_svc_v1_user_svc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateOrganizationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_services_user_svc_v1_user_svc_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateOrganizationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } - file_proto_services_user_svc_v1_user_svc_proto_msgTypes[2].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_services_user_svc_v1_user_svc_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/gen/go/proto/services/user_svc/v1/user_svc_grpc.pb.go b/gen/go/proto/services/user_svc/v1/user_svc_grpc.pb.go index 27bc49563..6786aba72 100644 --- a/gen/go/proto/services/user_svc/v1/user_svc_grpc.pb.go +++ b/gen/go/proto/services/user_svc/v1/user_svc_grpc.pb.go @@ -19,9 +19,8 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - UserService_CreateUser_FullMethodName = "/proto.services.user_svc.v1.UserService/CreateUser" - UserService_UpdateUser_FullMethodName = "/proto.services.user_svc.v1.UserService/UpdateUser" - UserService_CreateOrganization_FullMethodName = "/proto.services.user_svc.v1.UserService/CreateOrganization" + UserService_CreateUser_FullMethodName = "/proto.services.user_svc.v1.UserService/CreateUser" + UserService_UpdateUser_FullMethodName = "/proto.services.user_svc.v1.UserService/UpdateUser" ) // UserServiceClient is the client API for UserService service. @@ -30,7 +29,6 @@ const ( type UserServiceClient interface { CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error) - CreateOrganization(ctx context.Context, in *CreateOrganizationRequest, opts ...grpc.CallOption) (*CreateOrganizationResponse, error) } type userServiceClient struct { @@ -59,22 +57,12 @@ func (c *userServiceClient) UpdateUser(ctx context.Context, in *UpdateUserReques return out, nil } -func (c *userServiceClient) CreateOrganization(ctx context.Context, in *CreateOrganizationRequest, opts ...grpc.CallOption) (*CreateOrganizationResponse, error) { - out := new(CreateOrganizationResponse) - err := c.cc.Invoke(ctx, UserService_CreateOrganization_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // UserServiceServer is the server API for UserService service. // All implementations must embed UnimplementedUserServiceServer // for forward compatibility type UserServiceServer interface { CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error) - CreateOrganization(context.Context, *CreateOrganizationRequest) (*CreateOrganizationResponse, error) mustEmbedUnimplementedUserServiceServer() } @@ -88,9 +76,6 @@ func (UnimplementedUserServiceServer) CreateUser(context.Context, *CreateUserReq func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented") } -func (UnimplementedUserServiceServer) CreateOrganization(context.Context, *CreateOrganizationRequest) (*CreateOrganizationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateOrganization not implemented") -} func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {} // UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. @@ -140,24 +125,6 @@ func _UserService_UpdateUser_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } -func _UserService_CreateOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateOrganizationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserServiceServer).CreateOrganization(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: UserService_CreateOrganization_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserServiceServer).CreateOrganization(ctx, req.(*CreateOrganizationRequest)) - } - return interceptor(ctx, in, info, handler) -} - // UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -173,10 +140,6 @@ var UserService_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateUser", Handler: _UserService_UpdateUser_Handler, }, - { - MethodName: "CreateOrganization", - Handler: _UserService_CreateOrganization_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/services/user_svc/v1/user_svc.proto", diff --git a/gen/ts/proto/services/user_svc/v1/organization_svc_grpc_web_pb.d.ts b/gen/ts/proto/services/user_svc/v1/organization_svc_grpc_web_pb.d.ts new file mode 100644 index 000000000..477769936 --- /dev/null +++ b/gen/ts/proto/services/user_svc/v1/organization_svc_grpc_web_pb.d.ts @@ -0,0 +1,43 @@ +import * as grpcWeb from 'grpc-web'; + +import * as proto_services_user_svc_v1_organization_svc_pb from '../../../../proto/services/user_svc/v1/organization_svc_pb'; + + +export class OrganizationServiceClient { + constructor (hostname: string, + credentials?: null | { [index: string]: string; }, + options?: null | { [index: string]: any; }); + + createOrganization( + request: proto_services_user_svc_v1_organization_svc_pb.CreateOrganizationRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.RpcError, + response: proto_services_user_svc_v1_organization_svc_pb.CreateOrganizationResponse) => void + ): grpcWeb.ClientReadableStream; + + getOrganization( + request: proto_services_user_svc_v1_organization_svc_pb.GetOrganizationRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.RpcError, + response: proto_services_user_svc_v1_organization_svc_pb.GetOrganizationResponse) => void + ): grpcWeb.ClientReadableStream; + +} + +export class OrganizationServicePromiseClient { + constructor (hostname: string, + credentials?: null | { [index: string]: string; }, + options?: null | { [index: string]: any; }); + + createOrganization( + request: proto_services_user_svc_v1_organization_svc_pb.CreateOrganizationRequest, + metadata?: grpcWeb.Metadata + ): Promise; + + getOrganization( + request: proto_services_user_svc_v1_organization_svc_pb.GetOrganizationRequest, + metadata?: grpcWeb.Metadata + ): Promise; + +} + diff --git a/gen/ts/proto/services/user_svc/v1/organization_svc_grpc_web_pb.js b/gen/ts/proto/services/user_svc/v1/organization_svc_grpc_web_pb.js new file mode 100644 index 000000000..b7bd46773 --- /dev/null +++ b/gen/ts/proto/services/user_svc/v1/organization_svc_grpc_web_pb.js @@ -0,0 +1,203 @@ +/** + * @fileoverview gRPC-Web generated client stub for proto.services.user_svc.v1 + * @enhanceable + * @public + */ + +// Code generated by protoc-gen-grpc-web. DO NOT EDIT. +// versions: +// protoc-gen-grpc-web v1.4.2 +// protoc v0.0.0 +// source: proto/services/user_svc/v1/organization_svc.proto + + +/* eslint-disable */ +// @ts-nocheck + + + +const grpc = {}; +grpc.web = require('grpc-web'); + +const proto = {}; +proto.proto = {}; +proto.proto.services = {}; +proto.proto.services.user_svc = {}; +proto.proto.services.user_svc.v1 = require('./organization_svc_pb.js'); + +/** + * @param {string} hostname + * @param {?Object} credentials + * @param {?grpc.web.ClientOptions} options + * @constructor + * @struct + * @final + */ +proto.proto.services.user_svc.v1.OrganizationServiceClient = + function(hostname, credentials, options) { + if (!options) options = {}; + options.format = 'text'; + + /** + * @private @const {!grpc.web.GrpcWebClientBase} The client + */ + this.client_ = new grpc.web.GrpcWebClientBase(options); + + /** + * @private @const {string} The hostname + */ + this.hostname_ = hostname.replace(/\/+$/, ''); + +}; + + +/** + * @param {string} hostname + * @param {?Object} credentials + * @param {?grpc.web.ClientOptions} options + * @constructor + * @struct + * @final + */ +proto.proto.services.user_svc.v1.OrganizationServicePromiseClient = + function(hostname, credentials, options) { + if (!options) options = {}; + options.format = 'text'; + + /** + * @private @const {!grpc.web.GrpcWebClientBase} The client + */ + this.client_ = new grpc.web.GrpcWebClientBase(options); + + /** + * @private @const {string} The hostname + */ + this.hostname_ = hostname.replace(/\/+$/, ''); + +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.proto.services.user_svc.v1.CreateOrganizationRequest, + * !proto.proto.services.user_svc.v1.CreateOrganizationResponse>} + */ +const methodDescriptor_OrganizationService_CreateOrganization = new grpc.web.MethodDescriptor( + '/proto.services.user_svc.v1.OrganizationService/CreateOrganization', + grpc.web.MethodType.UNARY, + proto.proto.services.user_svc.v1.CreateOrganizationRequest, + proto.proto.services.user_svc.v1.CreateOrganizationResponse, + /** + * @param {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.proto.services.user_svc.v1.CreateOrganizationResponse.deserializeBinary +); + + +/** + * @param {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.proto.services.user_svc.v1.CreateOrganizationResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.proto.services.user_svc.v1.OrganizationServiceClient.prototype.createOrganization = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/proto.services.user_svc.v1.OrganizationService/CreateOrganization', + request, + metadata || {}, + methodDescriptor_OrganizationService_CreateOrganization, + callback); +}; + + +/** + * @param {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.proto.services.user_svc.v1.OrganizationServicePromiseClient.prototype.createOrganization = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/proto.services.user_svc.v1.OrganizationService/CreateOrganization', + request, + metadata || {}, + methodDescriptor_OrganizationService_CreateOrganization); +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.proto.services.user_svc.v1.GetOrganizationRequest, + * !proto.proto.services.user_svc.v1.GetOrganizationResponse>} + */ +const methodDescriptor_OrganizationService_GetOrganization = new grpc.web.MethodDescriptor( + '/proto.services.user_svc.v1.OrganizationService/GetOrganization', + grpc.web.MethodType.UNARY, + proto.proto.services.user_svc.v1.GetOrganizationRequest, + proto.proto.services.user_svc.v1.GetOrganizationResponse, + /** + * @param {!proto.proto.services.user_svc.v1.GetOrganizationRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.proto.services.user_svc.v1.GetOrganizationResponse.deserializeBinary +); + + +/** + * @param {!proto.proto.services.user_svc.v1.GetOrganizationRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.proto.services.user_svc.v1.GetOrganizationResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.proto.services.user_svc.v1.OrganizationServiceClient.prototype.getOrganization = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/proto.services.user_svc.v1.OrganizationService/GetOrganization', + request, + metadata || {}, + methodDescriptor_OrganizationService_GetOrganization, + callback); +}; + + +/** + * @param {!proto.proto.services.user_svc.v1.GetOrganizationRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.proto.services.user_svc.v1.OrganizationServicePromiseClient.prototype.getOrganization = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/proto.services.user_svc.v1.OrganizationService/GetOrganization', + request, + metadata || {}, + methodDescriptor_OrganizationService_GetOrganization); +}; + + +module.exports = proto.proto.services.user_svc.v1; + diff --git a/gen/ts/proto/services/user_svc/v1/organization_svc_pb.d.ts b/gen/ts/proto/services/user_svc/v1/organization_svc_pb.d.ts new file mode 100644 index 000000000..403f355bd --- /dev/null +++ b/gen/ts/proto/services/user_svc/v1/organization_svc_pb.d.ts @@ -0,0 +1,128 @@ +import * as jspb from 'google-protobuf' + + + +export class CreateOrganizationRequest extends jspb.Message { + getLongName(): string; + setLongName(value: string): CreateOrganizationRequest; + + getShortName(): string; + setShortName(value: string): CreateOrganizationRequest; + + getContactEmail(): string; + setContactEmail(value: string): CreateOrganizationRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CreateOrganizationRequest.AsObject; + static toObject(includeInstance: boolean, msg: CreateOrganizationRequest): CreateOrganizationRequest.AsObject; + static serializeBinaryToWriter(message: CreateOrganizationRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CreateOrganizationRequest; + static deserializeBinaryFromReader(message: CreateOrganizationRequest, reader: jspb.BinaryReader): CreateOrganizationRequest; +} + +export namespace CreateOrganizationRequest { + export type AsObject = { + longName: string, + shortName: string, + contactEmail: string, + } +} + +export class CreateOrganizationResponse extends jspb.Message { + getId(): string; + setId(value: string): CreateOrganizationResponse; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CreateOrganizationResponse.AsObject; + static toObject(includeInstance: boolean, msg: CreateOrganizationResponse): CreateOrganizationResponse.AsObject; + static serializeBinaryToWriter(message: CreateOrganizationResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CreateOrganizationResponse; + static deserializeBinaryFromReader(message: CreateOrganizationResponse, reader: jspb.BinaryReader): CreateOrganizationResponse; +} + +export namespace CreateOrganizationResponse { + export type AsObject = { + id: string, + } +} + +export class Member extends jspb.Message { + getUserId(): string; + setUserId(value: string): Member; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Member.AsObject; + static toObject(includeInstance: boolean, msg: Member): Member.AsObject; + static serializeBinaryToWriter(message: Member, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Member; + static deserializeBinaryFromReader(message: Member, reader: jspb.BinaryReader): Member; +} + +export namespace Member { + export type AsObject = { + userId: string, + } +} + +export class GetOrganizationRequest extends jspb.Message { + getId(): string; + setId(value: string): GetOrganizationRequest; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetOrganizationRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetOrganizationRequest): GetOrganizationRequest.AsObject; + static serializeBinaryToWriter(message: GetOrganizationRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetOrganizationRequest; + static deserializeBinaryFromReader(message: GetOrganizationRequest, reader: jspb.BinaryReader): GetOrganizationRequest; +} + +export namespace GetOrganizationRequest { + export type AsObject = { + id: string, + } +} + +export class GetOrganizationResponse extends jspb.Message { + getId(): string; + setId(value: string): GetOrganizationResponse; + + getLongName(): string; + setLongName(value: string): GetOrganizationResponse; + + getShortName(): string; + setShortName(value: string): GetOrganizationResponse; + + getContactEmail(): string; + setContactEmail(value: string): GetOrganizationResponse; + + getAvatarUrl(): string; + setAvatarUrl(value: string): GetOrganizationResponse; + + getIsPersonal(): boolean; + setIsPersonal(value: boolean): GetOrganizationResponse; + + getMembersList(): Array; + setMembersList(value: Array): GetOrganizationResponse; + clearMembersList(): GetOrganizationResponse; + addMembers(value?: Member, index?: number): Member; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetOrganizationResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetOrganizationResponse): GetOrganizationResponse.AsObject; + static serializeBinaryToWriter(message: GetOrganizationResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetOrganizationResponse; + static deserializeBinaryFromReader(message: GetOrganizationResponse, reader: jspb.BinaryReader): GetOrganizationResponse; +} + +export namespace GetOrganizationResponse { + export type AsObject = { + id: string, + longName: string, + shortName: string, + contactEmail: string, + avatarUrl: string, + isPersonal: boolean, + membersList: Array, + } +} + diff --git a/gen/ts/proto/services/user_svc/v1/organization_svc_pb.js b/gen/ts/proto/services/user_svc/v1/organization_svc_pb.js new file mode 100644 index 000000000..ec14c56f6 --- /dev/null +++ b/gen/ts/proto/services/user_svc/v1/organization_svc_pb.js @@ -0,0 +1,1054 @@ +// source: proto/services/user_svc/v1/organization_svc.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = + (typeof globalThis !== 'undefined' && globalThis) || + (typeof window !== 'undefined' && window) || + (typeof global !== 'undefined' && global) || + (typeof self !== 'undefined' && self) || + (function () { return this; }).call(null) || + Function('return this')(); + +goog.exportSymbol('proto.proto.services.user_svc.v1.CreateOrganizationRequest', null, global); +goog.exportSymbol('proto.proto.services.user_svc.v1.CreateOrganizationResponse', null, global); +goog.exportSymbol('proto.proto.services.user_svc.v1.GetOrganizationRequest', null, global); +goog.exportSymbol('proto.proto.services.user_svc.v1.GetOrganizationResponse', null, global); +goog.exportSymbol('proto.proto.services.user_svc.v1.Member', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.proto.services.user_svc.v1.CreateOrganizationRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.proto.services.user_svc.v1.CreateOrganizationRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.proto.services.user_svc.v1.CreateOrganizationRequest.displayName = 'proto.proto.services.user_svc.v1.CreateOrganizationRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.proto.services.user_svc.v1.CreateOrganizationResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.proto.services.user_svc.v1.CreateOrganizationResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.proto.services.user_svc.v1.CreateOrganizationResponse.displayName = 'proto.proto.services.user_svc.v1.CreateOrganizationResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.proto.services.user_svc.v1.Member = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.proto.services.user_svc.v1.Member, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.proto.services.user_svc.v1.Member.displayName = 'proto.proto.services.user_svc.v1.Member'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.proto.services.user_svc.v1.GetOrganizationRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.proto.services.user_svc.v1.GetOrganizationRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.proto.services.user_svc.v1.GetOrganizationRequest.displayName = 'proto.proto.services.user_svc.v1.GetOrganizationRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.proto.services.user_svc.v1.GetOrganizationResponse.repeatedFields_, null); +}; +goog.inherits(proto.proto.services.user_svc.v1.GetOrganizationResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.proto.services.user_svc.v1.GetOrganizationResponse.displayName = 'proto.proto.services.user_svc.v1.GetOrganizationResponse'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.proto.services.user_svc.v1.CreateOrganizationRequest.prototype.toObject = function(opt_includeInstance) { + return proto.proto.services.user_svc.v1.CreateOrganizationRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.services.user_svc.v1.CreateOrganizationRequest.toObject = function(includeInstance, msg) { + var f, obj = { + longName: jspb.Message.getFieldWithDefault(msg, 1, ""), + shortName: jspb.Message.getFieldWithDefault(msg, 2, ""), + contactEmail: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} + */ +proto.proto.services.user_svc.v1.CreateOrganizationRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.proto.services.user_svc.v1.CreateOrganizationRequest; + return proto.proto.services.user_svc.v1.CreateOrganizationRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} + */ +proto.proto.services.user_svc.v1.CreateOrganizationRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setLongName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setShortName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setContactEmail(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.proto.services.user_svc.v1.CreateOrganizationRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.proto.services.user_svc.v1.CreateOrganizationRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.services.user_svc.v1.CreateOrganizationRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getLongName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getShortName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getContactEmail(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string long_name = 1; + * @return {string} + */ +proto.proto.services.user_svc.v1.CreateOrganizationRequest.prototype.getLongName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} returns this + */ +proto.proto.services.user_svc.v1.CreateOrganizationRequest.prototype.setLongName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string short_name = 2; + * @return {string} + */ +proto.proto.services.user_svc.v1.CreateOrganizationRequest.prototype.getShortName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} returns this + */ +proto.proto.services.user_svc.v1.CreateOrganizationRequest.prototype.setShortName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string contact_email = 3; + * @return {string} + */ +proto.proto.services.user_svc.v1.CreateOrganizationRequest.prototype.getContactEmail = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} returns this + */ +proto.proto.services.user_svc.v1.CreateOrganizationRequest.prototype.setContactEmail = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.proto.services.user_svc.v1.CreateOrganizationResponse.prototype.toObject = function(opt_includeInstance) { + return proto.proto.services.user_svc.v1.CreateOrganizationResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.proto.services.user_svc.v1.CreateOrganizationResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.services.user_svc.v1.CreateOrganizationResponse.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.proto.services.user_svc.v1.CreateOrganizationResponse} + */ +proto.proto.services.user_svc.v1.CreateOrganizationResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.proto.services.user_svc.v1.CreateOrganizationResponse; + return proto.proto.services.user_svc.v1.CreateOrganizationResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.proto.services.user_svc.v1.CreateOrganizationResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.proto.services.user_svc.v1.CreateOrganizationResponse} + */ +proto.proto.services.user_svc.v1.CreateOrganizationResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.proto.services.user_svc.v1.CreateOrganizationResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.proto.services.user_svc.v1.CreateOrganizationResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.proto.services.user_svc.v1.CreateOrganizationResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.services.user_svc.v1.CreateOrganizationResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.proto.services.user_svc.v1.CreateOrganizationResponse.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.proto.services.user_svc.v1.CreateOrganizationResponse} returns this + */ +proto.proto.services.user_svc.v1.CreateOrganizationResponse.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.proto.services.user_svc.v1.Member.prototype.toObject = function(opt_includeInstance) { + return proto.proto.services.user_svc.v1.Member.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.proto.services.user_svc.v1.Member} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.services.user_svc.v1.Member.toObject = function(includeInstance, msg) { + var f, obj = { + userId: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.proto.services.user_svc.v1.Member} + */ +proto.proto.services.user_svc.v1.Member.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.proto.services.user_svc.v1.Member; + return proto.proto.services.user_svc.v1.Member.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.proto.services.user_svc.v1.Member} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.proto.services.user_svc.v1.Member} + */ +proto.proto.services.user_svc.v1.Member.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setUserId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.proto.services.user_svc.v1.Member.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.proto.services.user_svc.v1.Member.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.proto.services.user_svc.v1.Member} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.services.user_svc.v1.Member.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUserId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string user_id = 1; + * @return {string} + */ +proto.proto.services.user_svc.v1.Member.prototype.getUserId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.proto.services.user_svc.v1.Member} returns this + */ +proto.proto.services.user_svc.v1.Member.prototype.setUserId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.proto.services.user_svc.v1.GetOrganizationRequest.prototype.toObject = function(opt_includeInstance) { + return proto.proto.services.user_svc.v1.GetOrganizationRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.proto.services.user_svc.v1.GetOrganizationRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.services.user_svc.v1.GetOrganizationRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.proto.services.user_svc.v1.GetOrganizationRequest} + */ +proto.proto.services.user_svc.v1.GetOrganizationRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.proto.services.user_svc.v1.GetOrganizationRequest; + return proto.proto.services.user_svc.v1.GetOrganizationRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.proto.services.user_svc.v1.GetOrganizationRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.proto.services.user_svc.v1.GetOrganizationRequest} + */ +proto.proto.services.user_svc.v1.GetOrganizationRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.proto.services.user_svc.v1.GetOrganizationRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.proto.services.user_svc.v1.GetOrganizationRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.proto.services.user_svc.v1.GetOrganizationRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.services.user_svc.v1.GetOrganizationRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.proto.services.user_svc.v1.GetOrganizationRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.proto.services.user_svc.v1.GetOrganizationRequest} returns this + */ +proto.proto.services.user_svc.v1.GetOrganizationRequest.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.repeatedFields_ = [7]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.prototype.toObject = function(opt_includeInstance) { + return proto.proto.services.user_svc.v1.GetOrganizationResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.proto.services.user_svc.v1.GetOrganizationResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + longName: jspb.Message.getFieldWithDefault(msg, 2, ""), + shortName: jspb.Message.getFieldWithDefault(msg, 3, ""), + contactEmail: jspb.Message.getFieldWithDefault(msg, 4, ""), + avatarUrl: jspb.Message.getFieldWithDefault(msg, 5, ""), + isPersonal: jspb.Message.getBooleanFieldWithDefault(msg, 6, false), + membersList: jspb.Message.toObjectList(msg.getMembersList(), + proto.proto.services.user_svc.v1.Member.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.proto.services.user_svc.v1.GetOrganizationResponse} + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.proto.services.user_svc.v1.GetOrganizationResponse; + return proto.proto.services.user_svc.v1.GetOrganizationResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.proto.services.user_svc.v1.GetOrganizationResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.proto.services.user_svc.v1.GetOrganizationResponse} + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setLongName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setShortName(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setContactEmail(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setAvatarUrl(value); + break; + case 6: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsPersonal(value); + break; + case 7: + var value = new proto.proto.services.user_svc.v1.Member; + reader.readMessage(value,proto.proto.services.user_svc.v1.Member.deserializeBinaryFromReader); + msg.addMembers(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.proto.services.user_svc.v1.GetOrganizationResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.proto.services.user_svc.v1.GetOrganizationResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getLongName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getShortName(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getContactEmail(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getAvatarUrl(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getIsPersonal(); + if (f) { + writer.writeBool( + 6, + f + ); + } + f = message.getMembersList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 7, + f, + proto.proto.services.user_svc.v1.Member.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.proto.services.user_svc.v1.GetOrganizationResponse} returns this + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string long_name = 2; + * @return {string} + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.prototype.getLongName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.proto.services.user_svc.v1.GetOrganizationResponse} returns this + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.prototype.setLongName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string short_name = 3; + * @return {string} + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.prototype.getShortName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.proto.services.user_svc.v1.GetOrganizationResponse} returns this + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.prototype.setShortName = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string contact_email = 4; + * @return {string} + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.prototype.getContactEmail = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.proto.services.user_svc.v1.GetOrganizationResponse} returns this + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.prototype.setContactEmail = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string avatar_url = 5; + * @return {string} + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.prototype.getAvatarUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.proto.services.user_svc.v1.GetOrganizationResponse} returns this + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.prototype.setAvatarUrl = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional bool is_personal = 6; + * @return {boolean} + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.prototype.getIsPersonal = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.proto.services.user_svc.v1.GetOrganizationResponse} returns this + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.prototype.setIsPersonal = function(value) { + return jspb.Message.setProto3BooleanField(this, 6, value); +}; + + +/** + * repeated Member members = 7; + * @return {!Array} + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.prototype.getMembersList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.proto.services.user_svc.v1.Member, 7)); +}; + + +/** + * @param {!Array} value + * @return {!proto.proto.services.user_svc.v1.GetOrganizationResponse} returns this +*/ +proto.proto.services.user_svc.v1.GetOrganizationResponse.prototype.setMembersList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 7, value); +}; + + +/** + * @param {!proto.proto.services.user_svc.v1.Member=} opt_value + * @param {number=} opt_index + * @return {!proto.proto.services.user_svc.v1.Member} + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.prototype.addMembers = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.proto.services.user_svc.v1.Member, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.proto.services.user_svc.v1.GetOrganizationResponse} returns this + */ +proto.proto.services.user_svc.v1.GetOrganizationResponse.prototype.clearMembersList = function() { + return this.setMembersList([]); +}; + + +goog.object.extend(exports, proto.proto.services.user_svc.v1); diff --git a/gen/ts/proto/services/user_svc/v1/user_svc_grpc_web_pb.d.ts b/gen/ts/proto/services/user_svc/v1/user_svc_grpc_web_pb.d.ts index 0fca654e8..7b3eb0049 100644 --- a/gen/ts/proto/services/user_svc/v1/user_svc_grpc_web_pb.d.ts +++ b/gen/ts/proto/services/user_svc/v1/user_svc_grpc_web_pb.d.ts @@ -22,13 +22,6 @@ export class UserServiceClient { response: proto_services_user_svc_v1_user_svc_pb.UpdateUserResponse) => void ): grpcWeb.ClientReadableStream; - createOrganization( - request: proto_services_user_svc_v1_user_svc_pb.CreateOrganizationRequest, - metadata: grpcWeb.Metadata | undefined, - callback: (err: grpcWeb.RpcError, - response: proto_services_user_svc_v1_user_svc_pb.CreateOrganizationResponse) => void - ): grpcWeb.ClientReadableStream; - } export class UserServicePromiseClient { @@ -46,10 +39,5 @@ export class UserServicePromiseClient { metadata?: grpcWeb.Metadata ): Promise; - createOrganization( - request: proto_services_user_svc_v1_user_svc_pb.CreateOrganizationRequest, - metadata?: grpcWeb.Metadata - ): Promise; - } diff --git a/gen/ts/proto/services/user_svc/v1/user_svc_grpc_web_pb.js b/gen/ts/proto/services/user_svc/v1/user_svc_grpc_web_pb.js index 2e5914249..832267cf3 100644 --- a/gen/ts/proto/services/user_svc/v1/user_svc_grpc_web_pb.js +++ b/gen/ts/proto/services/user_svc/v1/user_svc_grpc_web_pb.js @@ -199,66 +199,5 @@ proto.proto.services.user_svc.v1.UserServicePromiseClient.prototype.updateUser = }; -/** - * @const - * @type {!grpc.web.MethodDescriptor< - * !proto.proto.services.user_svc.v1.CreateOrganizationRequest, - * !proto.proto.services.user_svc.v1.CreateOrganizationResponse>} - */ -const methodDescriptor_UserService_CreateOrganization = new grpc.web.MethodDescriptor( - '/proto.services.user_svc.v1.UserService/CreateOrganization', - grpc.web.MethodType.UNARY, - proto.proto.services.user_svc.v1.CreateOrganizationRequest, - proto.proto.services.user_svc.v1.CreateOrganizationResponse, - /** - * @param {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} request - * @return {!Uint8Array} - */ - function(request) { - return request.serializeBinary(); - }, - proto.proto.services.user_svc.v1.CreateOrganizationResponse.deserializeBinary -); - - -/** - * @param {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} request The - * request proto - * @param {?Object} metadata User defined - * call metadata - * @param {function(?grpc.web.RpcError, ?proto.proto.services.user_svc.v1.CreateOrganizationResponse)} - * callback The callback function(error, response) - * @return {!grpc.web.ClientReadableStream|undefined} - * The XHR Node Readable Stream - */ -proto.proto.services.user_svc.v1.UserServiceClient.prototype.createOrganization = - function(request, metadata, callback) { - return this.client_.rpcCall(this.hostname_ + - '/proto.services.user_svc.v1.UserService/CreateOrganization', - request, - metadata || {}, - methodDescriptor_UserService_CreateOrganization, - callback); -}; - - -/** - * @param {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} request The - * request proto - * @param {?Object=} metadata User defined - * call metadata - * @return {!Promise} - * Promise that resolves to the response - */ -proto.proto.services.user_svc.v1.UserServicePromiseClient.prototype.createOrganization = - function(request, metadata) { - return this.client_.unaryCall(this.hostname_ + - '/proto.services.user_svc.v1.UserService/CreateOrganization', - request, - metadata || {}, - methodDescriptor_UserService_CreateOrganization); -}; - - module.exports = proto.proto.services.user_svc.v1; diff --git a/gen/ts/proto/services/user_svc/v1/user_svc_pb.d.ts b/gen/ts/proto/services/user_svc/v1/user_svc_pb.d.ts index f9b9a38d7..a3aba6076 100644 --- a/gen/ts/proto/services/user_svc/v1/user_svc_pb.d.ts +++ b/gen/ts/proto/services/user_svc/v1/user_svc_pb.d.ts @@ -3,18 +3,6 @@ import * as jspb from 'google-protobuf' export class CreateUserRequest extends jspb.Message { - getEmail(): string; - setEmail(value: string): CreateUserRequest; - - getNickname(): string; - setNickname(value: string): CreateUserRequest; - - getFullName(): string; - setFullName(value: string): CreateUserRequest; - - getPassword(): string; - setPassword(value: string): CreateUserRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): CreateUserRequest.AsObject; static toObject(includeInstance: boolean, msg: CreateUserRequest): CreateUserRequest.AsObject; @@ -25,17 +13,10 @@ export class CreateUserRequest extends jspb.Message { export namespace CreateUserRequest { export type AsObject = { - email: string, - nickname: string, - fullName: string, - password: string, } } export class CreateUserResponse extends jspb.Message { - getUserId(): string; - setUserId(value: string): CreateUserResponse; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): CreateUserResponse.AsObject; static toObject(includeInstance: boolean, msg: CreateUserResponse): CreateUserResponse.AsObject; @@ -46,36 +27,10 @@ export class CreateUserResponse extends jspb.Message { export namespace CreateUserResponse { export type AsObject = { - userId: string, } } export class UpdateUserRequest extends jspb.Message { - getUserId(): string; - setUserId(value: string): UpdateUserRequest; - hasUserId(): boolean; - clearUserId(): UpdateUserRequest; - - getFullName(): string; - setFullName(value: string): UpdateUserRequest; - hasFullName(): boolean; - clearFullName(): UpdateUserRequest; - - getNickname(): string; - setNickname(value: string): UpdateUserRequest; - hasNickname(): boolean; - clearNickname(): UpdateUserRequest; - - getEmail(): string; - setEmail(value: string): UpdateUserRequest; - hasEmail(): boolean; - clearEmail(): UpdateUserRequest; - - getPassword(): string; - setPassword(value: string): UpdateUserRequest; - hasPassword(): boolean; - clearPassword(): UpdateUserRequest; - serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): UpdateUserRequest.AsObject; static toObject(includeInstance: boolean, msg: UpdateUserRequest): UpdateUserRequest.AsObject; @@ -86,36 +41,6 @@ export class UpdateUserRequest extends jspb.Message { export namespace UpdateUserRequest { export type AsObject = { - userId?: string, - fullName?: string, - nickname?: string, - email?: string, - password?: string, - } - - export enum UserIdCase { - _USER_ID_NOT_SET = 0, - USER_ID = 1, - } - - export enum FullNameCase { - _FULL_NAME_NOT_SET = 0, - FULL_NAME = 2, - } - - export enum NicknameCase { - _NICKNAME_NOT_SET = 0, - NICKNAME = 3, - } - - export enum EmailCase { - _EMAIL_NOT_SET = 0, - EMAIL = 4, - } - - export enum PasswordCase { - _PASSWORD_NOT_SET = 0, - PASSWORD = 5, } } @@ -133,67 +58,3 @@ export namespace UpdateUserResponse { } } -export class CreateOrganizationRequest extends jspb.Message { - getLongName(): string; - setLongName(value: string): CreateOrganizationRequest; - - getShortName(): string; - setShortName(value: string): CreateOrganizationRequest; - - getContactEmail(): string; - setContactEmail(value: string): CreateOrganizationRequest; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): CreateOrganizationRequest.AsObject; - static toObject(includeInstance: boolean, msg: CreateOrganizationRequest): CreateOrganizationRequest.AsObject; - static serializeBinaryToWriter(message: CreateOrganizationRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): CreateOrganizationRequest; - static deserializeBinaryFromReader(message: CreateOrganizationRequest, reader: jspb.BinaryReader): CreateOrganizationRequest; -} - -export namespace CreateOrganizationRequest { - export type AsObject = { - longName: string, - shortName: string, - contactEmail: string, - } -} - -export class CreateOrganizationResponse extends jspb.Message { - getId(): string; - setId(value: string): CreateOrganizationResponse; - - getLongName(): string; - setLongName(value: string): CreateOrganizationResponse; - - getShortName(): string; - setShortName(value: string): CreateOrganizationResponse; - - getContactEmail(): string; - setContactEmail(value: string): CreateOrganizationResponse; - - getAvatarUrl(): string; - setAvatarUrl(value: string): CreateOrganizationResponse; - - getIsPersonal(): boolean; - setIsPersonal(value: boolean): CreateOrganizationResponse; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): CreateOrganizationResponse.AsObject; - static toObject(includeInstance: boolean, msg: CreateOrganizationResponse): CreateOrganizationResponse.AsObject; - static serializeBinaryToWriter(message: CreateOrganizationResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): CreateOrganizationResponse; - static deserializeBinaryFromReader(message: CreateOrganizationResponse, reader: jspb.BinaryReader): CreateOrganizationResponse; -} - -export namespace CreateOrganizationResponse { - export type AsObject = { - id: string, - longName: string, - shortName: string, - contactEmail: string, - avatarUrl: string, - isPersonal: boolean, - } -} - diff --git a/gen/ts/proto/services/user_svc/v1/user_svc_pb.js b/gen/ts/proto/services/user_svc/v1/user_svc_pb.js index 8fb8392f5..4ff9ef8e1 100644 --- a/gen/ts/proto/services/user_svc/v1/user_svc_pb.js +++ b/gen/ts/proto/services/user_svc/v1/user_svc_pb.js @@ -21,8 +21,6 @@ var global = (function () { return this; }).call(null) || Function('return this')(); -goog.exportSymbol('proto.proto.services.user_svc.v1.CreateOrganizationRequest', null, global); -goog.exportSymbol('proto.proto.services.user_svc.v1.CreateOrganizationResponse', null, global); goog.exportSymbol('proto.proto.services.user_svc.v1.CreateUserRequest', null, global); goog.exportSymbol('proto.proto.services.user_svc.v1.CreateUserResponse', null, global); goog.exportSymbol('proto.proto.services.user_svc.v1.UpdateUserRequest', null, global); @@ -111,48 +109,6 @@ if (goog.DEBUG && !COMPILED) { */ proto.proto.services.user_svc.v1.UpdateUserResponse.displayName = 'proto.proto.services.user_svc.v1.UpdateUserResponse'; } -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.proto.services.user_svc.v1.CreateOrganizationRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.proto.services.user_svc.v1.CreateOrganizationRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.proto.services.user_svc.v1.CreateOrganizationRequest.displayName = 'proto.proto.services.user_svc.v1.CreateOrganizationRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.proto.services.user_svc.v1.CreateOrganizationResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.proto.services.user_svc.v1.CreateOrganizationResponse.displayName = 'proto.proto.services.user_svc.v1.CreateOrganizationResponse'; -} @@ -185,10 +141,7 @@ proto.proto.services.user_svc.v1.CreateUserRequest.prototype.toObject = function */ proto.proto.services.user_svc.v1.CreateUserRequest.toObject = function(includeInstance, msg) { var f, obj = { - email: jspb.Message.getFieldWithDefault(msg, 1, ""), - nickname: jspb.Message.getFieldWithDefault(msg, 2, ""), - fullName: jspb.Message.getFieldWithDefault(msg, 3, ""), - password: jspb.Message.getFieldWithDefault(msg, 4, "") + }; if (includeInstance) { @@ -225,22 +178,6 @@ proto.proto.services.user_svc.v1.CreateUserRequest.deserializeBinaryFromReader = } var field = reader.getFieldNumber(); switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setEmail(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setNickname(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setFullName(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setPassword(value); - break; default: reader.skipField(); break; @@ -270,106 +207,6 @@ proto.proto.services.user_svc.v1.CreateUserRequest.prototype.serializeBinary = f */ proto.proto.services.user_svc.v1.CreateUserRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getEmail(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getNickname(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getFullName(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getPassword(); - if (f.length > 0) { - writer.writeString( - 4, - f - ); - } -}; - - -/** - * optional string email = 1; - * @return {string} - */ -proto.proto.services.user_svc.v1.CreateUserRequest.prototype.getEmail = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.proto.services.user_svc.v1.CreateUserRequest} returns this - */ -proto.proto.services.user_svc.v1.CreateUserRequest.prototype.setEmail = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string nickname = 2; - * @return {string} - */ -proto.proto.services.user_svc.v1.CreateUserRequest.prototype.getNickname = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.proto.services.user_svc.v1.CreateUserRequest} returns this - */ -proto.proto.services.user_svc.v1.CreateUserRequest.prototype.setNickname = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string full_name = 3; - * @return {string} - */ -proto.proto.services.user_svc.v1.CreateUserRequest.prototype.getFullName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.proto.services.user_svc.v1.CreateUserRequest} returns this - */ -proto.proto.services.user_svc.v1.CreateUserRequest.prototype.setFullName = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional string password = 4; - * @return {string} - */ -proto.proto.services.user_svc.v1.CreateUserRequest.prototype.getPassword = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** - * @param {string} value - * @return {!proto.proto.services.user_svc.v1.CreateUserRequest} returns this - */ -proto.proto.services.user_svc.v1.CreateUserRequest.prototype.setPassword = function(value) { - return jspb.Message.setProto3StringField(this, 4, value); }; @@ -405,7 +242,7 @@ proto.proto.services.user_svc.v1.CreateUserResponse.prototype.toObject = functio */ proto.proto.services.user_svc.v1.CreateUserResponse.toObject = function(includeInstance, msg) { var f, obj = { - userId: jspb.Message.getFieldWithDefault(msg, 1, "") + }; if (includeInstance) { @@ -442,10 +279,6 @@ proto.proto.services.user_svc.v1.CreateUserResponse.deserializeBinaryFromReader } var field = reader.getFieldNumber(); switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setUserId(value); - break; default: reader.skipField(); break; @@ -475,31 +308,6 @@ proto.proto.services.user_svc.v1.CreateUserResponse.prototype.serializeBinary = */ proto.proto.services.user_svc.v1.CreateUserResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getUserId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string user_id = 1; - * @return {string} - */ -proto.proto.services.user_svc.v1.CreateUserResponse.prototype.getUserId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.proto.services.user_svc.v1.CreateUserResponse} returns this - */ -proto.proto.services.user_svc.v1.CreateUserResponse.prototype.setUserId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); }; @@ -535,11 +343,7 @@ proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.toObject = function */ proto.proto.services.user_svc.v1.UpdateUserRequest.toObject = function(includeInstance, msg) { var f, obj = { - userId: jspb.Message.getFieldWithDefault(msg, 1, ""), - fullName: jspb.Message.getFieldWithDefault(msg, 2, ""), - nickname: jspb.Message.getFieldWithDefault(msg, 3, ""), - email: jspb.Message.getFieldWithDefault(msg, 4, ""), - password: jspb.Message.getFieldWithDefault(msg, 5, "") + }; if (includeInstance) { @@ -576,26 +380,6 @@ proto.proto.services.user_svc.v1.UpdateUserRequest.deserializeBinaryFromReader = } var field = reader.getFieldNumber(); switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setUserId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setFullName(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setNickname(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setEmail(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setPassword(value); - break; default: reader.skipField(); break; @@ -625,221 +409,6 @@ proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.serializeBinary = f */ proto.proto.services.user_svc.v1.UpdateUserRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = /** @type {string} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeString( - 1, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeString( - 2, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeString( - 3, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeString( - 4, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeString( - 5, - f - ); - } -}; - - -/** - * optional string user_id = 1; - * @return {string} - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.getUserId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.proto.services.user_svc.v1.UpdateUserRequest} returns this - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.setUserId = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.proto.services.user_svc.v1.UpdateUserRequest} returns this - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.clearUserId = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.hasUserId = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional string full_name = 2; - * @return {string} - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.getFullName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.proto.services.user_svc.v1.UpdateUserRequest} returns this - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.setFullName = function(value) { - return jspb.Message.setField(this, 2, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.proto.services.user_svc.v1.UpdateUserRequest} returns this - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.clearFullName = function() { - return jspb.Message.setField(this, 2, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.hasFullName = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional string nickname = 3; - * @return {string} - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.getNickname = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.proto.services.user_svc.v1.UpdateUserRequest} returns this - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.setNickname = function(value) { - return jspb.Message.setField(this, 3, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.proto.services.user_svc.v1.UpdateUserRequest} returns this - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.clearNickname = function() { - return jspb.Message.setField(this, 3, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.hasNickname = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional string email = 4; - * @return {string} - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.getEmail = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** - * @param {string} value - * @return {!proto.proto.services.user_svc.v1.UpdateUserRequest} returns this - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.setEmail = function(value) { - return jspb.Message.setField(this, 4, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.proto.services.user_svc.v1.UpdateUserRequest} returns this - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.clearEmail = function() { - return jspb.Message.setField(this, 4, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.hasEmail = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional string password = 5; - * @return {string} - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.getPassword = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - - -/** - * @param {string} value - * @return {!proto.proto.services.user_svc.v1.UpdateUserRequest} returns this - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.setPassword = function(value) { - return jspb.Message.setField(this, 5, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.proto.services.user_svc.v1.UpdateUserRequest} returns this - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.clearPassword = function() { - return jspb.Message.setField(this, 5, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.proto.services.user_svc.v1.UpdateUserRequest.prototype.hasPassword = function() { - return jspb.Message.getField(this, 5) != null; }; @@ -944,474 +513,4 @@ proto.proto.services.user_svc.v1.UpdateUserResponse.serializeBinaryToWriter = fu }; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.proto.services.user_svc.v1.CreateOrganizationRequest.prototype.toObject = function(opt_includeInstance) { - return proto.proto.services.user_svc.v1.CreateOrganizationRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.proto.services.user_svc.v1.CreateOrganizationRequest.toObject = function(includeInstance, msg) { - var f, obj = { - longName: jspb.Message.getFieldWithDefault(msg, 1, ""), - shortName: jspb.Message.getFieldWithDefault(msg, 2, ""), - contactEmail: jspb.Message.getFieldWithDefault(msg, 3, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} - */ -proto.proto.services.user_svc.v1.CreateOrganizationRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.proto.services.user_svc.v1.CreateOrganizationRequest; - return proto.proto.services.user_svc.v1.CreateOrganizationRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} - */ -proto.proto.services.user_svc.v1.CreateOrganizationRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setLongName(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setShortName(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setContactEmail(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.proto.services.user_svc.v1.CreateOrganizationRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.proto.services.user_svc.v1.CreateOrganizationRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.proto.services.user_svc.v1.CreateOrganizationRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getLongName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getShortName(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getContactEmail(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } -}; - - -/** - * optional string long_name = 1; - * @return {string} - */ -proto.proto.services.user_svc.v1.CreateOrganizationRequest.prototype.getLongName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} returns this - */ -proto.proto.services.user_svc.v1.CreateOrganizationRequest.prototype.setLongName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string short_name = 2; - * @return {string} - */ -proto.proto.services.user_svc.v1.CreateOrganizationRequest.prototype.getShortName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} returns this - */ -proto.proto.services.user_svc.v1.CreateOrganizationRequest.prototype.setShortName = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string contact_email = 3; - * @return {string} - */ -proto.proto.services.user_svc.v1.CreateOrganizationRequest.prototype.getContactEmail = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.proto.services.user_svc.v1.CreateOrganizationRequest} returns this - */ -proto.proto.services.user_svc.v1.CreateOrganizationRequest.prototype.setContactEmail = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse.prototype.toObject = function(opt_includeInstance) { - return proto.proto.services.user_svc.v1.CreateOrganizationResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.proto.services.user_svc.v1.CreateOrganizationResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse.toObject = function(includeInstance, msg) { - var f, obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, ""), - longName: jspb.Message.getFieldWithDefault(msg, 2, ""), - shortName: jspb.Message.getFieldWithDefault(msg, 3, ""), - contactEmail: jspb.Message.getFieldWithDefault(msg, 4, ""), - avatarUrl: jspb.Message.getFieldWithDefault(msg, 5, ""), - isPersonal: jspb.Message.getBooleanFieldWithDefault(msg, 6, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.proto.services.user_svc.v1.CreateOrganizationResponse} - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.proto.services.user_svc.v1.CreateOrganizationResponse; - return proto.proto.services.user_svc.v1.CreateOrganizationResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.proto.services.user_svc.v1.CreateOrganizationResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.proto.services.user_svc.v1.CreateOrganizationResponse} - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setLongName(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setShortName(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setContactEmail(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setAvatarUrl(value); - break; - case 6: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setIsPersonal(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.proto.services.user_svc.v1.CreateOrganizationResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.proto.services.user_svc.v1.CreateOrganizationResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getLongName(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getShortName(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getContactEmail(); - if (f.length > 0) { - writer.writeString( - 4, - f - ); - } - f = message.getAvatarUrl(); - if (f.length > 0) { - writer.writeString( - 5, - f - ); - } - f = message.getIsPersonal(); - if (f) { - writer.writeBool( - 6, - f - ); - } -}; - - -/** - * optional string id = 1; - * @return {string} - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.proto.services.user_svc.v1.CreateOrganizationResponse} returns this - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse.prototype.setId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string long_name = 2; - * @return {string} - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse.prototype.getLongName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.proto.services.user_svc.v1.CreateOrganizationResponse} returns this - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse.prototype.setLongName = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string short_name = 3; - * @return {string} - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse.prototype.getShortName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.proto.services.user_svc.v1.CreateOrganizationResponse} returns this - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse.prototype.setShortName = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional string contact_email = 4; - * @return {string} - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse.prototype.getContactEmail = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** - * @param {string} value - * @return {!proto.proto.services.user_svc.v1.CreateOrganizationResponse} returns this - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse.prototype.setContactEmail = function(value) { - return jspb.Message.setProto3StringField(this, 4, value); -}; - - -/** - * optional string avatar_url = 5; - * @return {string} - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse.prototype.getAvatarUrl = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - - -/** - * @param {string} value - * @return {!proto.proto.services.user_svc.v1.CreateOrganizationResponse} returns this - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse.prototype.setAvatarUrl = function(value) { - return jspb.Message.setProto3StringField(this, 5, value); -}; - - -/** - * optional bool is_personal = 6; - * @return {boolean} - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse.prototype.getIsPersonal = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.proto.services.user_svc.v1.CreateOrganizationResponse} returns this - */ -proto.proto.services.user_svc.v1.CreateOrganizationResponse.prototype.setIsPersonal = function(value) { - return jspb.Message.setProto3BooleanField(this, 6, value); -}; - - goog.object.extend(exports, proto.proto.services.user_svc.v1); diff --git a/proto/services/user_svc/v1/organization_svc.proto b/proto/services/user_svc/v1/organization_svc.proto new file mode 100644 index 000000000..b0e8007ed --- /dev/null +++ b/proto/services/user_svc/v1/organization_svc.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; + +package proto.services.user_svc.v1; + +option go_package = "gen/proto/services/user-svc"; + +// +// CreateOrganization +// + +message CreateOrganizationRequest { + string long_name = 1; // @gotags: validate:"required,gte=4,lte=64" + string short_name = 2; // @gotags: validate:"omitempty,gte=2,lte=16" + string contact_email = 3; // @gotags: validate:"required,email" +} + +message CreateOrganizationResponse { + string id = 1; +} + +// +// GetOrganization +// + +message Member { + string user_id = 1; +} + +message GetOrganizationRequest { + string id = 1; // @gotags: validate:"uuid4" +} + +message GetOrganizationResponse { + string id = 1; + string long_name = 2; + string short_name = 3; + string contact_email = 4; + string avatar_url = 5; + bool is_personal = 6; + repeated Member members = 7; +} + +// +// OrganizationService +// + +service OrganizationService { + rpc CreateOrganization (CreateOrganizationRequest) returns (CreateOrganizationResponse) {} + rpc GetOrganization (GetOrganizationRequest) returns (GetOrganizationResponse) {} +} diff --git a/proto/services/user_svc/v1/user_svc.proto b/proto/services/user_svc/v1/user_svc.proto index c8623d520..0906dac6f 100644 --- a/proto/services/user_svc/v1/user_svc.proto +++ b/proto/services/user_svc/v1/user_svc.proto @@ -5,53 +5,27 @@ package proto.services.user_svc.v1; option go_package = "gen/proto/services/user-svc"; // -// Create User +// CreateUser // message CreateUserRequest { - string email = 1; // @gotags: validate:"required,email" - string nickname = 2; // @gotags: validate:"required" - string full_name = 3; // @gotags: validate:"required" - string password = 4; // @gotags: validate:"required" + // TODO } message CreateUserResponse { - string user_id = 1; + // TODO } // -// Update User +// UpdateUser // message UpdateUserRequest { - // if userId is missing the requesting user's id is used - optional string user_id = 1; // @gotags: validate:"omitempty,uuid4" - optional string full_name = 2; - optional string nickname = 3; - optional string email = 4; // @gotags: validate:"omitempty,email" - optional string password = 5; + // TODO } -message UpdateUserResponse {} - -// -// Create Organization -// - -// Just some test comment for to trigger the ci -message CreateOrganizationRequest { - string long_name = 1; // @gotags: validate:"required,gte=4,lte=64" - string short_name = 2; // @gotags: validate:"omitempty,gte=2,lte=16" - string contact_email = 3; // @gotags: validate:"required,email" -} - -message CreateOrganizationResponse { - string id = 1; - string long_name = 2; - string short_name = 3; - string contact_email = 4; - string avatar_url = 5; - bool is_personal = 6; +message UpdateUserResponse { + // TODO } // @@ -61,6 +35,4 @@ message CreateOrganizationResponse { service UserService { rpc CreateUser (CreateUserRequest) returns (CreateUserResponse) {} rpc UpdateUser (UpdateUserRequest) returns (UpdateUserResponse) {} - - rpc CreateOrganization (CreateOrganizationRequest) returns (CreateOrganizationResponse) {} } diff --git a/services/user-svc/go.mod b/services/user-svc/go.mod index a322b2416..9b7735a59 100644 --- a/services/user-svc/go.mod +++ b/services/user-svc/go.mod @@ -13,13 +13,13 @@ replace ( require ( common v0.0.0 gen v0.0.0 - github.com/Nerzal/gocloak/v12 v12.0.0 github.com/dapr/go-sdk v1.6.1-0.20230224224332-7c5ecee155cc + github.com/google/uuid v1.3.0 github.com/rs/zerolog v1.28.0 google.golang.org/grpc v1.54.0 - google.golang.org/protobuf v1.30.0 + gorm.io/gorm v1.24.2 + hwgorm v0.0.0 hwutil v0.0.0 - logging v0.0.0 ) require ( @@ -28,19 +28,24 @@ require ( github.com/go-playground/locales v0.14.0 // indirect github.com/go-playground/universal-translator v0.18.0 // indirect github.com/go-playground/validator/v10 v10.11.1 // indirect - github.com/go-resty/resty/v2 v2.7.0 // indirect - github.com/golang-jwt/jwt/v4 v4.4.2 // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/google/uuid v1.3.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/jackc/chunkreader/v2 v2.0.1 // indirect + github.com/jackc/pgconn v1.13.0 // indirect + github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa // indirect + github.com/jackc/pgio v1.0.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgproto3/v2 v2.3.1 // indirect + github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect + github.com/jackc/pgtype v1.12.0 // indirect + github.com/jackc/pgx/v4 v4.17.2 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.4 // indirect github.com/joho/godotenv v1.4.0 // indirect github.com/leodido/go-urn v1.2.1 // indirect github.com/mattn/go-colorable v0.1.12 // indirect github.com/mattn/go-isatty v0.0.14 // indirect - github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/pquerna/cachecontrol v0.1.0 // indirect - github.com/segmentio/ksuid v1.0.4 // indirect golang.org/x/crypto v0.0.0-20221012134737-56aed061732a // indirect golang.org/x/net v0.8.0 // indirect golang.org/x/oauth2 v0.4.0 // indirect @@ -48,6 +53,9 @@ require ( golang.org/x/text v0.8.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 // indirect + google.golang.org/protobuf v1.30.0 // indirect gopkg.in/square/go-jose.v2 v2.6.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + gorm.io/driver/postgres v1.4.5 // indirect + logging v0.0.0 // indirect ) diff --git a/services/user-svc/go.sum b/services/user-svc/go.sum index 5920c2c2b..4e9f290b1 100644 --- a/services/user-svc/go.sum +++ b/services/user-svc/go.sum @@ -3,14 +3,19 @@ cloud.google.com/go v0.105.0 h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y= cloud.google.com/go/compute v1.15.1 h1:7UGq3QknM33pw5xATlpzeoomNxsacIVvTqTTvbfajmE= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/Nerzal/gocloak/v12 v12.0.0 h1:oOddyLpf+CxdGHFx5bABn4yCAtIGDwJkvJP4hFSospY= -github.com/Nerzal/gocloak/v12 v12.0.0/go.mod h1:EAIc7luf3+dwMMHNWC9/X9vAA+KZJl5qfSWDIu7IlSs= +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= +github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/coreos/go-oidc v2.2.1+incompatible h1:mh48q/BqXqgjVHpy2ZY7WnWAbenxRjsz9N1i1YxjHAk= github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/dapr/go-sdk v1.6.1-0.20230224224332-7c5ecee155cc h1:BX76LzBCgY2gS1fSf1qab1n1HSYAe1heSdKKnLklNZE= github.com/dapr/go-sdk v1.6.1-0.20230224224332-7c5ecee155cc/go.mod h1:kWMKJ39k2smLVnB6v5Y6dMbwfj1Z3XBxa4Q2dCFzf2U= @@ -24,7 +29,9 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= @@ -33,13 +40,11 @@ github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/j github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= -github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= -github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= -github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -52,33 +57,97 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= +github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= +github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= +github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= +github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= +github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= +github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= +github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.13.0 h1:3L1XMNV2Zvca/8BYhzcRFS70Lr0WlDg16Di6SFGAbys= +github.com/jackc/pgconn v1.13.0/go.mod h1:AnowpAqO4CMIIJNZl2VJp+KrkAZciAkhEl0W0JIobpI= +github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa h1:s+4MhCQ6YrzisK6hFJUX53drDT4UsSW3DEhKn0ifuHw= +github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa/go.mod h1:a/s9Lp5W7n/DD0VrVoyJ00FbP2ytTPDVOivvn2bMlds= +github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= +github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= +github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= +github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= +github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.3.1 h1:nwj7qwf0S+Q7ISFfBndqeLwSwxs+4DPsbRFjECT1Y4Y= +github.com/jackc/pgproto3/v2 v2.3.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= +github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= +github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= +github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= +github.com/jackc/pgtype v1.12.0 h1:Dlq8Qvcch7kiehm8wPGIW0W3KsCCHJnRacKW0UM8n5w= +github.com/jackc/pgtype v1.12.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= +github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= +github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= +github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= +github.com/jackc/pgx/v4 v4.17.2 h1:0Ut0rpeKwvIVbMQ1KbMBU4h6wxehBI535LK6Flheh8E= +github.com/jackc/pgx/v4 v4.17.2/go.mod h1:lcxIZN44yMIrWI78a5CpucdD14hX0SBDbNRvjDBItsw= +github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.1.4 h1:tHnRBy1i5F2Dh8BAFxqFzxKqqvezXrL2OW1TnX+Mlas= +github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -88,38 +157,69 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/pquerna/cachecontrol v0.1.0 h1:yJMy84ti9h/+OEWa752kBTKv4XC30OtVVHYv/8cTqKc= github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= +github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= github.com/rs/zerolog v1.28.0 h1:MirSo27VyNi7RJYP3078AA1+Cyzd2GB66qy3aUHvsWY= github.com/rs/zerolog v1.28.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= -github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c= -github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20221012134737-56aed061732a h1:NmSIgad6KjE6VvHciPZuNRTKxGhlPfD6OA87W/PLkqg= golang.org/x/crypto v0.0.0-20221012134737-56aed061732a/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -129,9 +229,10 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= @@ -144,9 +245,16 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -156,10 +264,12 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= @@ -168,10 +278,18 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -201,6 +319,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -208,5 +327,11 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gorm.io/driver/postgres v1.4.5 h1:mTeXTTtHAgnS9PgmhN2YeUbazYpLhUI1doLnw42XUZc= +gorm.io/driver/postgres v1.4.5/go.mod h1:GKNQYSJ14qvWkvPwXljMGehpKrhlDNsqYRr5HnYGncg= +gorm.io/gorm v1.24.1-0.20221019064659-5dd2bb482755/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= +gorm.io/gorm v1.24.2 h1:9wR6CFD+G8nOusLdvkZelOEhpJVwwHzpQOUM+REd6U0= +gorm.io/gorm v1.24.2/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= diff --git a/services/user-svc/internal/organization/organization.go b/services/user-svc/internal/organization/organization.go new file mode 100644 index 000000000..fa6354005 --- /dev/null +++ b/services/user-svc/internal/organization/organization.go @@ -0,0 +1,193 @@ +package organization + +import ( + "common" + "context" + pb "gen/proto/services/user_svc/v1" + "github.com/google/uuid" + zlog "github.com/rs/zerolog/log" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gorm.io/gorm" + "hwgorm" +) + +type Base struct { + LongName string `gorm:"column:long_name"` + ShortName string `gorm:"column:short_name"` + ContactEmail string `gorm:"column:contact_email"` + AvatarUrl string `gorm:"column:avatar_url"` + IsPersonal bool `gorm:"column:is_personal"` +} + +type Organization struct { + Base + ID uuid.UUID `gorm:"column:id"` + CreatedByUserId uuid.UUID `gorm:"column:created_by_user_id"` + Members []Member `gorm:"foreignKey:OrganizationID"` +} + +type Member struct { + ID uuid.UUID `gorm:"primaryKey,column:id"` + UserID uuid.UUID `gorm:"column:user_id"` + OrganizationID uuid.UUID `gorm:"column:organization_id"` +} + +type ServiceServer struct { + pb.UnimplementedOrganizationServiceServer +} + +func NewServiceServer() *ServiceServer { + return &ServiceServer{} +} + +func (s ServiceServer) CreateOrganization(ctx context.Context, req *pb.CreateOrganizationRequest) (*pb.CreateOrganizationResponse, error) { + db := hwgorm.GetDB(ctx) + + claims, err := common.GetAuthClaims(ctx) + if err != nil { + return nil, err + } + + userID, err := uuid.Parse(claims.Sub) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + var organization Organization + err = db.Transaction(func(tx *gorm.DB) error { + organizationPtr, err := CreateOrganization( + ctx, + tx, + Base{ + LongName: req.LongName, + ShortName: req.ShortName, + ContactEmail: req.ContactEmail, + IsPersonal: false, + }, + userID, + ) + if err != nil { + return err + } + + organization = *organizationPtr + + if err := AddUserToOrganization(ctx, tx, userID, organization.ID); err != nil { + return err + } + + return nil + }) + + if err != nil { + if hwgorm.IsOurFault(err) { + return nil, status.Error(codes.Internal, err.Error()) + } else { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + } + + // TODO: Dispatch OrganizationCreatedEvent & UserJoinedOrganizationEvent + + return &pb.CreateOrganizationResponse{ + Id: organization.ID.String(), + }, nil +} + +func (s ServiceServer) GetOrganization(ctx context.Context, req *pb.GetOrganizationRequest) (*pb.GetOrganizationResponse, error) { + db := hwgorm.GetDB(ctx) + + // TODO: Auth + + id, err := uuid.Parse(req.Id) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + organization, err := GetOrganizationById(db, id) + if err != nil { + if hwgorm.IsOurFault(err) { + return nil, status.Error(codes.Internal, err.Error()) + } else { + return nil, status.Error(codes.InvalidArgument, "id not found") + } + } + + // TODO: Move members out of GetOrganizationResponse into GetMembers with pagination + var members []*pb.Member + for _, member := range organization.Members { + members = append(members, &pb.Member{UserId: member.UserID.String()}) + } + + return &pb.GetOrganizationResponse{ + Id: organization.ID.String(), + LongName: organization.LongName, + ShortName: organization.ShortName, + ContactEmail: organization.ContactEmail, + AvatarUrl: organization.AvatarUrl, + IsPersonal: false, + Members: members, + }, nil +} + +func CreateOrganization(ctx context.Context, db *gorm.DB, attr Base, creatorUserId uuid.UUID) (*Organization, error) { + log := zlog.Ctx(ctx) + + // TODO: Auth + + organization := Organization{ + Base: Base{ + LongName: attr.LongName, + ShortName: attr.ShortName, + ContactEmail: attr.ContactEmail, + AvatarUrl: attr.AvatarUrl, + IsPersonal: attr.IsPersonal, + }, + CreatedByUserId: creatorUserId, + Members: []Member{}, + } + + if err := db.Create(&organization).Error; err != nil { + return nil, err + } + + log.Info(). + Str("organizationId", organization.ID.String()). + Str("userId", creatorUserId.String()). + Msg("organization created") + + return &organization, nil +} + +func AddUserToOrganization(ctx context.Context, db *gorm.DB, userId uuid.UUID, organizationId uuid.UUID) error { + log := zlog.Ctx(ctx) + + organization := Organization{ID: organizationId} + member := Member{ + UserID: userId, + } + + if err := db.Model(&organization).Association("Members").Append(&member); err != nil { + return err + } + + log.Info(). + Str("organizationId", organizationId.String()). + Str("userId", userId.String()). + Msg("added user to organization") + + // TODO: Dispatch UserJoinedOrganizationEvent + + return nil +} + +func GetOrganizationById(db *gorm.DB, id uuid.UUID) (*Organization, error) { + organization := Organization{ID: id} + + if err := db.Preload("Members").First(&organization).Error; err != nil { + return nil, err + } + + return &organization, nil +} diff --git a/services/user-svc/internal/user/user.go b/services/user-svc/internal/user/user.go new file mode 100644 index 000000000..7ae6cd923 --- /dev/null +++ b/services/user-svc/internal/user/user.go @@ -0,0 +1,17 @@ +package user + +import ( + pb "gen/proto/services/user_svc/v1" +) + +// TODO: The whole user service needs to be re-implemented against the Ory API + +type ServiceServer struct { + pb.UnimplementedUserServiceServer +} + +func NewServiceServer() *ServiceServer { + return &ServiceServer{} +} + +// TODO: Re-Implement CreateUser & UpdateUser diff --git a/services/user-svc/main.go b/services/user-svc/main.go index 045e45d0d..f755fdf4c 100644 --- a/services/user-svc/main.go +++ b/services/user-svc/main.go @@ -2,22 +2,13 @@ package main import ( "common" - "context" - "github.com/Nerzal/gocloak/v12" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" - "hwutil" - "logging" - "strconv" - "time" - - events "gen/proto/libs/events/v1" + "fmt" pb "gen/proto/services/user_svc/v1" - daprc "github.com/dapr/go-sdk/client" - daprcmn "github.com/dapr/go-sdk/service/common" daprd "github.com/dapr/go-sdk/service/grpc" - zlog "github.com/rs/zerolog/log" + "hwgorm" + "hwutil" + "user-svc/internal/organization" + "user-svc/internal/user" ) const ServiceName = "user-svc" @@ -25,350 +16,23 @@ const ServiceName = "user-svc" // Version is set at compile time var Version string -// set in prepareGocloakClient -var gocloakClient *gocloak.GoCloak -var realm string - func main() { - common.Setup(ServiceName, Version, true) - - prepareGocloakClient() - - addr := ":" + hwutil.GetEnvOr("PORT", "8080") - common.StartNewGRPCServer(addr, func(server *daprd.Server) { - common.MustAddTopicEventHandler(server, SubUserCreated, OnUserCreated) - pb.RegisterUserServiceServer(server.GrpcServer(), &userServiceServer{}) - }) -} - -// use getServiceAccountToken instead -var lastToken *gocloak.JWT = nil -var lastTokenExp time.Time + common.Setup(ServiceName, Version, false) // TODO: enable auth when KC -> ory migration is done -// getServiceAccountToken returns a valid token, or errors trying, do not mutate the token -func getServiceAccountToken(logCtx context.Context) (*gocloak.JWT, error) { - if lastToken != nil && lastTokenExp.After(time.Now().Add(10*time.Second)) { - return lastToken, nil - } - - ctx := context.Background() - clientID := hwutil.MustGetEnv("CLIENT_ID") - clientSecret := hwutil.MustGetEnv("CLIENT_SECRET") - token, err := gocloakClient.LoginClient(ctx, clientID, clientSecret, realm) - if err == nil { - lastToken = token - lastTokenExp = hwutil.TimeInNSeconds(token.ExpiresIn) - zlog.Ctx(logCtx).Info().Msgf("obtained new token, expires %s", lastTokenExp) - } - return token, err -} - -func prepareGocloakClient() { - realm = common.KeycloakRealm() - gocloakClient = gocloak.NewClient(common.KeycloakBaseURL()) - - token, err := getServiceAccountToken(context.Background()) - - if err != nil { - zlog.Fatal().Err(err).Send() - } - - zlog.Info().Msg("obtained initial access token for service account") - zlog.Trace().Msgf("%+v", token) -} - -type userServiceServer struct { - pb.UnimplementedUserServiceServer -} + hwgorm.SetupDatabase( + hwutil.GetEnvOr("POSTGRES_HOST", "localhost"), + hwutil.GetEnvOr("POSTGRES_USER", "postgres"), + hwutil.GetEnvOr("POSTGRES_PASSWORD", "postgres"), + hwutil.GetEnvOr("POSTGRES_DB", "postgres"), + hwutil.GetEnvOr("POSTGRES_PORT", "5432"), + ) -func (userServiceServer) CreateUser(ctx context.Context, request *pb.CreateUserRequest) (*pb.CreateUserResponse, error) { - log := zlog.Ctx(ctx) + port := hwutil.GetEnvOr("PORT", "8080") + addr := hwutil.GetEnvOr("ADDR", fmt.Sprintf(":%s", port)) - daprClient, err := daprc.NewClient() - if err != nil { - log.Error().Err(err).Msg("could not create daprClient") - return nil, status.Error(codes.Internal, "Internal: "+err.Error()) - } - - // new user's Password - credentials := []gocloak.CredentialRepresentation{{ - Temporary: gocloak.BoolP(false), - Type: gocloak.StringP("password"), - Value: gocloak.StringP(request.Password), - }} - - // new user - user := gocloak.User{ - // as per ADR-004 we use the convention kc.firstName = nickname and kc.lastName = fullName - FirstName: gocloak.StringP(request.Nickname), - LastName: gocloak.StringP(request.FullName), - Email: gocloak.StringP(request.Email), - Enabled: gocloak.BoolP(true), - Username: gocloak.StringP(request.Email), - Credentials: &credentials, - } - - // Client AuthN - token, err := getServiceAccountToken(ctx) - if err != nil { - log.Error().Err(err).Msg("could not refresh service token!") - return nil, status.Error(codes.Internal, err.Error()) - } - - kcCtx := context.Background() - - userId, err := gocloakClient.CreateUser(kcCtx, token.AccessToken, realm, user) - if err != nil { - log.Warn().Err(err).Msg("could not create new user") - return nil, status.Error(codes.InvalidArgument, err.Error()) - } else { - log.Info().Str("userId", userId).Msg("created new user") - } - - _ = common.PublishMessage(ctx, daprClient, "pubsub", "USER_CREATED", &events.UserCreatedEvent{ - Id: userId, - Email: *user.Email, - Nickname: *user.FirstName, - FullName: *user.LastName, + common.StartNewGRPCServer(addr, func(server *daprd.Server) { + grpcServer := server.GrpcServer() + pb.RegisterUserServiceServer(server.GrpcServer(), user.NewServiceServer()) + pb.RegisterOrganizationServiceServer(grpcServer, organization.NewServiceServer()) }) - - return &pb.CreateUserResponse{UserId: userId}, nil -} - -func (userServiceServer) CreateOrganization(ctx context.Context, request *pb.CreateOrganizationRequest) (*pb.CreateOrganizationResponse, error) { - // User AuthN - claims, err := common.GetAuthClaims(ctx) - if err != nil { - return nil, err - } - - userID := claims.Sub - - return createOrganization(ctx, request, userID, false) -} - -func (userServiceServer) UpdateUser(ctx context.Context, request *pb.UpdateUserRequest) (*pb.UpdateUserResponse, error) { - log := zlog.Ctx(ctx) - - // User AuthN - claims, err := common.GetAuthClaims(ctx) - if err != nil { - return nil, err - } - - // Client AuthN - token, err := getServiceAccountToken(ctx) - if err != nil { - log.Error().Err(err).Msg("could not refresh service token!") - return nil, status.Error(codes.Internal, err.Error()) - } - - userId := gocloak.StringP(hwutil.DerefStringOr(request.UserId, claims.Sub)) - if *userId != claims.Sub { - return nil, status.Error(codes.InvalidArgument, "you can only update your own account for now") - } - - // un-verify email, but never set it to true (in case it is already not verified) - var emailVerified *bool = nil - if request.Email != nil { - emailVerified = gocloak.BoolP(false) - } - - // new password - var credentials *[]gocloak.CredentialRepresentation = nil - if request.Password != nil { - credentials = &[]gocloak.CredentialRepresentation{{ - Temporary: gocloak.BoolP(false), - Type: gocloak.StringP("password"), - Value: request.Password, - }} - } - - kcUser := gocloak.User{ - // use requesting user's id as fallback - ID: userId, - EmailVerified: emailVerified, - // as per ADR-004 we use the convention kc.firstName = nickname and kc.lastName = fullName - FirstName: request.Nickname, - LastName: request.FullName, - Email: request.Email, - Username: request.Email, - Credentials: credentials, - } - - kcCtx := context.Background() - err = gocloakClient.UpdateUser(kcCtx, token.AccessToken, realm, kcUser) - - if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "Invalid: "+err.Error()) - } - - return &pb.UpdateUserResponse{}, nil -} - -type OrganizationAttributes struct { - LongName *string - ShortName *string - ContactEmail *string - IsPersonal *bool -} - -func (a *OrganizationAttributes) toMap() *map[string][]string { - m := make(map[string][]string) - m["type"] = []string{"organization"} - - if a.LongName != nil { - m["long_name"] = []string{*a.LongName} - } - if a.ShortName != nil { - m["short_name"] = []string{*a.ShortName} - } - if a.ContactEmail != nil { - m["contact_email"] = []string{*a.ContactEmail} - } - if a.IsPersonal != nil { - m["is_personal"] = []string{strconv.FormatBool(*a.IsPersonal)} - } - return &m -} - -//nolint:golint,unused -func (a *OrganizationAttributes) fromMap(m map[string][]string) { - if arr := m["long_name"]; len(arr) == 1 { - a.LongName = &arr[0] - } - if arr := m["short_name"]; len(arr) == 1 { - a.ShortName = &arr[0] - } - if arr := m["contact_email"]; len(arr) == 1 { - a.ContactEmail = &arr[0] - } - if arr := m["is_personal"]; len(arr) == 1 { - if b, err := strconv.ParseBool(arr[0]); err == nil { - a.IsPersonal = &b - } - } -} - -// createOrganization creates a new organization on behalf of a user -// it does so by creating a new keycloak group for the organization. -// The group also has a subgroup for admins, where the requesting user is added to -func createOrganization(logCtx context.Context, request *pb.CreateOrganizationRequest, userID string, isPersonal bool) (*pb.CreateOrganizationResponse, error) { - log := zlog.Ctx(logCtx) - - // Client AuthN - token, err := getServiceAccountToken(logCtx) - if err != nil { - log.Error().Err(err).Msg("could not refresh service token!") - return nil, status.Error(codes.Internal, err.Error()) - } - - // data about the organization - attributes := OrganizationAttributes{ - LongName: &request.LongName, - ContactEmail: &request.ContactEmail, - IsPersonal: &isPersonal, - } - - if request.ShortName != "" { - attributes.ShortName = &request.ShortName - } - - // group for the organization - group := gocloak.Group{ - Name: gocloak.StringP("org-" + request.LongName + "-" + hwutil.RandomString(5)), - Attributes: attributes.toMap(), - } - - kcCtx := context.Background() - - groupID, err := gocloakClient.CreateGroup(kcCtx, token.AccessToken, realm, group) - if err != nil { - log. - Warn(). - Err(err). - Str("group", logging.Formatted(group)). - Str("userID", userID). - Msg("could not create group") - return nil, status.Error(codes.Internal, err.Error()) - } else { - log.Info().Str("userID", userID).Str("groupID", groupID).Msg("created new organization") - } - - // admin subgroup - adminGroup := gocloak.Group{ - Name: gocloak.StringP("admins"), - } - - adminGroupID, err := gocloakClient.CreateChildGroup(kcCtx, token.AccessToken, realm, groupID, adminGroup) - errMsg := "could not create admin subgroup" - - if err == nil { - log.Info().Str("adminGroupID", adminGroupID).Str("groupID", groupID).Msg("created admin subgroup") - - err = gocloakClient.AddUserToGroup(kcCtx, token.AccessToken, realm, userID, adminGroupID) - errMsg = "could not add user to admins" - } - - if err == nil { - log.Debug().Str("adminGroupID", adminGroupID).Str("userID", userID).Msg("added user to admins") - } - - if err != nil { - log.Error(). - Err(err). - Str("groupID", groupID). - Str("userID", userID). - Msg(errMsg) - - if err := gocloakClient.DeleteGroup(kcCtx, token.AccessToken, realm, groupID); err != nil { - log.Error(). - Err(err). - Str("groupID", groupID). - Str("userID", userID). - Msg("could not recover and delete new group") - } else { - log.Info(). - Str("groupID", groupID). - Str("userID", userID). - Msg("removed new group again") - } - return nil, status.Error(codes.InvalidArgument, err.Error()) - } - - return &pb.CreateOrganizationResponse{ - Id: groupID, - LongName: *attributes.LongName, - ShortName: hwutil.DerefStringOrEmpty(attributes.ShortName), - ContactEmail: *attributes.ContactEmail, - IsPersonal: *attributes.IsPersonal, - }, nil -} - -var SubUserCreated = &daprcmn.Subscription{ - PubsubName: "pubsub", - Topic: "USER_CREATED", - Route: "/pubsub/user_created/v1", -} - -func OnUserCreated(ctx context.Context, e *daprcmn.TopicEvent) (retry bool, err error) { - log := zlog.Ctx(ctx) - - var user events.UserCreatedEvent - if err := proto.Unmarshal(e.RawData, &user); err != nil { - log.Error().Err(err).Msg("could not convert USER_CREATED event data to CreateUserEvent") - return false, err - } - - _, err = createOrganization(ctx, &pb.CreateOrganizationRequest{ - LongName: "Your Personal Organization", - ContactEmail: user.Email, - }, user.Id, true) - - if err != nil { - log.Error().Str("userID", user.Id).Err(err).Msg("could not create personal organization") - return true, err - } - - return false, nil } diff --git a/services/user-svc/migrations/000001_init.down.sql b/services/user-svc/migrations/000001_init.down.sql new file mode 100644 index 000000000..9cb85f2db --- /dev/null +++ b/services/user-svc/migrations/000001_init.down.sql @@ -0,0 +1,3 @@ +DROP TABLE IF EXISTS members; +DROP TABLE IF EXISTS organizations; +DROP EXTENSION IF EXISTS "uuid-ossp"; diff --git a/services/user-svc/migrations/000001_init.up.sql b/services/user-svc/migrations/000001_init.up.sql new file mode 100644 index 000000000..175089d3f --- /dev/null +++ b/services/user-svc/migrations/000001_init.up.sql @@ -0,0 +1,20 @@ +CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; + +CREATE TABLE IF NOT EXISTS organizations ( + id uuid PRIMARY KEY DEFAULT uuid_generate_v4(), + long_name text NOT NULL, + short_name text NOT NULL, + contact_email text NOT NULL, + avatar_url text, + is_personal bool DEFAULT false, + created_by_user_id uuid NOT NULL +); + +CREATE TABLE IF NOT EXISTS members ( + id uuid PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id uuid NOT NULL, + organization_id uuid NOT NULL, + FOREIGN KEY (organization_id) + REFERENCES organizations(id) + ON DELETE CASCADE +);