Max number of bytes to scan from a file. If a scanned file's size is bigger than this value then the rest of the bytes are omitted. Only one ofbytes_limit_per_fileandbytes_limit_per_file_percentcan be specified. This field can't be set if de-identification is requested. For certain file types, setting this field has no effect. For more information, seeLimits on bytes scanned per file.
↳ bytes_limit_per_file_percent
int
Max percentage of bytes to scan from a file. The rest are omitted. The number of bytes scanned is rounded down. Must be between 0 and 100, inclusively. Both 0 and 100 means no limit. Defaults to 0. Only one of bytes_limit_per_file and bytes_limit_per_file_percent can be specified. This field can't be set if de-identification is requested. For certain file types, setting this field has no effect. For more information, seeLimits on bytes scanned per file.
↳ file_types
array
List of file type groups to include in the scan. If empty, all files are scanned and available data format processors are applied. In addition, the binary content of the selected files is always scanned as well. Images are scanned only as binary if the specified region does not support image inspection and no file_types were specified. Image inspection is restricted to 'global', 'us', 'asia', and 'europe'.
↳ sample_method
int
How to sample the data.
↳ files_limit_percent
int
Limits the number of files to scan to this percentage of the input FileSet. Number of files scanned is rounded down. Must be between 0 and 100, inclusively. Both 0 and 100 means no limit. Defaults to 0.
Max number of bytes to scan from a file. If a scanned file's size is bigger
than this value then the rest of the bytes are omitted. Only one ofbytes_limit_per_fileandbytes_limit_per_file_percentcan be specified.
This field can't be set if de-identification is requested. For certain file
types, setting this field has no effect. For more information, seeLimits
on bytes scanned per
file.
Returns
Type
Description
int|string
setBytesLimitPerFile
Max number of bytes to scan from a file. If a scanned file's size is bigger
than this value then the rest of the bytes are omitted. Only one ofbytes_limit_per_fileandbytes_limit_per_file_percentcan be specified.
This field can't be set if de-identification is requested. For certain file
types, setting this field has no effect. For more information, seeLimits
on bytes scanned per
file.
Parameter
Name
Description
var
int|string
Returns
Type
Description
$this
getBytesLimitPerFilePercent
Max percentage of bytes to scan from a file. The rest are omitted. The
number of bytes scanned is rounded down. Must be between 0 and 100,
inclusively. Both 0 and 100 means no limit. Defaults to 0. Only one of
bytes_limit_per_file and bytes_limit_per_file_percent can be specified.
This field can't be set if de-identification is requested. For certain file
types, setting this field has no effect. For more information, seeLimits
on bytes scanned per
file.
Returns
Type
Description
int
setBytesLimitPerFilePercent
Max percentage of bytes to scan from a file. The rest are omitted. The
number of bytes scanned is rounded down. Must be between 0 and 100,
inclusively. Both 0 and 100 means no limit. Defaults to 0. Only one of
bytes_limit_per_file and bytes_limit_per_file_percent can be specified.
This field can't be set if de-identification is requested. For certain file
types, setting this field has no effect. For more information, seeLimits
on bytes scanned per
file.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getFileTypes
List of file type groups to include in the scan.
If empty, all files are scanned and available data format processors
are applied. In addition, the binary content of the selected files
is always scanned as well.
Images are scanned only as binary if the specified region
does not support image inspection and no file_types were specified.
Image inspection is restricted to 'global', 'us', 'asia', and 'europe'.
If empty, all files are scanned and available data format processors
are applied. In addition, the binary content of the selected files
is always scanned as well.
Images are scanned only as binary if the specified region
does not support image inspection and no file_types were specified.
Image inspection is restricted to 'global', 'us', 'asia', and 'europe'.
Parameter
Name
Description
var
int[]
Returns
Type
Description
$this
getSampleMethod
How to sample the data.
Returns
Type
Description
int
Enum of typeSampleMethod.
setSampleMethod
How to sample the data.
Parameter
Name
Description
var
int
Enum of typeSampleMethod.
Returns
Type
Description
$this
getFilesLimitPercent
Limits the number of files to scan to this percentage of the input FileSet.
Number of files scanned is rounded down. Must be between 0 and 100,
inclusively. Both 0 and 100 means no limit. Defaults to 0.
Returns
Type
Description
int
setFilesLimitPercent
Limits the number of files to scan to this percentage of the input FileSet.
Number of files scanned is rounded down. Must be between 0 and 100,
inclusively. Both 0 and 100 means no limit. Defaults to 0.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Data Loss Prevention V2 Client - Class CloudStorageOptions (2.6.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.6.1 (latest)](/php/docs/reference/cloud-dlp/latest/V2.CloudStorageOptions)\n- [2.6.0](/php/docs/reference/cloud-dlp/2.6.0/V2.CloudStorageOptions)\n- [2.4.1](/php/docs/reference/cloud-dlp/2.4.1/V2.CloudStorageOptions)\n- [2.3.0](/php/docs/reference/cloud-dlp/2.3.0/V2.CloudStorageOptions)\n- [2.2.3](/php/docs/reference/cloud-dlp/2.2.3/V2.CloudStorageOptions)\n- [2.1.0](/php/docs/reference/cloud-dlp/2.1.0/V2.CloudStorageOptions)\n- [2.0.0](/php/docs/reference/cloud-dlp/2.0.0/V2.CloudStorageOptions)\n- [1.19.0](/php/docs/reference/cloud-dlp/1.19.0/V2.CloudStorageOptions)\n- [1.18.0](/php/docs/reference/cloud-dlp/1.18.0/V2.CloudStorageOptions)\n- [1.17.0](/php/docs/reference/cloud-dlp/1.17.0/V2.CloudStorageOptions)\n- [1.16.0](/php/docs/reference/cloud-dlp/1.16.0/V2.CloudStorageOptions)\n- [1.15.1](/php/docs/reference/cloud-dlp/1.15.1/V2.CloudStorageOptions)\n- [1.14.0](/php/docs/reference/cloud-dlp/1.14.0/V2.CloudStorageOptions)\n- [1.13.2](/php/docs/reference/cloud-dlp/1.13.2/V2.CloudStorageOptions)\n- [1.12.0](/php/docs/reference/cloud-dlp/1.12.0/V2.CloudStorageOptions)\n- [1.11.0](/php/docs/reference/cloud-dlp/1.11.0/V2.CloudStorageOptions)\n- [1.10.2](/php/docs/reference/cloud-dlp/1.10.2/V2.CloudStorageOptions)\n- [1.9.0](/php/docs/reference/cloud-dlp/1.9.0/V2.CloudStorageOptions)\n- [1.8.6](/php/docs/reference/cloud-dlp/1.8.6/V2.CloudStorageOptions) \nReference documentation and code samples for the Data Loss Prevention V2 Client class CloudStorageOptions.\n\nOptions defining a file or a set of files within a Cloud Storage\nbucket.\n\nGenerated from protobuf message `google.privacy.dlp.v2.CloudStorageOptions`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Dlp \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getFileSet\n\nThe set of one or more files to scan.\n\n### hasFileSet\n\n### clearFileSet\n\n### setFileSet\n\nThe set of one or more files to scan.\n\n### getBytesLimitPerFile\n\nMax number of bytes to scan from a file. If a scanned file's size is bigger\nthan this value then the rest of the bytes are omitted. Only one of\n`bytes_limit_per_file` and `bytes_limit_per_file_percent` can be specified.\n\nThis field can't be set if de-identification is requested. For certain file\ntypes, setting this field has no effect. For more information, see [Limits\non bytes scanned per\nfile](https://cloud.google.com/sensitive-data-protection/docs/supported-file-types#max-byte-size-per-file).\n\n### setBytesLimitPerFile\n\nMax number of bytes to scan from a file. If a scanned file's size is bigger\nthan this value then the rest of the bytes are omitted. Only one of\n`bytes_limit_per_file` and `bytes_limit_per_file_percent` can be specified.\n\nThis field can't be set if de-identification is requested. For certain file\ntypes, setting this field has no effect. For more information, see [Limits\non bytes scanned per\nfile](https://cloud.google.com/sensitive-data-protection/docs/supported-file-types#max-byte-size-per-file).\n\n### getBytesLimitPerFilePercent\n\nMax percentage of bytes to scan from a file. The rest are omitted. The\nnumber of bytes scanned is rounded down. Must be between 0 and 100,\ninclusively. Both 0 and 100 means no limit. Defaults to 0. Only one of\nbytes_limit_per_file and bytes_limit_per_file_percent can be specified.\n\nThis field can't be set if de-identification is requested. For certain file\ntypes, setting this field has no effect. For more information, see [Limits\non bytes scanned per\nfile](https://cloud.google.com/sensitive-data-protection/docs/supported-file-types#max-byte-size-per-file).\n\n### setBytesLimitPerFilePercent\n\nMax percentage of bytes to scan from a file. The rest are omitted. The\nnumber of bytes scanned is rounded down. Must be between 0 and 100,\ninclusively. Both 0 and 100 means no limit. Defaults to 0. Only one of\nbytes_limit_per_file and bytes_limit_per_file_percent can be specified.\n\nThis field can't be set if de-identification is requested. For certain file\ntypes, setting this field has no effect. For more information, see [Limits\non bytes scanned per\nfile](https://cloud.google.com/sensitive-data-protection/docs/supported-file-types#max-byte-size-per-file).\n\n### getFileTypes\n\nList of file type groups to include in the scan.\n\nIf empty, all files are scanned and available data format processors\nare applied. In addition, the binary content of the selected files\nis always scanned as well.\nImages are scanned only as binary if the specified region\ndoes not support image inspection and no file_types were specified.\nImage inspection is restricted to 'global', 'us', 'asia', and 'europe'.\n\n### setFileTypes\n\nList of file type groups to include in the scan.\n\nIf empty, all files are scanned and available data format processors\nare applied. In addition, the binary content of the selected files\nis always scanned as well.\nImages are scanned only as binary if the specified region\ndoes not support image inspection and no file_types were specified.\nImage inspection is restricted to 'global', 'us', 'asia', and 'europe'.\n\n### getSampleMethod\n\nHow to sample the data.\n\n### setSampleMethod\n\nHow to sample the data.\n\n### getFilesLimitPercent\n\nLimits the number of files to scan to this percentage of the input FileSet.\n\nNumber of files scanned is rounded down. Must be between 0 and 100,\ninclusively. Both 0 and 100 means no limit. Defaults to 0.\n\n### setFilesLimitPercent\n\nLimits the number of files to scan to this percentage of the input FileSet.\n\nNumber of files scanned is rounded down. Must be between 0 and 100,\ninclusively. Both 0 and 100 means no limit. Defaults to 0."]]