File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -540,6 +540,28 @@ def delete_device(self, dev_eui:str) -> None:
540540 except grpc .RpcError as e :
541541 return self .refresh_token (e , self .delete_device , dev_eui )
542542
543+ def delete_device_profile (self , device_profile_id :str ) -> None :
544+ """
545+ Delete a Device Profile.
546+
547+ Params:
548+ - device_profile_id: unique identifier of the device profile.
549+ Passing in a Device Profile object will also work.
550+ """
551+ client = api .DeviceProfileServiceStub (self .channel )
552+
553+ # Define the JWT key metadata.
554+ metadata = [("authorization" , "Bearer %s" % self .auth_token )]
555+
556+ #Construct request
557+ req = api .DeleteDeviceProfileRequest ()
558+ req .id = str (device_profile_id )
559+
560+ try :
561+ return client .Delete (req , metadata = metadata )
562+ except grpc .RpcError as e :
563+ return self .refresh_token (e , self .delete_device_profile , device_profile_id )
564+
543565 @staticmethod
544566 def List_agg_pagination (client ,req ,metadata ) -> dict :
545567 """
You can’t perform that action at this time.
0 commit comments