function main(organizationId = 'YOUR_NUMERIC_ORG_ID') {
  // [START securitycenter_enable_asset_discovery]
  // Imports the Google Cloud client library.
  const {SecurityCenterClient} = require('@google-cloud/security-center');

  // Creates a new client.
  const client = new SecurityCenterClient();

  async function updateOrgSettings() {
    //  organizationId is the numeric ID of the organization.
    /*
     * TODO(developer): Uncomment the following lines
     */
    // const organizationId = "111122222444";
    const orgName = client.organizationPath(organizationId);
    const [newSettings] = await client.updateOrganizationSettings({
      organizationSettings: {
        name: `${orgName}/organizationSettings`,
        enableAssetDiscovery: true,
      },
      // Only update the enableAssetDiscovery field.
      updateMask: {paths: ['enable_asset_discovery']},
    });

    console.log('New settings: %j', newSettings);
  }
  updateOrgSettings();
  // [END securitycenter_enable_asset_discovery]
}
Demostrates enabling asset discovery for an organization.