metalstack.cloud 0.15.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- buf/__init__.py +0 -0
- buf/validate/__init__.py +0 -0
- buf/validate/validate_pb2.py +450 -0
- buf/validate/validate_pb2.pyi +631 -0
- buf/validate/validate_pb2_grpc.py +4 -0
- metalstack_cloud-0.15.2.dist-info/METADATA +26 -0
- metalstack_cloud-0.15.2.dist-info/RECORD +111 -0
- metalstack_cloud-0.15.2.dist-info/WHEEL +5 -0
- metalstack_cloud-0.15.2.dist-info/top_level.txt +2 -0
- metalstackcloud/__init__.py +0 -0
- metalstackcloud/admin/__init__.py +0 -0
- metalstackcloud/admin/v1/__init__.py +0 -0
- metalstackcloud/admin/v1/cluster_connecpy.py +214 -0
- metalstackcloud/admin/v1/cluster_pb2.py +70 -0
- metalstackcloud/admin/v1/cluster_pb2.pyi +93 -0
- metalstackcloud/admin/v1/cluster_pb2_grpc.py +169 -0
- metalstackcloud/admin/v1/machine_pb2.py +42 -0
- metalstackcloud/admin/v1/machine_pb2.pyi +76 -0
- metalstackcloud/admin/v1/machine_pb2_grpc.py +4 -0
- metalstackcloud/admin/v1/payment_connecpy.py +158 -0
- metalstackcloud/admin/v1/payment_pb2.py +51 -0
- metalstackcloud/admin/v1/payment_pb2.pyi +33 -0
- metalstackcloud/admin/v1/payment_pb2_grpc.py +125 -0
- metalstackcloud/admin/v1/project_connecpy.py +102 -0
- metalstackcloud/admin/v1/project_pb2.py +49 -0
- metalstackcloud/admin/v1/project_pb2.pyi +34 -0
- metalstackcloud/admin/v1/project_pb2_grpc.py +81 -0
- metalstackcloud/admin/v1/storage_connecpy.py +214 -0
- metalstackcloud/admin/v1/storage_pb2.py +75 -0
- metalstackcloud/admin/v1/storage_pb2.pyi +149 -0
- metalstackcloud/admin/v1/storage_pb2_grpc.py +169 -0
- metalstackcloud/admin/v1/tenant_connecpy.py +270 -0
- metalstackcloud/admin/v1/tenant_pb2.py +66 -0
- metalstackcloud/admin/v1/tenant_pb2.pyi +72 -0
- metalstackcloud/admin/v1/tenant_pb2_grpc.py +213 -0
- metalstackcloud/admin/v1/token_connecpy.py +158 -0
- metalstackcloud/admin/v1/token_pb2.py +56 -0
- metalstackcloud/admin/v1/token_pb2.pyi +34 -0
- metalstackcloud/admin/v1/token_pb2_grpc.py +125 -0
- metalstackcloud/api/__init__.py +0 -0
- metalstackcloud/api/v1/__init__.py +0 -0
- metalstackcloud/api/v1/asset_connecpy.py +102 -0
- metalstackcloud/api/v1/asset_pb2.py +76 -0
- metalstackcloud/api/v1/asset_pb2.pyi +132 -0
- metalstackcloud/api/v1/asset_pb2_grpc.py +81 -0
- metalstackcloud/api/v1/audit_connecpy.py +158 -0
- metalstackcloud/api/v1/audit_pb2.py +84 -0
- metalstackcloud/api/v1/audit_pb2.pyi +95 -0
- metalstackcloud/api/v1/audit_pb2_grpc.py +125 -0
- metalstackcloud/api/v1/cluster_connecpy.py +494 -0
- metalstackcloud/api/v1/cluster_pb2.py +183 -0
- metalstackcloud/api/v1/cluster_pb2.pyi +311 -0
- metalstackcloud/api/v1/cluster_pb2_grpc.py +389 -0
- metalstackcloud/api/v1/common_pb2.py +52 -0
- metalstackcloud/api/v1/common_pb2.pyi +98 -0
- metalstackcloud/api/v1/common_pb2_grpc.py +4 -0
- metalstackcloud/api/v1/health_connecpy.py +102 -0
- metalstackcloud/api/v1/health_pb2.py +58 -0
- metalstackcloud/api/v1/health_pb2.pyi +74 -0
- metalstackcloud/api/v1/health_pb2_grpc.py +81 -0
- metalstackcloud/api/v1/ip_connecpy.py +326 -0
- metalstackcloud/api/v1/ip_pb2.py +110 -0
- metalstackcloud/api/v1/ip_pb2.pyi +122 -0
- metalstackcloud/api/v1/ip_pb2_grpc.py +257 -0
- metalstackcloud/api/v1/method_connecpy.py +158 -0
- metalstackcloud/api/v1/method_pb2.py +62 -0
- metalstackcloud/api/v1/method_pb2.pyi +50 -0
- metalstackcloud/api/v1/method_pb2_grpc.py +128 -0
- metalstackcloud/api/v1/payment_connecpy.py +550 -0
- metalstackcloud/api/v1/payment_pb2.py +134 -0
- metalstackcloud/api/v1/payment_pb2.pyi +291 -0
- metalstackcloud/api/v1/payment_pb2_grpc.py +433 -0
- metalstackcloud/api/v1/project_connecpy.py +718 -0
- metalstackcloud/api/v1/project_pb2.py +156 -0
- metalstackcloud/api/v1/project_pb2.pyi +234 -0
- metalstackcloud/api/v1/project_pb2_grpc.py +565 -0
- metalstackcloud/api/v1/snapshot_connecpy.py +214 -0
- metalstackcloud/api/v1/snapshot_pb2.py +75 -0
- metalstackcloud/api/v1/snapshot_pb2.pyi +109 -0
- metalstackcloud/api/v1/snapshot_pb2_grpc.py +169 -0
- metalstackcloud/api/v1/tenant_connecpy.py +774 -0
- metalstackcloud/api/v1/tenant_pb2.py +159 -0
- metalstackcloud/api/v1/tenant_pb2.pyi +305 -0
- metalstackcloud/api/v1/tenant_pb2_grpc.py +609 -0
- metalstackcloud/api/v1/token_connecpy.py +326 -0
- metalstackcloud/api/v1/token_pb2.py +131 -0
- metalstackcloud/api/v1/token_pb2.pyi +175 -0
- metalstackcloud/api/v1/token_pb2_grpc.py +257 -0
- metalstackcloud/api/v1/user_connecpy.py +102 -0
- metalstackcloud/api/v1/user_pb2.py +48 -0
- metalstackcloud/api/v1/user_pb2.pyi +42 -0
- metalstackcloud/api/v1/user_pb2_grpc.py +81 -0
- metalstackcloud/api/v1/version_connecpy.py +102 -0
- metalstackcloud/api/v1/version_pb2.py +46 -0
- metalstackcloud/api/v1/version_pb2.pyi +29 -0
- metalstackcloud/api/v1/version_pb2_grpc.py +81 -0
- metalstackcloud/api/v1/volume_connecpy.py +270 -0
- metalstackcloud/api/v1/volume_pb2.py +91 -0
- metalstackcloud/api/v1/volume_pb2.pyi +165 -0
- metalstackcloud/api/v1/volume_pb2_grpc.py +213 -0
- metalstackcloud/client.py +139 -0
- metalstackcloud/status/__init__.py +0 -0
- metalstackcloud/status/v1/__init__.py +0 -0
- metalstackcloud/status/v1/message_connecpy.py +102 -0
- metalstackcloud/status/v1/message_pb2.py +51 -0
- metalstackcloud/status/v1/message_pb2.pyi +65 -0
- metalstackcloud/status/v1/message_pb2_grpc.py +84 -0
- metalstackcloud/status/v1/status_connecpy.py +102 -0
- metalstackcloud/status/v1/status_pb2.py +45 -0
- metalstackcloud/status/v1/status_pb2.pyi +24 -0
- metalstackcloud/status/v1/status_pb2_grpc.py +84 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
|
|
5
|
+
from metalstackcloud.admin.v1 import cluster_pb2 as admin_dot_v1_dot_cluster__pb2
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ClusterServiceStub(object):
|
|
9
|
+
"""ClusterService serves cluster related functions
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
def __init__(self, channel):
|
|
13
|
+
"""Constructor.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
channel: A grpc.Channel.
|
|
17
|
+
"""
|
|
18
|
+
self.Get = channel.unary_unary(
|
|
19
|
+
'/admin.v1.ClusterService/Get',
|
|
20
|
+
request_serializer=admin_dot_v1_dot_cluster__pb2.ClusterServiceGetRequest.SerializeToString,
|
|
21
|
+
response_deserializer=admin_dot_v1_dot_cluster__pb2.ClusterServiceGetResponse.FromString,
|
|
22
|
+
_registered_method=True)
|
|
23
|
+
self.List = channel.unary_unary(
|
|
24
|
+
'/admin.v1.ClusterService/List',
|
|
25
|
+
request_serializer=admin_dot_v1_dot_cluster__pb2.ClusterServiceListRequest.SerializeToString,
|
|
26
|
+
response_deserializer=admin_dot_v1_dot_cluster__pb2.ClusterServiceListResponse.FromString,
|
|
27
|
+
_registered_method=True)
|
|
28
|
+
self.Credentials = channel.unary_unary(
|
|
29
|
+
'/admin.v1.ClusterService/Credentials',
|
|
30
|
+
request_serializer=admin_dot_v1_dot_cluster__pb2.ClusterServiceCredentialsRequest.SerializeToString,
|
|
31
|
+
response_deserializer=admin_dot_v1_dot_cluster__pb2.ClusterServiceCredentialsResponse.FromString,
|
|
32
|
+
_registered_method=True)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class ClusterServiceServicer(object):
|
|
36
|
+
"""ClusterService serves cluster related functions
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
def Get(self, request, context):
|
|
40
|
+
"""Get a cluster
|
|
41
|
+
"""
|
|
42
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
43
|
+
context.set_details('Method not implemented!')
|
|
44
|
+
raise NotImplementedError('Method not implemented!')
|
|
45
|
+
|
|
46
|
+
def List(self, request, context):
|
|
47
|
+
"""List clusters
|
|
48
|
+
"""
|
|
49
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
50
|
+
context.set_details('Method not implemented!')
|
|
51
|
+
raise NotImplementedError('Method not implemented!')
|
|
52
|
+
|
|
53
|
+
def Credentials(self, request, context):
|
|
54
|
+
"""Credentials of a cluster
|
|
55
|
+
"""
|
|
56
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
57
|
+
context.set_details('Method not implemented!')
|
|
58
|
+
raise NotImplementedError('Method not implemented!')
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def add_ClusterServiceServicer_to_server(servicer, server):
|
|
62
|
+
rpc_method_handlers = {
|
|
63
|
+
'Get': grpc.unary_unary_rpc_method_handler(
|
|
64
|
+
servicer.Get,
|
|
65
|
+
request_deserializer=admin_dot_v1_dot_cluster__pb2.ClusterServiceGetRequest.FromString,
|
|
66
|
+
response_serializer=admin_dot_v1_dot_cluster__pb2.ClusterServiceGetResponse.SerializeToString,
|
|
67
|
+
),
|
|
68
|
+
'List': grpc.unary_unary_rpc_method_handler(
|
|
69
|
+
servicer.List,
|
|
70
|
+
request_deserializer=admin_dot_v1_dot_cluster__pb2.ClusterServiceListRequest.FromString,
|
|
71
|
+
response_serializer=admin_dot_v1_dot_cluster__pb2.ClusterServiceListResponse.SerializeToString,
|
|
72
|
+
),
|
|
73
|
+
'Credentials': grpc.unary_unary_rpc_method_handler(
|
|
74
|
+
servicer.Credentials,
|
|
75
|
+
request_deserializer=admin_dot_v1_dot_cluster__pb2.ClusterServiceCredentialsRequest.FromString,
|
|
76
|
+
response_serializer=admin_dot_v1_dot_cluster__pb2.ClusterServiceCredentialsResponse.SerializeToString,
|
|
77
|
+
),
|
|
78
|
+
}
|
|
79
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
80
|
+
'admin.v1.ClusterService', rpc_method_handlers)
|
|
81
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
82
|
+
server.add_registered_method_handlers('admin.v1.ClusterService', rpc_method_handlers)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
# This class is part of an EXPERIMENTAL API.
|
|
86
|
+
class ClusterService(object):
|
|
87
|
+
"""ClusterService serves cluster related functions
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
@staticmethod
|
|
91
|
+
def Get(request,
|
|
92
|
+
target,
|
|
93
|
+
options=(),
|
|
94
|
+
channel_credentials=None,
|
|
95
|
+
call_credentials=None,
|
|
96
|
+
insecure=False,
|
|
97
|
+
compression=None,
|
|
98
|
+
wait_for_ready=None,
|
|
99
|
+
timeout=None,
|
|
100
|
+
metadata=None):
|
|
101
|
+
return grpc.experimental.unary_unary(
|
|
102
|
+
request,
|
|
103
|
+
target,
|
|
104
|
+
'/admin.v1.ClusterService/Get',
|
|
105
|
+
admin_dot_v1_dot_cluster__pb2.ClusterServiceGetRequest.SerializeToString,
|
|
106
|
+
admin_dot_v1_dot_cluster__pb2.ClusterServiceGetResponse.FromString,
|
|
107
|
+
options,
|
|
108
|
+
channel_credentials,
|
|
109
|
+
insecure,
|
|
110
|
+
call_credentials,
|
|
111
|
+
compression,
|
|
112
|
+
wait_for_ready,
|
|
113
|
+
timeout,
|
|
114
|
+
metadata,
|
|
115
|
+
_registered_method=True)
|
|
116
|
+
|
|
117
|
+
@staticmethod
|
|
118
|
+
def List(request,
|
|
119
|
+
target,
|
|
120
|
+
options=(),
|
|
121
|
+
channel_credentials=None,
|
|
122
|
+
call_credentials=None,
|
|
123
|
+
insecure=False,
|
|
124
|
+
compression=None,
|
|
125
|
+
wait_for_ready=None,
|
|
126
|
+
timeout=None,
|
|
127
|
+
metadata=None):
|
|
128
|
+
return grpc.experimental.unary_unary(
|
|
129
|
+
request,
|
|
130
|
+
target,
|
|
131
|
+
'/admin.v1.ClusterService/List',
|
|
132
|
+
admin_dot_v1_dot_cluster__pb2.ClusterServiceListRequest.SerializeToString,
|
|
133
|
+
admin_dot_v1_dot_cluster__pb2.ClusterServiceListResponse.FromString,
|
|
134
|
+
options,
|
|
135
|
+
channel_credentials,
|
|
136
|
+
insecure,
|
|
137
|
+
call_credentials,
|
|
138
|
+
compression,
|
|
139
|
+
wait_for_ready,
|
|
140
|
+
timeout,
|
|
141
|
+
metadata,
|
|
142
|
+
_registered_method=True)
|
|
143
|
+
|
|
144
|
+
@staticmethod
|
|
145
|
+
def Credentials(request,
|
|
146
|
+
target,
|
|
147
|
+
options=(),
|
|
148
|
+
channel_credentials=None,
|
|
149
|
+
call_credentials=None,
|
|
150
|
+
insecure=False,
|
|
151
|
+
compression=None,
|
|
152
|
+
wait_for_ready=None,
|
|
153
|
+
timeout=None,
|
|
154
|
+
metadata=None):
|
|
155
|
+
return grpc.experimental.unary_unary(
|
|
156
|
+
request,
|
|
157
|
+
target,
|
|
158
|
+
'/admin.v1.ClusterService/Credentials',
|
|
159
|
+
admin_dot_v1_dot_cluster__pb2.ClusterServiceCredentialsRequest.SerializeToString,
|
|
160
|
+
admin_dot_v1_dot_cluster__pb2.ClusterServiceCredentialsResponse.FromString,
|
|
161
|
+
options,
|
|
162
|
+
channel_credentials,
|
|
163
|
+
insecure,
|
|
164
|
+
call_credentials,
|
|
165
|
+
compression,
|
|
166
|
+
wait_for_ready,
|
|
167
|
+
timeout,
|
|
168
|
+
metadata,
|
|
169
|
+
_registered_method=True)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: admin/v1/machine.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'admin/v1/machine.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16\x61\x64min/v1/machine.proto\x12\x08\x61\x64min.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\x96\x04\n\x07Machine\x12\x12\n\x04uuid\x18\x01 \x01(\tR\x04uuid\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\x12 \n\x0b\x64\x65scription\x18\x03 \x01(\tR\x0b\x64\x65scription\x12\x18\n\x07project\x18\x04 \x01(\tR\x07project\x12\x14\n\x05image\x18\x05 \x01(\tR\x05image\x12\x12\n\x04size\x18\x06 \x01(\tR\x04size\x12\x43\n\x10machine_networks\x18\x07 \x03(\x0b\x32\x18.admin.v1.MachineNetworkR\x0fmachineNetworks\x12\x1a\n\x08hostname\x18\x08 \x01(\tR\x08hostname\x12\x1b\n\tuser_data\x18\t \x01(\tR\x08userData\x12\x12\n\x04role\x18\n \x01(\tR\x04role\x12\x18\n\x07\x63reator\x18\x0b \x01(\tR\x07\x63reator\x12\x34\n\x07\x63reated\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x07\x63reated\x12\x1c\n\tpartition\x18\r \x01(\tR\tpartition\x12\x12\n\x04rack\x18\x0e \x01(\tR\x04rack\x12\x14\n\x05state\x18\x0f \x01(\tR\x05state\x12\x1e\n\nliveliness\x18\x10 \x01(\tR\nliveliness\x12\x12\n\x04tags\x18\x11 \x03(\tR\x04tags\x12\x1f\n\x03vpn\x18\x12 \x01(\x0b\x32\r.admin.v1.VPNR\x03vpn\"\xd2\x01\n\x0eMachineNetwork\x12\x18\n\x07network\x18\x01 \x01(\tR\x07network\x12\x1a\n\x08prefixes\x18\x02 \x03(\tR\x08prefixes\x12\x10\n\x03ips\x18\x03 \x03(\tR\x03ips\x12\x31\n\x14\x64\x65stination_prefixes\x18\x04 \x03(\tR\x13\x64\x65stinationPrefixes\x12!\n\x0cnetwork_type\x18\x05 \x01(\tR\x0bnetworkType\x12\x10\n\x03vrf\x18\x06 \x01(\rR\x03vrf\x12\x10\n\x03\x61sn\x18\x07 \x01(\x03R\x03\x61sn\"9\n\x03VPN\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\x12\x18\n\x07\x61uthkey\x18\x02 \x01(\tR\x07\x61uthkeyB\x93\x01\n\x0c\x63om.admin.v1B\x0cMachineProtoP\x01Z4github.com/metal-stack-cloud/api/go/admin/v1;adminv1\xa2\x02\x03\x41XX\xaa\x02\x08\x41\x64min.V1\xca\x02\x08\x41\x64min\\V1\xe2\x02\x14\x41\x64min\\V1\\GPBMetadata\xea\x02\tAdmin::V1b\x06proto3')
|
|
29
|
+
|
|
30
|
+
_globals = globals()
|
|
31
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
32
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'admin.v1.machine_pb2', _globals)
|
|
33
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
34
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
35
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n\014com.admin.v1B\014MachineProtoP\001Z4github.com/metal-stack-cloud/api/go/admin/v1;adminv1\242\002\003AXX\252\002\010Admin.V1\312\002\010Admin\\V1\342\002\024Admin\\V1\\GPBMetadata\352\002\tAdmin::V1'
|
|
36
|
+
_globals['_MACHINE']._serialized_start=70
|
|
37
|
+
_globals['_MACHINE']._serialized_end=604
|
|
38
|
+
_globals['_MACHINENETWORK']._serialized_start=607
|
|
39
|
+
_globals['_MACHINENETWORK']._serialized_end=817
|
|
40
|
+
_globals['_VPN']._serialized_start=819
|
|
41
|
+
_globals['_VPN']._serialized_end=876
|
|
42
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
|
|
3
|
+
from google.protobuf import timestamp_pb2 as _timestamp_pb2
|
|
4
|
+
from google.protobuf.internal import containers as _containers
|
|
5
|
+
from google.protobuf import descriptor as _descriptor
|
|
6
|
+
from google.protobuf import message as _message
|
|
7
|
+
from collections.abc import Iterable as _Iterable, Mapping as _Mapping
|
|
8
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
9
|
+
|
|
10
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
11
|
+
|
|
12
|
+
class Machine(_message.Message):
|
|
13
|
+
__slots__ = ("uuid", "name", "description", "project", "image", "size", "machine_networks", "hostname", "user_data", "role", "creator", "created", "partition", "rack", "state", "liveliness", "tags", "vpn")
|
|
14
|
+
UUID_FIELD_NUMBER: _ClassVar[int]
|
|
15
|
+
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
16
|
+
DESCRIPTION_FIELD_NUMBER: _ClassVar[int]
|
|
17
|
+
PROJECT_FIELD_NUMBER: _ClassVar[int]
|
|
18
|
+
IMAGE_FIELD_NUMBER: _ClassVar[int]
|
|
19
|
+
SIZE_FIELD_NUMBER: _ClassVar[int]
|
|
20
|
+
MACHINE_NETWORKS_FIELD_NUMBER: _ClassVar[int]
|
|
21
|
+
HOSTNAME_FIELD_NUMBER: _ClassVar[int]
|
|
22
|
+
USER_DATA_FIELD_NUMBER: _ClassVar[int]
|
|
23
|
+
ROLE_FIELD_NUMBER: _ClassVar[int]
|
|
24
|
+
CREATOR_FIELD_NUMBER: _ClassVar[int]
|
|
25
|
+
CREATED_FIELD_NUMBER: _ClassVar[int]
|
|
26
|
+
PARTITION_FIELD_NUMBER: _ClassVar[int]
|
|
27
|
+
RACK_FIELD_NUMBER: _ClassVar[int]
|
|
28
|
+
STATE_FIELD_NUMBER: _ClassVar[int]
|
|
29
|
+
LIVELINESS_FIELD_NUMBER: _ClassVar[int]
|
|
30
|
+
TAGS_FIELD_NUMBER: _ClassVar[int]
|
|
31
|
+
VPN_FIELD_NUMBER: _ClassVar[int]
|
|
32
|
+
uuid: str
|
|
33
|
+
name: str
|
|
34
|
+
description: str
|
|
35
|
+
project: str
|
|
36
|
+
image: str
|
|
37
|
+
size: str
|
|
38
|
+
machine_networks: _containers.RepeatedCompositeFieldContainer[MachineNetwork]
|
|
39
|
+
hostname: str
|
|
40
|
+
user_data: str
|
|
41
|
+
role: str
|
|
42
|
+
creator: str
|
|
43
|
+
created: _timestamp_pb2.Timestamp
|
|
44
|
+
partition: str
|
|
45
|
+
rack: str
|
|
46
|
+
state: str
|
|
47
|
+
liveliness: str
|
|
48
|
+
tags: _containers.RepeatedScalarFieldContainer[str]
|
|
49
|
+
vpn: VPN
|
|
50
|
+
def __init__(self, uuid: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., project: _Optional[str] = ..., image: _Optional[str] = ..., size: _Optional[str] = ..., machine_networks: _Optional[_Iterable[_Union[MachineNetwork, _Mapping]]] = ..., hostname: _Optional[str] = ..., user_data: _Optional[str] = ..., role: _Optional[str] = ..., creator: _Optional[str] = ..., created: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., partition: _Optional[str] = ..., rack: _Optional[str] = ..., state: _Optional[str] = ..., liveliness: _Optional[str] = ..., tags: _Optional[_Iterable[str]] = ..., vpn: _Optional[_Union[VPN, _Mapping]] = ...) -> None: ...
|
|
51
|
+
|
|
52
|
+
class MachineNetwork(_message.Message):
|
|
53
|
+
__slots__ = ("network", "prefixes", "ips", "destination_prefixes", "network_type", "vrf", "asn")
|
|
54
|
+
NETWORK_FIELD_NUMBER: _ClassVar[int]
|
|
55
|
+
PREFIXES_FIELD_NUMBER: _ClassVar[int]
|
|
56
|
+
IPS_FIELD_NUMBER: _ClassVar[int]
|
|
57
|
+
DESTINATION_PREFIXES_FIELD_NUMBER: _ClassVar[int]
|
|
58
|
+
NETWORK_TYPE_FIELD_NUMBER: _ClassVar[int]
|
|
59
|
+
VRF_FIELD_NUMBER: _ClassVar[int]
|
|
60
|
+
ASN_FIELD_NUMBER: _ClassVar[int]
|
|
61
|
+
network: str
|
|
62
|
+
prefixes: _containers.RepeatedScalarFieldContainer[str]
|
|
63
|
+
ips: _containers.RepeatedScalarFieldContainer[str]
|
|
64
|
+
destination_prefixes: _containers.RepeatedScalarFieldContainer[str]
|
|
65
|
+
network_type: str
|
|
66
|
+
vrf: int
|
|
67
|
+
asn: int
|
|
68
|
+
def __init__(self, network: _Optional[str] = ..., prefixes: _Optional[_Iterable[str]] = ..., ips: _Optional[_Iterable[str]] = ..., destination_prefixes: _Optional[_Iterable[str]] = ..., network_type: _Optional[str] = ..., vrf: _Optional[int] = ..., asn: _Optional[int] = ...) -> None: ...
|
|
69
|
+
|
|
70
|
+
class VPN(_message.Message):
|
|
71
|
+
__slots__ = ("address", "authkey")
|
|
72
|
+
ADDRESS_FIELD_NUMBER: _ClassVar[int]
|
|
73
|
+
AUTHKEY_FIELD_NUMBER: _ClassVar[int]
|
|
74
|
+
address: str
|
|
75
|
+
authkey: str
|
|
76
|
+
def __init__(self, address: _Optional[str] = ..., authkey: _Optional[str] = ...) -> None: ...
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by https://github.com/i2y/connecpy/protoc-gen-connecpy. DO NOT EDIT!
|
|
3
|
+
# source: admin/v1/payment.proto
|
|
4
|
+
|
|
5
|
+
from typing import Optional, Protocol, Union
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from connecpy.async_client import AsyncConnecpyClient
|
|
10
|
+
from connecpy.base import Endpoint
|
|
11
|
+
from connecpy.server import ConnecpyServer
|
|
12
|
+
from connecpy.client import ConnecpyClient
|
|
13
|
+
from connecpy.context import ClientContext, ServiceContext
|
|
14
|
+
import metalstackcloud.admin.v1.payment_pb2 as admin_dot_v1_dot_payment__pb2
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class PaymentService(Protocol):
|
|
18
|
+
async def ListCoupons(self, req: admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsRequest, ctx: ServiceContext) -> admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsResponse: ...
|
|
19
|
+
async def AddBalanceToCustomer(self, req: admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerRequest, ctx: ServiceContext) -> admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerResponse: ...
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class PaymentServiceServer(ConnecpyServer):
|
|
23
|
+
def __init__(self, *, service: PaymentService, server_path_prefix=""):
|
|
24
|
+
super().__init__()
|
|
25
|
+
self._prefix = f"{server_path_prefix}/admin.v1.PaymentService"
|
|
26
|
+
self._endpoints = {
|
|
27
|
+
"ListCoupons": Endpoint[admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsRequest, admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsResponse](
|
|
28
|
+
service_name="PaymentService",
|
|
29
|
+
name="ListCoupons",
|
|
30
|
+
function=getattr(service, "ListCoupons"),
|
|
31
|
+
input=admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsRequest,
|
|
32
|
+
output=admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsResponse,
|
|
33
|
+
allowed_methods=("POST",),
|
|
34
|
+
),
|
|
35
|
+
"AddBalanceToCustomer": Endpoint[admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerRequest, admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerResponse](
|
|
36
|
+
service_name="PaymentService",
|
|
37
|
+
name="AddBalanceToCustomer",
|
|
38
|
+
function=getattr(service, "AddBalanceToCustomer"),
|
|
39
|
+
input=admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerRequest,
|
|
40
|
+
output=admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerResponse,
|
|
41
|
+
allowed_methods=("POST",),
|
|
42
|
+
),
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
def serviceName(self):
|
|
46
|
+
return "admin.v1.PaymentService"
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class PaymentServiceSync(Protocol):
|
|
50
|
+
def ListCoupons(self, req: admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsRequest, ctx: ServiceContext) -> admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsResponse: ...
|
|
51
|
+
def AddBalanceToCustomer(self, req: admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerRequest, ctx: ServiceContext) -> admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerResponse: ...
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class PaymentServiceServerSync(ConnecpyServer):
|
|
55
|
+
def __init__(self, *, service: PaymentServiceSync, server_path_prefix=""):
|
|
56
|
+
super().__init__()
|
|
57
|
+
self._prefix = f"{server_path_prefix}/admin.v1.PaymentService"
|
|
58
|
+
self._endpoints = {
|
|
59
|
+
"ListCoupons": Endpoint[admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsRequest, admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsResponse](
|
|
60
|
+
service_name="PaymentService",
|
|
61
|
+
name="ListCoupons",
|
|
62
|
+
function=getattr(service, "ListCoupons"),
|
|
63
|
+
input=admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsRequest,
|
|
64
|
+
output=admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsResponse,
|
|
65
|
+
allowed_methods=("POST",),
|
|
66
|
+
),
|
|
67
|
+
"AddBalanceToCustomer": Endpoint[admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerRequest, admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerResponse](
|
|
68
|
+
service_name="PaymentService",
|
|
69
|
+
name="AddBalanceToCustomer",
|
|
70
|
+
function=getattr(service, "AddBalanceToCustomer"),
|
|
71
|
+
input=admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerRequest,
|
|
72
|
+
output=admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerResponse,
|
|
73
|
+
allowed_methods=("POST",),
|
|
74
|
+
),
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
def serviceName(self):
|
|
78
|
+
return "admin.v1.PaymentService"
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class PaymentServiceClient(ConnecpyClient):
|
|
82
|
+
def ListCoupons(
|
|
83
|
+
self,
|
|
84
|
+
request: admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsRequest,
|
|
85
|
+
*,
|
|
86
|
+
ctx: Optional[ClientContext] = None,
|
|
87
|
+
server_path_prefix: str = "",
|
|
88
|
+
**kwargs,
|
|
89
|
+
) -> admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsResponse:
|
|
90
|
+
method = "POST"
|
|
91
|
+
return self._make_request(
|
|
92
|
+
url=f"{server_path_prefix}/admin.v1.PaymentService/ListCoupons",
|
|
93
|
+
ctx=ctx,
|
|
94
|
+
request=request,
|
|
95
|
+
response_class=admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsResponse,
|
|
96
|
+
method=method,
|
|
97
|
+
**kwargs,
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
def AddBalanceToCustomer(
|
|
101
|
+
self,
|
|
102
|
+
request: admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerRequest,
|
|
103
|
+
*,
|
|
104
|
+
ctx: Optional[ClientContext] = None,
|
|
105
|
+
server_path_prefix: str = "",
|
|
106
|
+
**kwargs,
|
|
107
|
+
) -> admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerResponse:
|
|
108
|
+
method = "POST"
|
|
109
|
+
return self._make_request(
|
|
110
|
+
url=f"{server_path_prefix}/admin.v1.PaymentService/AddBalanceToCustomer",
|
|
111
|
+
ctx=ctx,
|
|
112
|
+
request=request,
|
|
113
|
+
response_class=admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerResponse,
|
|
114
|
+
method=method,
|
|
115
|
+
**kwargs,
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
class AsyncPaymentServiceClient(AsyncConnecpyClient):
|
|
120
|
+
async def ListCoupons(
|
|
121
|
+
self,
|
|
122
|
+
request: admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsRequest,
|
|
123
|
+
*,
|
|
124
|
+
ctx: Optional[ClientContext] = None,
|
|
125
|
+
server_path_prefix: str = "",
|
|
126
|
+
session: Union[httpx.AsyncClient, None] = None,
|
|
127
|
+
**kwargs,
|
|
128
|
+
) -> admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsResponse:
|
|
129
|
+
method = "POST"
|
|
130
|
+
return await self._make_request(
|
|
131
|
+
url=f"{server_path_prefix}/admin.v1.PaymentService/ListCoupons",
|
|
132
|
+
ctx=ctx,
|
|
133
|
+
request=request,
|
|
134
|
+
response_class=admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsResponse,
|
|
135
|
+
method=method,
|
|
136
|
+
session=session,
|
|
137
|
+
**kwargs,
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
async def AddBalanceToCustomer(
|
|
141
|
+
self,
|
|
142
|
+
request: admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerRequest,
|
|
143
|
+
*,
|
|
144
|
+
ctx: Optional[ClientContext] = None,
|
|
145
|
+
server_path_prefix: str = "",
|
|
146
|
+
session: Union[httpx.AsyncClient, None] = None,
|
|
147
|
+
**kwargs,
|
|
148
|
+
) -> admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerResponse:
|
|
149
|
+
method = "POST"
|
|
150
|
+
return await self._make_request(
|
|
151
|
+
url=f"{server_path_prefix}/admin.v1.PaymentService/AddBalanceToCustomer",
|
|
152
|
+
ctx=ctx,
|
|
153
|
+
request=request,
|
|
154
|
+
response_class=admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerResponse,
|
|
155
|
+
method=method,
|
|
156
|
+
session=session,
|
|
157
|
+
**kwargs,
|
|
158
|
+
)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: admin/v1/payment.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'admin/v1/payment.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from metalstackcloud.api.v1 import common_pb2 as api_dot_v1_dot_common__pb2
|
|
26
|
+
from metalstackcloud.api.v1 import payment_pb2 as api_dot_v1_dot_payment__pb2
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16\x61\x64min/v1/payment.proto\x12\x08\x61\x64min.v1\x1a\x13\x61pi/v1/common.proto\x1a\x14\x61pi/v1/payment.proto\"\"\n PaymentServiceListCouponsRequest\"M\n!PaymentServiceListCouponsResponse\x12(\n\x07\x63oupons\x18\x01 \x03(\x0b\x32\x0e.api.v1.CouponR\x07\x63oupons\"n\n)PaymentServiceAddBalanceToCustomerRequest\x12\x1b\n\ttenant_id\x18\x01 \x01(\tR\x08tenantId\x12$\n\x0e\x62\x61lance_to_add\x18\x02 \x01(\x04R\x0c\x62\x61lanceToAdd\"a\n*PaymentServiceAddBalanceToCustomerResponse\x12\x33\n\x08\x63ustomer\x18\x01 \x01(\x0b\x32\x17.api.v1.PaymentCustomerR\x08\x63ustomer2\x8b\x02\n\x0ePaymentService\x12n\n\x0bListCoupons\x12*.admin.v1.PaymentServiceListCouponsRequest\x1a+.admin.v1.PaymentServiceListCouponsResponse\"\x06\xd2\xf3\x18\x02\x01\x02\x12\x88\x01\n\x14\x41\x64\x64\x42\x61lanceToCustomer\x12\x33.admin.v1.PaymentServiceAddBalanceToCustomerRequest\x1a\x34.admin.v1.PaymentServiceAddBalanceToCustomerResponse\"\x05\xd2\xf3\x18\x01\x01\x42\x93\x01\n\x0c\x63om.admin.v1B\x0cPaymentProtoP\x01Z4github.com/metal-stack-cloud/api/go/admin/v1;adminv1\xa2\x02\x03\x41XX\xaa\x02\x08\x41\x64min.V1\xca\x02\x08\x41\x64min\\V1\xe2\x02\x14\x41\x64min\\V1\\GPBMetadata\xea\x02\tAdmin::V1b\x06proto3')
|
|
30
|
+
|
|
31
|
+
_globals = globals()
|
|
32
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
33
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'admin.v1.payment_pb2', _globals)
|
|
34
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
35
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
36
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n\014com.admin.v1B\014PaymentProtoP\001Z4github.com/metal-stack-cloud/api/go/admin/v1;adminv1\242\002\003AXX\252\002\010Admin.V1\312\002\010Admin\\V1\342\002\024Admin\\V1\\GPBMetadata\352\002\tAdmin::V1'
|
|
37
|
+
_globals['_PAYMENTSERVICE'].methods_by_name['ListCoupons']._loaded_options = None
|
|
38
|
+
_globals['_PAYMENTSERVICE'].methods_by_name['ListCoupons']._serialized_options = b'\322\363\030\002\001\002'
|
|
39
|
+
_globals['_PAYMENTSERVICE'].methods_by_name['AddBalanceToCustomer']._loaded_options = None
|
|
40
|
+
_globals['_PAYMENTSERVICE'].methods_by_name['AddBalanceToCustomer']._serialized_options = b'\322\363\030\001\001'
|
|
41
|
+
_globals['_PAYMENTSERVICELISTCOUPONSREQUEST']._serialized_start=79
|
|
42
|
+
_globals['_PAYMENTSERVICELISTCOUPONSREQUEST']._serialized_end=113
|
|
43
|
+
_globals['_PAYMENTSERVICELISTCOUPONSRESPONSE']._serialized_start=115
|
|
44
|
+
_globals['_PAYMENTSERVICELISTCOUPONSRESPONSE']._serialized_end=192
|
|
45
|
+
_globals['_PAYMENTSERVICEADDBALANCETOCUSTOMERREQUEST']._serialized_start=194
|
|
46
|
+
_globals['_PAYMENTSERVICEADDBALANCETOCUSTOMERREQUEST']._serialized_end=304
|
|
47
|
+
_globals['_PAYMENTSERVICEADDBALANCETOCUSTOMERRESPONSE']._serialized_start=306
|
|
48
|
+
_globals['_PAYMENTSERVICEADDBALANCETOCUSTOMERRESPONSE']._serialized_end=403
|
|
49
|
+
_globals['_PAYMENTSERVICE']._serialized_start=406
|
|
50
|
+
_globals['_PAYMENTSERVICE']._serialized_end=673
|
|
51
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from api.v1 import common_pb2 as _common_pb2
|
|
2
|
+
from api.v1 import payment_pb2 as _payment_pb2
|
|
3
|
+
from google.protobuf.internal import containers as _containers
|
|
4
|
+
from google.protobuf import descriptor as _descriptor
|
|
5
|
+
from google.protobuf import message as _message
|
|
6
|
+
from collections.abc import Iterable as _Iterable, Mapping as _Mapping
|
|
7
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
8
|
+
|
|
9
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
10
|
+
|
|
11
|
+
class PaymentServiceListCouponsRequest(_message.Message):
|
|
12
|
+
__slots__ = ()
|
|
13
|
+
def __init__(self) -> None: ...
|
|
14
|
+
|
|
15
|
+
class PaymentServiceListCouponsResponse(_message.Message):
|
|
16
|
+
__slots__ = ("coupons",)
|
|
17
|
+
COUPONS_FIELD_NUMBER: _ClassVar[int]
|
|
18
|
+
coupons: _containers.RepeatedCompositeFieldContainer[_payment_pb2.Coupon]
|
|
19
|
+
def __init__(self, coupons: _Optional[_Iterable[_Union[_payment_pb2.Coupon, _Mapping]]] = ...) -> None: ...
|
|
20
|
+
|
|
21
|
+
class PaymentServiceAddBalanceToCustomerRequest(_message.Message):
|
|
22
|
+
__slots__ = ("tenant_id", "balance_to_add")
|
|
23
|
+
TENANT_ID_FIELD_NUMBER: _ClassVar[int]
|
|
24
|
+
BALANCE_TO_ADD_FIELD_NUMBER: _ClassVar[int]
|
|
25
|
+
tenant_id: str
|
|
26
|
+
balance_to_add: int
|
|
27
|
+
def __init__(self, tenant_id: _Optional[str] = ..., balance_to_add: _Optional[int] = ...) -> None: ...
|
|
28
|
+
|
|
29
|
+
class PaymentServiceAddBalanceToCustomerResponse(_message.Message):
|
|
30
|
+
__slots__ = ("customer",)
|
|
31
|
+
CUSTOMER_FIELD_NUMBER: _ClassVar[int]
|
|
32
|
+
customer: _payment_pb2.PaymentCustomer
|
|
33
|
+
def __init__(self, customer: _Optional[_Union[_payment_pb2.PaymentCustomer, _Mapping]] = ...) -> None: ...
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
|
|
5
|
+
from metalstackcloud.admin.v1 import payment_pb2 as admin_dot_v1_dot_payment__pb2
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class PaymentServiceStub(object):
|
|
9
|
+
"""PaymentService serves payment related functions
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
def __init__(self, channel):
|
|
13
|
+
"""Constructor.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
channel: A grpc.Channel.
|
|
17
|
+
"""
|
|
18
|
+
self.ListCoupons = channel.unary_unary(
|
|
19
|
+
'/admin.v1.PaymentService/ListCoupons',
|
|
20
|
+
request_serializer=admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsRequest.SerializeToString,
|
|
21
|
+
response_deserializer=admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsResponse.FromString,
|
|
22
|
+
_registered_method=True)
|
|
23
|
+
self.AddBalanceToCustomer = channel.unary_unary(
|
|
24
|
+
'/admin.v1.PaymentService/AddBalanceToCustomer',
|
|
25
|
+
request_serializer=admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerRequest.SerializeToString,
|
|
26
|
+
response_deserializer=admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerResponse.FromString,
|
|
27
|
+
_registered_method=True)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class PaymentServiceServicer(object):
|
|
31
|
+
"""PaymentService serves payment related functions
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
def ListCoupons(self, request, context):
|
|
35
|
+
"""ListCoupons list all available coupons
|
|
36
|
+
"""
|
|
37
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
38
|
+
context.set_details('Method not implemented!')
|
|
39
|
+
raise NotImplementedError('Method not implemented!')
|
|
40
|
+
|
|
41
|
+
def AddBalanceToCustomer(self, request, context):
|
|
42
|
+
"""AddBalanceToCustomer adds balance to a customer
|
|
43
|
+
"""
|
|
44
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
45
|
+
context.set_details('Method not implemented!')
|
|
46
|
+
raise NotImplementedError('Method not implemented!')
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def add_PaymentServiceServicer_to_server(servicer, server):
|
|
50
|
+
rpc_method_handlers = {
|
|
51
|
+
'ListCoupons': grpc.unary_unary_rpc_method_handler(
|
|
52
|
+
servicer.ListCoupons,
|
|
53
|
+
request_deserializer=admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsRequest.FromString,
|
|
54
|
+
response_serializer=admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsResponse.SerializeToString,
|
|
55
|
+
),
|
|
56
|
+
'AddBalanceToCustomer': grpc.unary_unary_rpc_method_handler(
|
|
57
|
+
servicer.AddBalanceToCustomer,
|
|
58
|
+
request_deserializer=admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerRequest.FromString,
|
|
59
|
+
response_serializer=admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerResponse.SerializeToString,
|
|
60
|
+
),
|
|
61
|
+
}
|
|
62
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
63
|
+
'admin.v1.PaymentService', rpc_method_handlers)
|
|
64
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
65
|
+
server.add_registered_method_handlers('admin.v1.PaymentService', rpc_method_handlers)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
# This class is part of an EXPERIMENTAL API.
|
|
69
|
+
class PaymentService(object):
|
|
70
|
+
"""PaymentService serves payment related functions
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
@staticmethod
|
|
74
|
+
def ListCoupons(request,
|
|
75
|
+
target,
|
|
76
|
+
options=(),
|
|
77
|
+
channel_credentials=None,
|
|
78
|
+
call_credentials=None,
|
|
79
|
+
insecure=False,
|
|
80
|
+
compression=None,
|
|
81
|
+
wait_for_ready=None,
|
|
82
|
+
timeout=None,
|
|
83
|
+
metadata=None):
|
|
84
|
+
return grpc.experimental.unary_unary(
|
|
85
|
+
request,
|
|
86
|
+
target,
|
|
87
|
+
'/admin.v1.PaymentService/ListCoupons',
|
|
88
|
+
admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsRequest.SerializeToString,
|
|
89
|
+
admin_dot_v1_dot_payment__pb2.PaymentServiceListCouponsResponse.FromString,
|
|
90
|
+
options,
|
|
91
|
+
channel_credentials,
|
|
92
|
+
insecure,
|
|
93
|
+
call_credentials,
|
|
94
|
+
compression,
|
|
95
|
+
wait_for_ready,
|
|
96
|
+
timeout,
|
|
97
|
+
metadata,
|
|
98
|
+
_registered_method=True)
|
|
99
|
+
|
|
100
|
+
@staticmethod
|
|
101
|
+
def AddBalanceToCustomer(request,
|
|
102
|
+
target,
|
|
103
|
+
options=(),
|
|
104
|
+
channel_credentials=None,
|
|
105
|
+
call_credentials=None,
|
|
106
|
+
insecure=False,
|
|
107
|
+
compression=None,
|
|
108
|
+
wait_for_ready=None,
|
|
109
|
+
timeout=None,
|
|
110
|
+
metadata=None):
|
|
111
|
+
return grpc.experimental.unary_unary(
|
|
112
|
+
request,
|
|
113
|
+
target,
|
|
114
|
+
'/admin.v1.PaymentService/AddBalanceToCustomer',
|
|
115
|
+
admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerRequest.SerializeToString,
|
|
116
|
+
admin_dot_v1_dot_payment__pb2.PaymentServiceAddBalanceToCustomerResponse.FromString,
|
|
117
|
+
options,
|
|
118
|
+
channel_credentials,
|
|
119
|
+
insecure,
|
|
120
|
+
call_credentials,
|
|
121
|
+
compression,
|
|
122
|
+
wait_for_ready,
|
|
123
|
+
timeout,
|
|
124
|
+
metadata,
|
|
125
|
+
_registered_method=True)
|