Пример #1
0
 def abstract_clone_return(rset: ResourceSet) -> ResourceSet:
     """
     Clones the resource set, but without any of the concrete sets. Preserves
     only the configuration properties. This method should be used when
     sending a redeem/extend/close request to an authority.
     @param rset resource set
     @return a resources set that is a copy of the current but without any
             concrete sets.
     """
     return ResourceSet(units=rset.get_units(),
                        rtype=rset.get_type(),
                        sliver=rset.get_sliver())
Пример #2
0
 def translate_resource_set(*, resource_set: ResourceSet) -> ResourceSetAvro:
     avro_rset = ResourceSetAvro()
     avro_rset.type = str(resource_set.get_type())
     avro_rset.units = resource_set.get_units()
     avro_rset.set_sliver(sliver=resource_set.get_sliver())
     return avro_rset