Class v1beta1.SecurityCenterClient (5.8.0)

V1 Beta APIs for Security Center service. v1beta1

Package

@google-cloud/security-center

Constructors

(constructor)(opts)

constructor(opts?: ClientOptions);

Construct an instance of SecurityCenterClient.

Parameter
NameDescription
opts ClientOptions

Properties

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

operationsClient

operationsClient: gax.OperationsClient;

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

securityCenterStub

securityCenterStub?: Promise<{
        [name: string]: Function;
    }>;

servicePath

static get servicePath(): string;

The DNS address for this API service.

warn

warn: (code: string, message: string, warnType?: string) => void;

Methods

assetPath(organization, asset)

assetPath(organization: string, asset: string): string;

Return a fully-qualified asset resource name string.

Parameters
NameDescription
organization string
asset string
Returns
TypeDescription
string

{string} Resource name string.

checkRunAssetDiscoveryProgress(name)

checkRunAssetDiscoveryProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.protobuf.Empty>>;

Check the status of the long running operation returned by runAssetDiscovery().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.protobuf.Empty>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the organization to run asset discovery for. Its format is
   *  "organizations/[organization_id]".
   */
  // const parent = 'abc123'

  // Imports the Securitycenter library
  const {SecurityCenterClient} =
    require('@google-cloud/security-center').v1beta1;

  // Instantiates a client
  const securitycenterClient = new SecurityCenterClient();

  async function callRunAssetDiscovery() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const [operation] = await securitycenterClient.runAssetDiscovery(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callRunAssetDiscovery();

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

createFinding(request, options)

createFinding(request?: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, options?: CallOptions): Promise<[protos.google.cloud.securitycenter.v1beta1.IFinding, (protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest | undefined), {} | undefined]>;

Creates a finding. The corresponding source must exist for finding creation to succeed.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.securitycenter.v1beta1.IFinding, (protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest | undefined), {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Finding]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the new finding's parent. Its format should be
   *  "organizations/[organization_id]/sources/[source_id]".
   */
  // const parent = 'abc123'
  /**
   *  Required. Unique identifier provided by the client within the parent scope.
   *  It must be alphanumeric and less than or equal to 32 characters and
   *  greater than 0 characters in length.
   */
  // const findingId = 'abc123'
  /**
   *  Required. The Finding being created. The name and security_marks will be ignored as
   *  they are both output only fields on this resource.
   */
  // const finding = {}

  // Imports the Securitycenter library
  const {SecurityCenterClient} =
    require('@google-cloud/security-center').v1beta1;

  // Instantiates a client
  const securitycenterClient = new SecurityCenterClient();

  async function callCreateFinding() {
    // Construct request
    const request = {
      parent,
      findingId,
      finding,
    };

    // Run request
    const response = await securitycenterClient.createFinding(request);
    console.log(response);
  }

  callCreateFinding();

createFinding(request, options, callback)

createFinding(request: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, options: CallOptions, callback: Callback<protos.google.cloud.securitycenter.v1beta1.IFinding, protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest
options CallOptions
callback Callback<protos.google.cloud.securitycenter.v1beta1.IFinding, protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createFinding(request, callback)

createFinding(request: protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest, callback: Callback<protos.google.cloud.securitycenter.v1beta1.IFinding, protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest
callback Callback<protos.google.cloud.securitycenter.v1beta1.IFinding, protos.google.cloud.securitycenter.v1beta1.ICreateFindingRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createSource(request, options)

createSource(request?: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, options?: CallOptions): Promise<[protos.google.cloud.securitycenter.v1beta1.ISource, (protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest | undefined), {} | undefined]>;

Creates a source.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.securitycenter.v1beta1.ISource, (protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest | undefined), {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Source]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the new source's parent. Its format should be
   *  "organizations/[organization_id]".
   */
  // const parent = 'abc123'
  /**
   *  Required. The Source being created, only the display_name and description will be
   *  used. All other fields will be ignored.
   */
  // const source = {}

  // Imports the Securitycenter library
  const {SecurityCenterClient} =
    require('@google-cloud/security-center').v1beta1;

  // Instantiates a client
  const securitycenterClient = new SecurityCenterClient();

  async function callCreateSource() {
    // Construct request
    const request = {
      parent,
      source,
    };

    // Run request
    const response = await securitycenterClient.createSource(request);
    console.log(response);
  }

  callCreateSource();

createSource(request, options, callback)

createSource(request: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, options: CallOptions, callback: Callback<protos.google.cloud.securitycenter.v1beta1.ISource, protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest
options CallOptions
callback Callback<protos.google.cloud.securitycenter.v1beta1.ISource, protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createSource(request, callback)

createSource(request: protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest, callback: Callback<protos.google.cloud.securitycenter.v1beta1.ISource, protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest
callback Callback<protos.google.cloud.securitycenter.v1beta1.ISource, protos.google.cloud.securitycenter.v1beta1.ICreateSourceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

findingPath(organization, source, finding)

findingPath(organization: string, source: string, finding: string): string;

Return a fully-qualified finding resource name string.

Parameters
NameDescription
organization string
source string
finding string
Returns
TypeDescription
string

{string} Resource name string.

getIamPolicy(request, options)

getIamPolicy(request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined]>;

Gets the access control policy on the specified Source.

Parameters
NameDescription
request protos.google.iam.v1.IGetIamPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Policy]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  REQUIRED: The resource for which the policy is being requested.
   *  See the operation documentation for the appropriate value for this field.
   */
  // const resource = 'abc123'
  /**
   *  OPTIONAL: A `GetPolicyOptions` object for specifying options to
   *  `GetIamPolicy`. This field is only used by Cloud IAM.
   */
  // const options = {}

  // Imports the Securitycenter library
  const {SecurityCenterClient} =
    require('@google-cloud/security-center').v1beta1;

  // Instantiates a client
  const securitycenterClient = new SecurityCenterClient();

  async function callGetIamPolicy() {
    // Construct request
    const request = {
      resource,
    };

    // Run request
    const response = await securitycenterClient.getIamPolicy(request);
    console.log(response);
  }

  callGetIamPolicy();

getIamPolicy(request, options, callback)

getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.IGetIamPolicyRequest
options CallOptions
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getIamPolicy(request, callback)

getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.IGetIamPolicyRequest
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getOrganizationSettings(request, options)

getOrganizationSettings(request?: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, options?: CallOptions): Promise<[protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, (protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest | undefined), {} | undefined]>;

Gets the settings for an organization.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, (protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest | undefined), {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [OrganizationSettings]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the organization to get organization settings for. Its format is
   *  "organizations/[organization_id]/organizationSettings".
   */
  // const name = 'abc123'

  // Imports the Securitycenter library
  const {SecurityCenterClient} =
    require('@google-cloud/security-center').v1beta1;

  // Instantiates a client
  const securitycenterClient = new SecurityCenterClient();

  async function callGetOrganizationSettings() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await securitycenterClient.getOrganizationSettings(
      request
    );
    console.log(response);
  }

  callGetOrganizationSettings();

getOrganizationSettings(request, options, callback)

getOrganizationSettings(request: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, options: CallOptions, callback: Callback<protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest
options CallOptions
callback Callback<protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getOrganizationSettings(request, callback)

getOrganizationSettings(request: protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest, callback: Callback<protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest
callback Callback<protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, protos.google.cloud.securitycenter.v1beta1.IGetOrganizationSettingsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
NameDescription
callback Callback<string, undefined, undefined>
Returns
TypeDescription
void

getSource(request, options)

getSource(request?: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, options?: CallOptions): Promise<[protos.google.cloud.securitycenter.v1beta1.ISource, protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest | undefined, {} | undefined]>;

Gets a source.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.securitycenter.v1beta1.ISource, protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Source]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Relative resource name of the source. Its format is
   *  "organizations/[organization_id]/source/[source_id]".
   */
  // const name = 'abc123'

  // Imports the Securitycenter library
  const {SecurityCenterClient} =
    require('@google-cloud/security-center').v1beta1;

  // Instantiates a client
  const securitycenterClient = new SecurityCenterClient();

  async function callGetSource() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await securitycenterClient.getSource(request);
    console.log(response);
  }

  callGetSource();

getSource(request, options, callback)

getSource(request: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, options: CallOptions, callback: Callback<protos.google.cloud.securitycenter.v1beta1.ISource, protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest
options CallOptions
callback Callback<protos.google.cloud.securitycenter.v1beta1.ISource, protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getSource(request, callback)

getSource(request: protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest, callback: Callback<protos.google.cloud.securitycenter.v1beta1.ISource, protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest
callback Callback<protos.google.cloud.securitycenter.v1beta1.ISource, protos.google.cloud.securitycenter.v1beta1.IGetSourceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

groupAssets(request, options)

groupAssets(request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, options?: CallOptions): Promise<[protos.google.cloud.securitycenter.v1beta1.IGroupResult[], protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest | null, protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse]>;

Filters an organization's assets and groups them by their specified properties.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.securitycenter.v1beta1.IGroupResult[], protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest | null, protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [GroupResult]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using groupAssetsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

groupAssets(request, options, callback)

groupAssets(request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.IGroupResult>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.IGroupResult>
Returns
TypeDescription
void

groupAssets(request, callback)

groupAssets(request: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, callback: PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.IGroupResult>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest
callback PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, protos.google.cloud.securitycenter.v1beta1.IGroupAssetsResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.IGroupResult>
Returns
TypeDescription
void

groupAssetsAsync(request, options)

groupAssetsAsync(request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.securitycenter.v1beta1.IGroupResult>;

Equivalent to groupAssets, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.securitycenter.v1beta1.IGroupResult>

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [GroupResult]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the organization to groupBy. Its format is
   *  "organizations/[organization_id]".
   */
  // const parent = 'abc123'
  /**
   *  Expression that defines the filter to apply across assets.
   *  The expression is a list of zero or more restrictions combined via logical
   *  operators `AND` and `OR`.
   *  Parentheses are not supported, and `OR` has higher precedence than `AND`.
   *  Restrictions have the form `

groupAssetsStream(request, options)

groupAssetsStream(request?: protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IGroupAssetsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing [GroupResult] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using groupAssetsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

groupFindings(request, options)

groupFindings(request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, options?: CallOptions): Promise<[protos.google.cloud.securitycenter.v1beta1.IGroupResult[], protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest | null, protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse]>;

Filters an organization or source's findings and groups them by their specified properties.

To group across all sources provide a - as the source id. Example: /v1beta1/organizations/{organization_id}/sources/-/findings

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.securitycenter.v1beta1.IGroupResult[], protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest | null, protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [GroupResult]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using groupFindingsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

groupFindings(request, options, callback)

groupFindings(request: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.IGroupResult>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.IGroupResult>
Returns
TypeDescription
void

groupFindings(request, callback)

groupFindings(request: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, callback: PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.IGroupResult>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest
callback PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, protos.google.cloud.securitycenter.v1beta1.IGroupFindingsResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.IGroupResult>
Returns
TypeDescription
void

groupFindingsAsync(request, options)

groupFindingsAsync(request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.securitycenter.v1beta1.IGroupResult>;

Equivalent to groupFindings, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.securitycenter.v1beta1.IGroupResult>

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [GroupResult]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the source to groupBy. Its format is
   *  "organizations/[organization_id]/sources/[source_id]". To groupBy across
   *  all sources provide a source_id of `-`. For example:
   *  organizations/{organization_id}/sources/-
   */
  // const parent = 'abc123'
  /**
   *  Expression that defines the filter to apply across findings.
   *  The expression is a list of one or more restrictions combined via logical
   *  operators `AND` and `OR`.
   *  Parentheses are not supported, and `OR` has higher precedence than `AND`.
   *  Restrictions have the form `

groupFindingsStream(request, options)

groupFindingsStream(request?: protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IGroupFindingsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing [GroupResult] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using groupFindingsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

initialize()

initialize(): Promise<{
        [name: string]: Function;
    }>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
TypeDescription
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

listAssets(request, options)

listAssets(request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, options?: CallOptions): Promise<[protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest | null, protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse]>;

Lists an organization's assets.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult[], protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest | null, protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [ListAssetsResult]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listAssetsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listAssets(request, options, callback)

listAssets(request: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult>
Returns
TypeDescription
void

listAssets(request, callback)

listAssets(request: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, callback: PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest
callback PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, protos.google.cloud.securitycenter.v1beta1.IListAssetsResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult>
Returns
TypeDescription
void

listAssetsAsync(request, options)

listAssetsAsync(request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult>;

Equivalent to listAssets, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.securitycenter.v1beta1.ListAssetsResponse.IListAssetsResult>

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [ListAssetsResult]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the organization assets should belong to. Its format is
   *  "organizations/[organization_id]".
   */
  // const parent = 'abc123'
  /**
   *  Expression that defines the filter to apply across assets.
   *  The expression is a list of zero or more restrictions combined via logical
   *  operators `AND` and `OR`.
   *  Parentheses are not supported, and `OR` has higher precedence than `AND`.
   *  Restrictions have the form `

listAssetsStream(request, options)

listAssetsStream(request?: protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IListAssetsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing [ListAssetsResult] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listAssetsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listFindings(request, options)

listFindings(request?: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, options?: CallOptions): Promise<[protos.google.cloud.securitycenter.v1beta1.IFinding[], protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest | null, protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse]>;

Lists an organization or source's findings.

To list across all sources provide a - as the source id. Example: /v1beta1/organizations/{organization_id}/sources/-/findings

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.securitycenter.v1beta1.IFinding[], protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest | null, protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [Finding]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listFindingsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listFindings(request, options, callback)

listFindings(request: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.IFinding>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.IFinding>
Returns
TypeDescription
void

listFindings(request, callback)

listFindings(request: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, callback: PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.IFinding>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest
callback PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, protos.google.cloud.securitycenter.v1beta1.IListFindingsResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.IFinding>
Returns
TypeDescription
void

listFindingsAsync(request, options)

listFindingsAsync(request?: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.securitycenter.v1beta1.IFinding>;

Equivalent to listFindings, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.securitycenter.v1beta1.IFinding>

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Finding]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the source the findings belong to. Its format is
   *  "organizations/[organization_id]/sources/[source_id]". To list across all
   *  sources provide a source_id of `-`. For example:
   *  organizations/{organization_id}/sources/-
   */
  // const parent = 'abc123'
  /**
   *  Expression that defines the filter to apply across findings.
   *  The expression is a list of one or more restrictions combined via logical
   *  operators `AND` and `OR`.
   *  Parentheses are not supported, and `OR` has higher precedence than `AND`.
   *  Restrictions have the form `

listFindingsStream(request, options)

listFindingsStream(request?: protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IListFindingsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing [Finding] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listFindingsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listSources(request, options)

listSources(request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, options?: CallOptions): Promise<[protos.google.cloud.securitycenter.v1beta1.ISource[], protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest | null, protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse]>;

Lists all sources belonging to an organization.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.securitycenter.v1beta1.ISource[], protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest | null, protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [Source]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listSourcesAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listSources(request, options, callback)

listSources(request: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.ISource>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.ISource>
Returns
TypeDescription
void

listSources(request, callback)

listSources(request: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, callback: PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.ISource>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest
callback PaginationCallback<protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, protos.google.cloud.securitycenter.v1beta1.IListSourcesResponse | null | undefined, protos.google.cloud.securitycenter.v1beta1.ISource>
Returns
TypeDescription
void

listSourcesAsync(request, options)

listSourcesAsync(request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.securitycenter.v1beta1.ISource>;

Equivalent to listSources, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.securitycenter.v1beta1.ISource>

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Source]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the parent of sources to list. Its format should be
   *  "organizations/[organization_id]".
   */
  // const parent = 'abc123'
  /**
   *  The value returned by the last `ListSourcesResponse`; indicates
   *  that this is a continuation of a prior `ListSources` call, and
   *  that the system should return the next page of data.
   */
  // const pageToken = 'abc123'
  /**
   *  The maximum number of results to return in a single response. Default is
   *  10, minimum is 1, maximum is 1000.
   */
  // const pageSize = 1234

  // Imports the Securitycenter library
  const {SecurityCenterClient} =
    require('@google-cloud/security-center').v1beta1;

  // Instantiates a client
  const securitycenterClient = new SecurityCenterClient();

  async function callListSources() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await securitycenterClient.listSourcesAsync(request);
    for await (const response of iterable) {
      console.log(response);
    }
  }

  callListSources();

listSourcesStream(request, options)

listSourcesStream(request?: protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IListSourcesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing [Source] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listSourcesAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

matchAssetFromAssetName(assetName)

matchAssetFromAssetName(assetName: string): string | number;

Parse the asset from Asset resource.

Parameter
NameDescription
assetName string

A fully-qualified path representing Asset resource.

Returns
TypeDescription
string | number

{string} A string representing the asset.

matchAssetFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName)

matchAssetFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName: string): string | number;

Parse the asset from OrganizationAssetSecurityMarks resource.

Parameter
NameDescription
organizationAssetSecurityMarksName string

A fully-qualified path representing organization_asset_securityMarks resource.

Returns
TypeDescription
string | number

{string} A string representing the asset.

matchFindingFromFindingName(findingName)

matchFindingFromFindingName(findingName: string): string | number;

Parse the finding from Finding resource.

Parameter
NameDescription
findingName string

A fully-qualified path representing Finding resource.

Returns
TypeDescription
string | number

{string} A string representing the finding.

matchFindingFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName)

matchFindingFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string): string | number;

Parse the finding from OrganizationSourceFindingSecurityMarks resource.

Parameter
NameDescription
organizationSourceFindingSecurityMarksName string

A fully-qualified path representing organization_source_finding_securityMarks resource.

Returns
TypeDescription
string | number

{string} A string representing the finding.

matchOrganizationFromAssetName(assetName)

matchOrganizationFromAssetName(assetName: string): string | number;

Parse the organization from Asset resource.

Parameter
NameDescription
assetName string

A fully-qualified path representing Asset resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchOrganizationFromFindingName(findingName)

matchOrganizationFromFindingName(findingName: string): string | number;

Parse the organization from Finding resource.

Parameter
NameDescription
findingName string

A fully-qualified path representing Finding resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchOrganizationFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName)

matchOrganizationFromOrganizationAssetSecurityMarksName(organizationAssetSecurityMarksName: string): string | number;

Parse the organization from OrganizationAssetSecurityMarks resource.

Parameter
NameDescription
organizationAssetSecurityMarksName string

A fully-qualified path representing organization_asset_securityMarks resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchOrganizationFromOrganizationName(organizationName)

matchOrganizationFromOrganizationName(organizationName: string): string | number;

Parse the organization from Organization resource.

Parameter
NameDescription
organizationName string

A fully-qualified path representing Organization resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchOrganizationFromOrganizationSettingsName(organizationSettingsName)

matchOrganizationFromOrganizationSettingsName(organizationSettingsName: string): string | number;

Parse the organization from OrganizationSettings resource.

Parameter
NameDescription
organizationSettingsName string

A fully-qualified path representing OrganizationSettings resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchOrganizationFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName)

matchOrganizationFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string): string | number;

Parse the organization from OrganizationSourceFindingSecurityMarks resource.

Parameter
NameDescription
organizationSourceFindingSecurityMarksName string

A fully-qualified path representing organization_source_finding_securityMarks resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchOrganizationFromSourceName(sourceName)

matchOrganizationFromSourceName(sourceName: string): string | number;

Parse the organization from Source resource.

Parameter
NameDescription
sourceName string

A fully-qualified path representing Source resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchSourceFromFindingName(findingName)

matchSourceFromFindingName(findingName: string): string | number;

Parse the source from Finding resource.

Parameter
NameDescription
findingName string

A fully-qualified path representing Finding resource.

Returns
TypeDescription
string | number

{string} A string representing the source.

matchSourceFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName)

matchSourceFromOrganizationSourceFindingSecurityMarksName(organizationSourceFindingSecurityMarksName: string): string | number;

Parse the source from OrganizationSourceFindingSecurityMarks resource.

Parameter
NameDescription
organizationSourceFindingSecurityMarksName string

A fully-qualified path representing organization_source_finding_securityMarks resource.

Returns
TypeDescription
string | number

{string} A string representing the source.

matchSourceFromSourceName(sourceName)

matchSourceFromSourceName(sourceName: string): string | number;

Parse the source from Source resource.

Parameter
NameDescription
sourceName string

A fully-qualified path representing Source resource.

Returns
TypeDescription
string | number

{string} A string representing the source.

organizationAssetSecurityMarksPath(organization, asset)

organizationAssetSecurityMarksPath(organization: string, asset: string): string;

Return a fully-qualified organizationAssetSecurityMarks resource name string.

Parameters
NameDescription
organization string
asset string
Returns
TypeDescription
string

{string} Resource name string.

organizationPath(organization)

organizationPath(organization: string): string;

Return a fully-qualified organization resource name string.

Parameter
NameDescription
organization string
Returns
TypeDescription
string

{string} Resource name string.

organizationSettingsPath(organization)

organizationSettingsPath(organization: string): string;

Return a fully-qualified organizationSettings resource name string.

Parameter
NameDescription
organization string
Returns
TypeDescription
string

{string} Resource name string.

organizationSourceFindingSecurityMarksPath(organization, source, finding)

organizationSourceFindingSecurityMarksPath(organization: string, source: string, finding: string): string;

Return a fully-qualified organizationSourceFindingSecurityMarks resource name string.

Parameters
NameDescription
organization string
source string
finding string
Returns
TypeDescription
string

{string} Resource name string.

runAssetDiscovery(request, options)

runAssetDiscovery(request?: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, options?: CallOptions): Promise<[LROperation<protos.google.protobuf.IEmpty, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;

Runs asset discovery. The discovery is tracked with a long-running operation.

This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[LROperation<protos.google.protobuf.IEmpty, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the organization to run asset discovery for. Its format is
   *  "organizations/[organization_id]".
   */
  // const parent = 'abc123'

  // Imports the Securitycenter library
  const {SecurityCenterClient} =
    require('@google-cloud/security-center').v1beta1;

  // Instantiates a client
  const securitycenterClient = new SecurityCenterClient();

  async function callRunAssetDiscovery() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const [operation] = await securitycenterClient.runAssetDiscovery(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callRunAssetDiscovery();

runAssetDiscovery(request, options, callback)

runAssetDiscovery(request: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

runAssetDiscovery(request, callback)

runAssetDiscovery(request: protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IRunAssetDiscoveryRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setFindingState(request, options)

setFindingState(request?: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, options?: CallOptions): Promise<[protos.google.cloud.securitycenter.v1beta1.IFinding, (protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest | undefined), {} | undefined]>;

Updates the state of a finding.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.securitycenter.v1beta1.IFinding, (protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest | undefined), {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Finding]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The relative resource name of the finding. See:
   *  https://cloud.google.com/apis/design/resource_names#relative_resource_name
   *  Example:
   *  "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}".
   */
  // const name = 'abc123'
  /**
   *  Required. The desired State of the finding.
   */
  // const state = {}
  /**
   *  Required. The time at which the updated state takes effect.
   */
  // const startTime = {}

  // Imports the Securitycenter library
  const {SecurityCenterClient} =
    require('@google-cloud/security-center').v1beta1;

  // Instantiates a client
  const securitycenterClient = new SecurityCenterClient();

  async function callSetFindingState() {
    // Construct request
    const request = {
      name,
      state,
      startTime,
    };

    // Run request
    const response = await securitycenterClient.setFindingState(request);
    console.log(response);
  }

  callSetFindingState();

setFindingState(request, options, callback)

setFindingState(request: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, options: CallOptions, callback: Callback<protos.google.cloud.securitycenter.v1beta1.IFinding, protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest
options CallOptions
callback Callback<protos.google.cloud.securitycenter.v1beta1.IFinding, protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setFindingState(request, callback)

setFindingState(request: protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest, callback: Callback<protos.google.cloud.securitycenter.v1beta1.IFinding, protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest
callback Callback<protos.google.cloud.securitycenter.v1beta1.IFinding, protos.google.cloud.securitycenter.v1beta1.ISetFindingStateRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setIamPolicy(request, options)

setIamPolicy(request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined]>;

Sets the access control policy on the specified Source.

Parameters
NameDescription
request protos.google.iam.v1.ISetIamPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Policy]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  REQUIRED: The resource for which the policy is being specified.
   *  See the operation documentation for the appropriate value for this field.
   */
  // const resource = 'abc123'
  /**
   *  REQUIRED: The complete policy to be applied to the `resource`. The size of
   *  the policy is limited to a few 10s of KB. An empty policy is a
   *  valid policy but certain Cloud Platform services (such as Projects)
   *  might reject them.
   */
  // const policy = {}

  // Imports the Securitycenter library
  const {SecurityCenterClient} =
    require('@google-cloud/security-center').v1beta1;

  // Instantiates a client
  const securitycenterClient = new SecurityCenterClient();

  async function callSetIamPolicy() {
    // Construct request
    const request = {
      resource,
      policy,
    };

    // Run request
    const response = await securitycenterClient.setIamPolicy(request);
    console.log(response);
  }

  callSetIamPolicy();

setIamPolicy(request, options, callback)

setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.ISetIamPolicyRequest
options CallOptions
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setIamPolicy(request, callback)

setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.ISetIamPolicyRequest
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

sourcePath(organization, source)

sourcePath(organization: string, source: string): string;

Return a fully-qualified source resource name string.

Parameters
NameDescription
organization string
source string
Returns
TypeDescription
string

{string} Resource name string.

testIamPermissions(request, options)

testIamPermissions(request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined]>;

Returns the permissions that a caller has on the specified source.

Parameters
NameDescription
request protos.google.iam.v1.ITestIamPermissionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [TestIamPermissionsResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  REQUIRED: The resource for which the policy detail is being requested.
   *  See the operation documentation for the appropriate value for this field.
   */
  // const resource = 'abc123'
  /**
   *  The set of permissions to check for the `resource`. Permissions with
   *  wildcards (such as '*' or 'storage.*') are not allowed. For more
   *  information see
   *  IAM Overview (https://cloud.google.com/iam/docs/overview#permissions).
   */
  // const permissions = 'abc123'

  // Imports the Securitycenter library
  const {SecurityCenterClient} =
    require('@google-cloud/security-center').v1beta1;

  // Instantiates a client
  const securitycenterClient = new SecurityCenterClient();

  async function callTestIamPermissions() {
    // Construct request
    const request = {
      resource,
      permissions,
    };

    // Run request
    const response = await securitycenterClient.testIamPermissions(request);
    console.log(response);
  }

  callTestIamPermissions();

testIamPermissions(request, options, callback)

testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.ITestIamPermissionsRequest
options CallOptions
callback Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

testIamPermissions(request, callback)

testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.ITestIamPermissionsRequest
callback Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateFinding(request, options)

updateFinding(request?: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, options?: CallOptions): Promise<[protos.google.cloud.securitycenter.v1beta1.IFinding, (protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest | undefined), {} | undefined]>;

Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.securitycenter.v1beta1.IFinding, (protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest | undefined), {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Finding]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The finding resource to update or create if it does not already exist.
   *  parent, security_marks, and update_time will be ignored.
   *  In the case of creation, the finding id portion of the name must
   *  alphanumeric and less than or equal to 32 characters and greater than 0
   *  characters in length.
   */
  // const finding = {}
  /**
   *  The FieldMask to use when updating the finding resource. This field should
   *  not be specified when creating a finding.
   */
  // const updateMask = {}

  // Imports the Securitycenter library
  const {SecurityCenterClient} =
    require('@google-cloud/security-center').v1beta1;

  // Instantiates a client
  const securitycenterClient = new SecurityCenterClient();

  async function callUpdateFinding() {
    // Construct request
    const request = {
      finding,
    };

    // Run request
    const response = await securitycenterClient.updateFinding(request);
    console.log(response);
  }

  callUpdateFinding();

updateFinding(request, options, callback)

updateFinding(request: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, options: CallOptions, callback: Callback<protos.google.cloud.securitycenter.v1beta1.IFinding, protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest
options CallOptions
callback Callback<protos.google.cloud.securitycenter.v1beta1.IFinding, protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateFinding(request, callback)

updateFinding(request: protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest, callback: Callback<protos.google.cloud.securitycenter.v1beta1.IFinding, protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest
callback Callback<protos.google.cloud.securitycenter.v1beta1.IFinding, protos.google.cloud.securitycenter.v1beta1.IUpdateFindingRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateOrganizationSettings(request, options)

updateOrganizationSettings(request?: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, options?: CallOptions): Promise<[protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, (protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest | undefined), {} | undefined]>;

Updates an organization's settings.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, (protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest | undefined), {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [OrganizationSettings]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The organization settings resource to update.
   */
  // const organizationSettings = {}
  /**
   *  The FieldMask to use when updating the settings resource.
   */
  // const updateMask = {}

  // Imports the Securitycenter library
  const {SecurityCenterClient} =
    require('@google-cloud/security-center').v1beta1;

  // Instantiates a client
  const securitycenterClient = new SecurityCenterClient();

  async function callUpdateOrganizationSettings() {
    // Construct request
    const request = {
      organizationSettings,
    };

    // Run request
    const response = await securitycenterClient.updateOrganizationSettings(
      request
    );
    console.log(response);
  }

  callUpdateOrganizationSettings();

updateOrganizationSettings(request, options, callback)

updateOrganizationSettings(request: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, options: CallOptions, callback: Callback<protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest
options CallOptions
callback Callback<protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateOrganizationSettings(request, callback)

updateOrganizationSettings(request: protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest, callback: Callback<protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest
callback Callback<protos.google.cloud.securitycenter.v1beta1.IOrganizationSettings, protos.google.cloud.securitycenter.v1beta1.IUpdateOrganizationSettingsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateSecurityMarks(request, options)

updateSecurityMarks(request?: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, options?: CallOptions): Promise<[protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, (protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest | undefined), {} | undefined]>;

Updates security marks.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, (protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest | undefined), {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [SecurityMarks]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The security marks resource to update.
   */
  // const securityMarks = {}
  /**
   *  The FieldMask to use when updating the security marks resource.
   */
  // const updateMask = {}
  /**
   *  The time at which the updated SecurityMarks take effect.
   */
  // const startTime = {}

  // Imports the Securitycenter library
  const {SecurityCenterClient} =
    require('@google-cloud/security-center').v1beta1;

  // Instantiates a client
  const securitycenterClient = new SecurityCenterClient();

  async function callUpdateSecurityMarks() {
    // Construct request
    const request = {
      securityMarks,
    };

    // Run request
    const response = await securitycenterClient.updateSecurityMarks(request);
    console.log(response);
  }

  callUpdateSecurityMarks();

updateSecurityMarks(request, options, callback)

updateSecurityMarks(request: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, options: CallOptions, callback: Callback<protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest
options CallOptions
callback Callback<protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateSecurityMarks(request, callback)

updateSecurityMarks(request: protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest, callback: Callback<protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest
callback Callback<protos.google.cloud.securitycenter.v1beta1.ISecurityMarks, protos.google.cloud.securitycenter.v1beta1.IUpdateSecurityMarksRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateSource(request, options)

updateSource(request?: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, options?: CallOptions): Promise<[protos.google.cloud.securitycenter.v1beta1.ISource, (protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest | undefined), {} | undefined]>;

Updates a source.

Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.cloud.securitycenter.v1beta1.ISource, (protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest | undefined), {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Source]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The source resource to update.
   */
  // const source = {}
  /**
   *  The FieldMask to use when updating the source resource.
   */
  // const updateMask = {}

  // Imports the Securitycenter library
  const {SecurityCenterClient} =
    require('@google-cloud/security-center').v1beta1;

  // Instantiates a client
  const securitycenterClient = new SecurityCenterClient();

  async function callUpdateSource() {
    // Construct request
    const request = {
      source,
    };

    // Run request
    const response = await securitycenterClient.updateSource(request);
    console.log(response);
  }

  callUpdateSource();

updateSource(request, options, callback)

updateSource(request: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, options: CallOptions, callback: Callback<protos.google.cloud.securitycenter.v1beta1.ISource, protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest
options CallOptions
callback Callback<protos.google.cloud.securitycenter.v1beta1.ISource, protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateSource(request, callback)

updateSource(request: protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest, callback: Callback<protos.google.cloud.securitycenter.v1beta1.ISource, protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest
callback Callback<protos.google.cloud.securitycenter.v1beta1.ISource, protos.google.cloud.securitycenter.v1beta1.IUpdateSourceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void