@@ -6901,7 +6901,7 @@ def path(self, which=None):
69016901
69026902
69036903class RegistrationCommand (Entity , EntityCreateMixin , EntityReadMixin ):
6904- """A representation of a Role entity."""
6904+ """A representation of a Registration Command entity."""
69056905
69066906 def __init__ (self , server_config = None , ** kwargs ):
69076907 self ._fields = {
@@ -6954,6 +6954,35 @@ def read(self, entity=None, attrs=None, ignore=None, params=None):
69546954 return attrs ['registration_command' ]
69556955
69566956
6957+ class RegistrationTokens (Entity , EntityDeleteMixin ):
6958+ """A representation of Registration Token entity."""
6959+
6960+ def __init__ (self , server_config = None , user = None , ** kwargs ):
6961+ self ._fields = {
6962+ 'location' : entity_fields .OneToManyField (Location ),
6963+ 'organization' : entity_fields .OneToManyField (Organization ),
6964+ }
6965+ api_path = f'api/users/{ user } /registration_tokens' if user else 'api/registration_tokens'
6966+ self ._meta = {'api_path' : api_path }
6967+ super ().__init__ (server_config = server_config , ** kwargs )
6968+
6969+ def invalidate (self , synchronous = True , timeout = None , ** kwargs ):
6970+ """Invalidate tokens for a single user."""
6971+ kwargs = kwargs .copy ()
6972+ kwargs .update (self ._server_config .get_client_kwargs ())
6973+ response = client .delete (self .path (), ** kwargs )
6974+ return _handle_response (response , self ._server_config , synchronous , timeout )
6975+
6976+ def invalidate_multiple (self , synchronous = True , timeout = None , search = None , ** kwargs ):
6977+ """Invalidate tokens for multiple users."""
6978+ kwargs = kwargs .copy ()
6979+ if search :
6980+ kwargs ['params' ] = {'search' : search }
6981+ kwargs .update (self ._server_config .get_client_kwargs ())
6982+ response = client .delete (self .path (), ** kwargs )
6983+ return _handle_response (response , self ._server_config , synchronous , timeout )
6984+
6985+
69576986class Report (Entity ):
69586987 """A representation of a Report entity."""
69596988
0 commit comments