Skip to content

Commit

Permalink
feat: Added gRPC methods for Any cast for FieldsContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
a-bouth committed Dec 19, 2024
1 parent 329f94a commit 58b007c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/ansys/dpf/gate/any_grpcapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def _type_to_message_type():
from ansys.dpf.gate import dpf_vector
from ansys.dpf.core import (
field,
fields_container,
property_field,
generic_data_container,
string_field,
Expand All @@ -50,6 +51,7 @@ def _type_to_message_type():
(float, base_pb2.Type.DOUBLE),
(bytes, base_pb2.Type.STRING),
(field.Field, base_pb2.Type.FIELD),
(fields_container.FieldsContainer, base_pb2.Type.COLLECTION, base_pb2.Type.FIELD),
(property_field.PropertyField, base_pb2.Type.PROPERTY_FIELD),
(string_field.StringField, base_pb2.Type.STRING_FIELD),
(custom_type_field.CustomTypeField, base_pb2.Type.CUSTOM_TYPE_FIELD),
Expand Down Expand Up @@ -114,6 +116,10 @@ def any_get_as_field(any):
@staticmethod
def any_get_as_property_field(any):
return AnyGRPCAPI._get_as(any).field

@staticmethod
def any_get_as_fields_container(any):
return AnyGRPCAPI._get_as(any).collection

@staticmethod
def any_get_as_string_field(any):
Expand Down Expand Up @@ -213,6 +219,10 @@ def any_new_from_field(any):
def any_new_from_property_field(any):
return AnyGRPCAPI._new_from(any, any._server)

@staticmethod
def any_new_from_fields_container(any):
return AnyGRPCAPI._new_from(any, any._server)

@staticmethod
def any_new_from_string_field(any):
return AnyGRPCAPI._new_from(any, any._server)
Expand Down

0 comments on commit 58b007c

Please sign in to comment.