For making a client in Google Cloud IoT Core, I initially just use:

```py
client = mqtt.Client(client_id=('projects/{}/locations/{}/registries/{}/devices/{}'
                    .format(args.project_id, args.cloud_region,
                            args.registry_id, args.device_id)))

```

Though, in many documentation code samples, I saw that this and another way given below were used:

```py
client = get_client(service_account_json)

```

To be able to use the above, I had to generate another JSON key. Not able to understand what's the essential difference between the two clients. Also, I had used the second way to obtain state of a device.