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