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

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

  // findingName is the full resource name of the source the finding should
  // be associated with.
  /*
   * TODO(developer): Uncomment the following lines
   */
  // const findingName =
  // "organizations/111122222444/sources/1234/findings/findingid";
  async function setFindingState() {
    const eventTime = new Date();
    const [updatedFinding] = await client.setFindingState({
      name: findingName,
      state: 'INACTIVE',
      // use now as the time when the new state takes effect.
      startTime: {
        seconds: Math.floor(eventTime.getTime() / 1000),
        nanos: (eventTime.getTime() % 1000) * 1e6,
      },
    });
    console.log('Updated Finding: %j', updatedFinding);
  }
  setFindingState();
  // [END securitycenter_update_finding_state]
}
Demonstrates how to update a security finding's state in
CSCC.