...
Use the following methods to create or edit a gateway:
Device create method (projects.locations.registries.devices.create) to add gateways to registries
Device patch method (projects.locations.registries.devices.patch) to edit existing gateways
...
Registries BindDeviceToGateway method (projects.locations.registries.bindDeviceToGateway) to bind devices to gateways
Registries UnbindDeviceFromGateway method (projects.locations.registries.unbindDeviceFromGateway) to unbind devices from gateways
...
Use the Devices list method (projects.locations.registries.devices.list) and specify a gateway ID to list all devices bound to the gateway.
...
API -
Use the Device list method (projects.locations.registries.devices.list) to list all gateways in a registry.
...
After unbinding the device from all gateways it's bound to, use the Device delete method (projects.locations.registries.devices.delete) to delete the device.
Deleting a gateway
...
After unbinding all devices from the gateway, use the Device delete method (projects.locations.registries.devices.delete) to delete the gateway, specifying the ID of the gateway you want to delete.
...