public final Device createDevice(String parent, Device device) {

    CreateDeviceRequest request =
        CreateDeviceRequest.newBuilder().setParent(parent).setDevice(device).build();
    return createDevice(request);
  }
public final Device createDevice ( String parent , Device device ) { CreateDeviceRequest request = CreateDeviceRequest . newBuilder ( ) . setParent ( parent ) . setDevice ( device ) . build ( ) ; return createDevice ( request ) ; }
Creates a device in a device registry.

<p>Sample code:

<pre><code>
try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
RegistryName parent = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]");
Device device = Device.newBuilder().build();
Device response = deviceManagerClient.createDevice(parent.toString(), device);
}
</code></pre>

@param parent The name of the device registry where this device should be created. For example,
`projects/example-project/locations/us-central1/registries/my-registry`.
@param device The device registration details. The field `name` must be empty. The server
generates `name` from the device registry `id` and the `parent` field.
@throws com.google.api.gax.rpc.ApiException if the remote call fails