Skip to content

Commit

Permalink
python(feature): update protos (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
solidiquis authored Sep 9, 2024
1 parent 147d67c commit 00df8dd
Show file tree
Hide file tree
Showing 18 changed files with 995 additions and 179 deletions.
45 changes: 28 additions & 17 deletions python/lib/sift/assets/v1/assets_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 50 additions & 1 deletion python/lib/sift/assets/v1/assets_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ isort:skip_file
import builtins
import collections.abc
import google.protobuf.descriptor
import google.protobuf.field_mask_pb2
import google.protobuf.internal.containers
import google.protobuf.message
import google.protobuf.timestamp_pb2
Expand All @@ -24,6 +25,7 @@ class Asset(google.protobuf.message.Message):
CREATED_BY_USER_ID_FIELD_NUMBER: builtins.int
MODIFIED_DATE_FIELD_NUMBER: builtins.int
MODIFIED_BY_USER_ID_FIELD_NUMBER: builtins.int
TAGS_FIELD_NUMBER: builtins.int
asset_id: builtins.str
name: builtins.str
organization_id: builtins.str
Expand All @@ -33,6 +35,8 @@ class Asset(google.protobuf.message.Message):
def created_date(self) -> google.protobuf.timestamp_pb2.Timestamp: ...
@property
def modified_date(self) -> google.protobuf.timestamp_pb2.Timestamp: ...
@property
def tags(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
def __init__(
self,
*,
Expand All @@ -43,9 +47,10 @@ class Asset(google.protobuf.message.Message):
created_by_user_id: builtins.str = ...,
modified_date: google.protobuf.timestamp_pb2.Timestamp | None = ...,
modified_by_user_id: builtins.str = ...,
tags: collections.abc.Iterable[builtins.str] | None = ...,
) -> None: ...
def HasField(self, field_name: typing.Literal["created_date", b"created_date", "modified_date", b"modified_date"]) -> builtins.bool: ...
def ClearField(self, field_name: typing.Literal["asset_id", b"asset_id", "created_by_user_id", b"created_by_user_id", "created_date", b"created_date", "modified_by_user_id", b"modified_by_user_id", "modified_date", b"modified_date", "name", b"name", "organization_id", b"organization_id"]) -> None: ...
def ClearField(self, field_name: typing.Literal["asset_id", b"asset_id", "created_by_user_id", b"created_by_user_id", "created_date", b"created_date", "modified_by_user_id", b"modified_by_user_id", "modified_date", b"modified_date", "name", b"name", "organization_id", b"organization_id", "tags", b"tags"]) -> None: ...

global___Asset = Asset

Expand Down Expand Up @@ -173,3 +178,47 @@ class GetAssetResponse(google.protobuf.message.Message):
def ClearField(self, field_name: typing.Literal["asset", b"asset"]) -> None: ...

global___GetAssetResponse = GetAssetResponse

@typing.final
class UpdateAssetRequest(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

ASSET_FIELD_NUMBER: builtins.int
UPDATE_MASK_FIELD_NUMBER: builtins.int
@property
def asset(self) -> global___Asset:
"""The asset to update. The asset's `asset_id` field is used to identify asset run to update
and is required.
"""

@property
def update_mask(self) -> google.protobuf.field_mask_pb2.FieldMask:
"""The list of fields to be updated. Currently, the only field available to be updated is `tags`."""

def __init__(
self,
*,
asset: global___Asset | None = ...,
update_mask: google.protobuf.field_mask_pb2.FieldMask | None = ...,
) -> None: ...
def HasField(self, field_name: typing.Literal["asset", b"asset", "update_mask", b"update_mask"]) -> builtins.bool: ...
def ClearField(self, field_name: typing.Literal["asset", b"asset", "update_mask", b"update_mask"]) -> None: ...

global___UpdateAssetRequest = UpdateAssetRequest

@typing.final
class UpdateAssetResponse(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

ASSET_FIELD_NUMBER: builtins.int
@property
def asset(self) -> global___Asset: ...
def __init__(
self,
*,
asset: global___Asset | None = ...,
) -> None: ...
def HasField(self, field_name: typing.Literal["asset", b"asset"]) -> builtins.bool: ...
def ClearField(self, field_name: typing.Literal["asset", b"asset"]) -> None: ...

global___UpdateAssetResponse = UpdateAssetResponse
33 changes: 33 additions & 0 deletions python/lib/sift/assets/v1/assets_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ def __init__(self, channel):
request_serializer=sift_dot_assets_dot_v1_dot_assets__pb2.ListAssetsRequest.SerializeToString,
response_deserializer=sift_dot_assets_dot_v1_dot_assets__pb2.ListAssetsResponse.FromString,
)
self.UpdateAsset = channel.unary_unary(
'/sift.assets.v1.AssetService/UpdateAsset',
request_serializer=sift_dot_assets_dot_v1_dot_assets__pb2.UpdateAssetRequest.SerializeToString,
response_deserializer=sift_dot_assets_dot_v1_dot_assets__pb2.UpdateAssetResponse.FromString,
)


class AssetServiceServicer(object):
Expand All @@ -55,6 +60,12 @@ def ListAssets(self, request, context):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def UpdateAsset(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')


def add_AssetServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
Expand All @@ -73,6 +84,11 @@ def add_AssetServiceServicer_to_server(servicer, server):
request_deserializer=sift_dot_assets_dot_v1_dot_assets__pb2.ListAssetsRequest.FromString,
response_serializer=sift_dot_assets_dot_v1_dot_assets__pb2.ListAssetsResponse.SerializeToString,
),
'UpdateAsset': grpc.unary_unary_rpc_method_handler(
servicer.UpdateAsset,
request_deserializer=sift_dot_assets_dot_v1_dot_assets__pb2.UpdateAssetRequest.FromString,
response_serializer=sift_dot_assets_dot_v1_dot_assets__pb2.UpdateAssetResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'sift.assets.v1.AssetService', rpc_method_handlers)
Expand Down Expand Up @@ -133,3 +149,20 @@ def ListAssets(request,
sift_dot_assets_dot_v1_dot_assets__pb2.ListAssetsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def UpdateAsset(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/sift.assets.v1.AssetService/UpdateAsset',
sift_dot_assets_dot_v1_dot_assets__pb2.UpdateAssetRequest.SerializeToString,
sift_dot_assets_dot_v1_dot_assets__pb2.UpdateAssetResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
17 changes: 17 additions & 0 deletions python/lib/sift/assets/v1/assets_pb2_grpc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ class AssetServiceStub:
]
"""Retrieves assets using an optional filter."""

UpdateAsset: grpc.UnaryUnaryMultiCallable[
sift.assets.v1.assets_pb2.UpdateAssetRequest,
sift.assets.v1.assets_pb2.UpdateAssetResponse,
]

class AssetServiceAsyncStub:
DeleteAsset: grpc.aio.UnaryUnaryMultiCallable[
sift.assets.v1.assets_pb2.DeleteAssetRequest,
Expand All @@ -56,6 +61,11 @@ class AssetServiceAsyncStub:
]
"""Retrieves assets using an optional filter."""

UpdateAsset: grpc.aio.UnaryUnaryMultiCallable[
sift.assets.v1.assets_pb2.UpdateAssetRequest,
sift.assets.v1.assets_pb2.UpdateAssetResponse,
]

class AssetServiceServicer(metaclass=abc.ABCMeta):
@abc.abstractmethod
def DeleteAsset(
Expand All @@ -81,4 +91,11 @@ class AssetServiceServicer(metaclass=abc.ABCMeta):
) -> typing.Union[sift.assets.v1.assets_pb2.ListAssetsResponse, collections.abc.Awaitable[sift.assets.v1.assets_pb2.ListAssetsResponse]]:
"""Retrieves assets using an optional filter."""

@abc.abstractmethod
def UpdateAsset(
self,
request: sift.assets.v1.assets_pb2.UpdateAssetRequest,
context: _ServicerContext,
) -> typing.Union[sift.assets.v1.assets_pb2.UpdateAssetResponse, collections.abc.Awaitable[sift.assets.v1.assets_pb2.UpdateAssetResponse]]: ...

def add_AssetServiceServicer_to_server(servicer: AssetServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ...
Loading

0 comments on commit 00df8dd

Please sign in to comment.