You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

15010 line
580 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package dlp provides access to the Cloud Data Loss Prevention (DLP) API.
  6. //
  7. // This package is DEPRECATED. Use package cloud.google.com/go/dlp/apiv2 instead.
  8. //
  9. // For product documentation, see: https://cloud.google.com/dlp/docs/
  10. //
  11. // Creating a client
  12. //
  13. // Usage example:
  14. //
  15. // import "google.golang.org/api/dlp/v2"
  16. // ...
  17. // ctx := context.Background()
  18. // dlpService, err := dlp.NewService(ctx)
  19. //
  20. // In this example, Google Application Default Credentials are used for authentication.
  21. //
  22. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  23. //
  24. // Other authentication options
  25. //
  26. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  27. //
  28. // dlpService, err := dlp.NewService(ctx, option.WithAPIKey("AIza..."))
  29. //
  30. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  31. //
  32. // config := &oauth2.Config{...}
  33. // // ...
  34. // token, err := config.Exchange(ctx, ...)
  35. // dlpService, err := dlp.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  36. //
  37. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  38. package dlp // import "google.golang.org/api/dlp/v2"
  39. import (
  40. "bytes"
  41. "context"
  42. "encoding/json"
  43. "errors"
  44. "fmt"
  45. "io"
  46. "net/http"
  47. "net/url"
  48. "strconv"
  49. "strings"
  50. gensupport "google.golang.org/api/gensupport"
  51. googleapi "google.golang.org/api/googleapi"
  52. option "google.golang.org/api/option"
  53. htransport "google.golang.org/api/transport/http"
  54. )
  55. // Always reference these packages, just in case the auto-generated code
  56. // below doesn't.
  57. var _ = bytes.NewBuffer
  58. var _ = strconv.Itoa
  59. var _ = fmt.Sprintf
  60. var _ = json.NewDecoder
  61. var _ = io.Copy
  62. var _ = url.Parse
  63. var _ = gensupport.MarshalJSON
  64. var _ = googleapi.Version
  65. var _ = errors.New
  66. var _ = strings.Replace
  67. var _ = context.Canceled
  68. const apiId = "dlp:v2"
  69. const apiName = "dlp"
  70. const apiVersion = "v2"
  71. const basePath = "https://dlp.googleapis.com/"
  72. // OAuth2 scopes used by this API.
  73. const (
  74. // View and manage your data across Google Cloud Platform services
  75. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  76. )
  77. // NewService creates a new Service.
  78. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  79. scopesOption := option.WithScopes(
  80. "https://www.googleapis.com/auth/cloud-platform",
  81. )
  82. // NOTE: prepend, so we don't override user-specified scopes.
  83. opts = append([]option.ClientOption{scopesOption}, opts...)
  84. client, endpoint, err := htransport.NewClient(ctx, opts...)
  85. if err != nil {
  86. return nil, err
  87. }
  88. s, err := New(client)
  89. if err != nil {
  90. return nil, err
  91. }
  92. if endpoint != "" {
  93. s.BasePath = endpoint
  94. }
  95. return s, nil
  96. }
  97. // New creates a new Service. It uses the provided http.Client for requests.
  98. //
  99. // Deprecated: please use NewService instead.
  100. // To provide a custom HTTP client, use option.WithHTTPClient.
  101. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  102. func New(client *http.Client) (*Service, error) {
  103. if client == nil {
  104. return nil, errors.New("client is nil")
  105. }
  106. s := &Service{client: client, BasePath: basePath}
  107. s.InfoTypes = NewInfoTypesService(s)
  108. s.Organizations = NewOrganizationsService(s)
  109. s.Projects = NewProjectsService(s)
  110. return s, nil
  111. }
  112. type Service struct {
  113. client *http.Client
  114. BasePath string // API endpoint base URL
  115. UserAgent string // optional additional User-Agent fragment
  116. InfoTypes *InfoTypesService
  117. Organizations *OrganizationsService
  118. Projects *ProjectsService
  119. }
  120. func (s *Service) userAgent() string {
  121. if s.UserAgent == "" {
  122. return googleapi.UserAgent
  123. }
  124. return googleapi.UserAgent + " " + s.UserAgent
  125. }
  126. func NewInfoTypesService(s *Service) *InfoTypesService {
  127. rs := &InfoTypesService{s: s}
  128. return rs
  129. }
  130. type InfoTypesService struct {
  131. s *Service
  132. }
  133. func NewOrganizationsService(s *Service) *OrganizationsService {
  134. rs := &OrganizationsService{s: s}
  135. rs.DeidentifyTemplates = NewOrganizationsDeidentifyTemplatesService(s)
  136. rs.InspectTemplates = NewOrganizationsInspectTemplatesService(s)
  137. rs.StoredInfoTypes = NewOrganizationsStoredInfoTypesService(s)
  138. return rs
  139. }
  140. type OrganizationsService struct {
  141. s *Service
  142. DeidentifyTemplates *OrganizationsDeidentifyTemplatesService
  143. InspectTemplates *OrganizationsInspectTemplatesService
  144. StoredInfoTypes *OrganizationsStoredInfoTypesService
  145. }
  146. func NewOrganizationsDeidentifyTemplatesService(s *Service) *OrganizationsDeidentifyTemplatesService {
  147. rs := &OrganizationsDeidentifyTemplatesService{s: s}
  148. return rs
  149. }
  150. type OrganizationsDeidentifyTemplatesService struct {
  151. s *Service
  152. }
  153. func NewOrganizationsInspectTemplatesService(s *Service) *OrganizationsInspectTemplatesService {
  154. rs := &OrganizationsInspectTemplatesService{s: s}
  155. return rs
  156. }
  157. type OrganizationsInspectTemplatesService struct {
  158. s *Service
  159. }
  160. func NewOrganizationsStoredInfoTypesService(s *Service) *OrganizationsStoredInfoTypesService {
  161. rs := &OrganizationsStoredInfoTypesService{s: s}
  162. return rs
  163. }
  164. type OrganizationsStoredInfoTypesService struct {
  165. s *Service
  166. }
  167. func NewProjectsService(s *Service) *ProjectsService {
  168. rs := &ProjectsService{s: s}
  169. rs.Content = NewProjectsContentService(s)
  170. rs.DeidentifyTemplates = NewProjectsDeidentifyTemplatesService(s)
  171. rs.DlpJobs = NewProjectsDlpJobsService(s)
  172. rs.Image = NewProjectsImageService(s)
  173. rs.InspectTemplates = NewProjectsInspectTemplatesService(s)
  174. rs.JobTriggers = NewProjectsJobTriggersService(s)
  175. rs.StoredInfoTypes = NewProjectsStoredInfoTypesService(s)
  176. return rs
  177. }
  178. type ProjectsService struct {
  179. s *Service
  180. Content *ProjectsContentService
  181. DeidentifyTemplates *ProjectsDeidentifyTemplatesService
  182. DlpJobs *ProjectsDlpJobsService
  183. Image *ProjectsImageService
  184. InspectTemplates *ProjectsInspectTemplatesService
  185. JobTriggers *ProjectsJobTriggersService
  186. StoredInfoTypes *ProjectsStoredInfoTypesService
  187. }
  188. func NewProjectsContentService(s *Service) *ProjectsContentService {
  189. rs := &ProjectsContentService{s: s}
  190. return rs
  191. }
  192. type ProjectsContentService struct {
  193. s *Service
  194. }
  195. func NewProjectsDeidentifyTemplatesService(s *Service) *ProjectsDeidentifyTemplatesService {
  196. rs := &ProjectsDeidentifyTemplatesService{s: s}
  197. return rs
  198. }
  199. type ProjectsDeidentifyTemplatesService struct {
  200. s *Service
  201. }
  202. func NewProjectsDlpJobsService(s *Service) *ProjectsDlpJobsService {
  203. rs := &ProjectsDlpJobsService{s: s}
  204. return rs
  205. }
  206. type ProjectsDlpJobsService struct {
  207. s *Service
  208. }
  209. func NewProjectsImageService(s *Service) *ProjectsImageService {
  210. rs := &ProjectsImageService{s: s}
  211. return rs
  212. }
  213. type ProjectsImageService struct {
  214. s *Service
  215. }
  216. func NewProjectsInspectTemplatesService(s *Service) *ProjectsInspectTemplatesService {
  217. rs := &ProjectsInspectTemplatesService{s: s}
  218. return rs
  219. }
  220. type ProjectsInspectTemplatesService struct {
  221. s *Service
  222. }
  223. func NewProjectsJobTriggersService(s *Service) *ProjectsJobTriggersService {
  224. rs := &ProjectsJobTriggersService{s: s}
  225. return rs
  226. }
  227. type ProjectsJobTriggersService struct {
  228. s *Service
  229. }
  230. func NewProjectsStoredInfoTypesService(s *Service) *ProjectsStoredInfoTypesService {
  231. rs := &ProjectsStoredInfoTypesService{s: s}
  232. return rs
  233. }
  234. type ProjectsStoredInfoTypesService struct {
  235. s *Service
  236. }
  237. // GooglePrivacyDlpV2Action: A task to execute on the completion of a
  238. // job.
  239. // See https://cloud.google.com/dlp/docs/concepts-actions to learn more.
  240. type GooglePrivacyDlpV2Action struct {
  241. // JobNotificationEmails: Enable email notification to project owners
  242. // and editors on job's
  243. // completion/failure.
  244. JobNotificationEmails *GooglePrivacyDlpV2JobNotificationEmails `json:"jobNotificationEmails,omitempty"`
  245. // PubSub: Publish a notification to a pubsub topic.
  246. PubSub *GooglePrivacyDlpV2PublishToPubSub `json:"pubSub,omitempty"`
  247. // PublishSummaryToCscc: Publish summary to Cloud Security Command
  248. // Center (Alpha).
  249. PublishSummaryToCscc *GooglePrivacyDlpV2PublishSummaryToCscc `json:"publishSummaryToCscc,omitempty"`
  250. // SaveFindings: Save resulting findings in a provided location.
  251. SaveFindings *GooglePrivacyDlpV2SaveFindings `json:"saveFindings,omitempty"`
  252. // ForceSendFields is a list of field names (e.g.
  253. // "JobNotificationEmails") to unconditionally include in API requests.
  254. // By default, fields with empty values are omitted from API requests.
  255. // However, any non-pointer, non-interface field appearing in
  256. // ForceSendFields will be sent to the server regardless of whether the
  257. // field is empty or not. This may be used to include empty fields in
  258. // Patch requests.
  259. ForceSendFields []string `json:"-"`
  260. // NullFields is a list of field names (e.g. "JobNotificationEmails") to
  261. // include in API requests with the JSON null value. By default, fields
  262. // with empty values are omitted from API requests. However, any field
  263. // with an empty value appearing in NullFields will be sent to the
  264. // server as null. It is an error if a field in this list has a
  265. // non-empty value. This may be used to include null fields in Patch
  266. // requests.
  267. NullFields []string `json:"-"`
  268. }
  269. func (s *GooglePrivacyDlpV2Action) MarshalJSON() ([]byte, error) {
  270. type NoMethod GooglePrivacyDlpV2Action
  271. raw := NoMethod(*s)
  272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  273. }
  274. // GooglePrivacyDlpV2ActivateJobTriggerRequest: Request message for
  275. // ActivateJobTrigger.
  276. type GooglePrivacyDlpV2ActivateJobTriggerRequest struct {
  277. }
  278. // GooglePrivacyDlpV2AnalyzeDataSourceRiskDetails: Result of a risk
  279. // analysis operation request.
  280. type GooglePrivacyDlpV2AnalyzeDataSourceRiskDetails struct {
  281. CategoricalStatsResult *GooglePrivacyDlpV2CategoricalStatsResult `json:"categoricalStatsResult,omitempty"`
  282. DeltaPresenceEstimationResult *GooglePrivacyDlpV2DeltaPresenceEstimationResult `json:"deltaPresenceEstimationResult,omitempty"`
  283. KAnonymityResult *GooglePrivacyDlpV2KAnonymityResult `json:"kAnonymityResult,omitempty"`
  284. KMapEstimationResult *GooglePrivacyDlpV2KMapEstimationResult `json:"kMapEstimationResult,omitempty"`
  285. LDiversityResult *GooglePrivacyDlpV2LDiversityResult `json:"lDiversityResult,omitempty"`
  286. NumericalStatsResult *GooglePrivacyDlpV2NumericalStatsResult `json:"numericalStatsResult,omitempty"`
  287. // RequestedPrivacyMetric: Privacy metric to compute.
  288. RequestedPrivacyMetric *GooglePrivacyDlpV2PrivacyMetric `json:"requestedPrivacyMetric,omitempty"`
  289. // RequestedSourceTable: Input dataset to compute metrics over.
  290. RequestedSourceTable *GooglePrivacyDlpV2BigQueryTable `json:"requestedSourceTable,omitempty"`
  291. // ForceSendFields is a list of field names (e.g.
  292. // "CategoricalStatsResult") to unconditionally include in API requests.
  293. // By default, fields with empty values are omitted from API requests.
  294. // However, any non-pointer, non-interface field appearing in
  295. // ForceSendFields will be sent to the server regardless of whether the
  296. // field is empty or not. This may be used to include empty fields in
  297. // Patch requests.
  298. ForceSendFields []string `json:"-"`
  299. // NullFields is a list of field names (e.g. "CategoricalStatsResult")
  300. // to include in API requests with the JSON null value. By default,
  301. // fields with empty values are omitted from API requests. However, any
  302. // field with an empty value appearing in NullFields will be sent to the
  303. // server as null. It is an error if a field in this list has a
  304. // non-empty value. This may be used to include null fields in Patch
  305. // requests.
  306. NullFields []string `json:"-"`
  307. }
  308. func (s *GooglePrivacyDlpV2AnalyzeDataSourceRiskDetails) MarshalJSON() ([]byte, error) {
  309. type NoMethod GooglePrivacyDlpV2AnalyzeDataSourceRiskDetails
  310. raw := NoMethod(*s)
  311. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  312. }
  313. // GooglePrivacyDlpV2AuxiliaryTable: An auxiliary table contains
  314. // statistical information on the relative
  315. // frequency of different quasi-identifiers values. It has one or
  316. // several
  317. // quasi-identifiers columns, and one column that indicates the
  318. // relative
  319. // frequency of each quasi-identifier tuple.
  320. // If a tuple is present in the data but not in the auxiliary table,
  321. // the
  322. // corresponding relative frequency is assumed to be zero (and thus,
  323. // the
  324. // tuple is highly reidentifiable).
  325. type GooglePrivacyDlpV2AuxiliaryTable struct {
  326. // QuasiIds: Quasi-identifier columns. [required]
  327. QuasiIds []*GooglePrivacyDlpV2QuasiIdField `json:"quasiIds,omitempty"`
  328. // RelativeFrequency: The relative frequency column must contain a
  329. // floating-point number
  330. // between 0 and 1 (inclusive). Null values are assumed to be
  331. // zero.
  332. // [required]
  333. RelativeFrequency *GooglePrivacyDlpV2FieldId `json:"relativeFrequency,omitempty"`
  334. // Table: Auxiliary table location. [required]
  335. Table *GooglePrivacyDlpV2BigQueryTable `json:"table,omitempty"`
  336. // ForceSendFields is a list of field names (e.g. "QuasiIds") to
  337. // unconditionally include in API requests. By default, fields with
  338. // empty values are omitted from API requests. However, any non-pointer,
  339. // non-interface field appearing in ForceSendFields will be sent to the
  340. // server regardless of whether the field is empty or not. This may be
  341. // used to include empty fields in Patch requests.
  342. ForceSendFields []string `json:"-"`
  343. // NullFields is a list of field names (e.g. "QuasiIds") to include in
  344. // API requests with the JSON null value. By default, fields with empty
  345. // values are omitted from API requests. However, any field with an
  346. // empty value appearing in NullFields will be sent to the server as
  347. // null. It is an error if a field in this list has a non-empty value.
  348. // This may be used to include null fields in Patch requests.
  349. NullFields []string `json:"-"`
  350. }
  351. func (s *GooglePrivacyDlpV2AuxiliaryTable) MarshalJSON() ([]byte, error) {
  352. type NoMethod GooglePrivacyDlpV2AuxiliaryTable
  353. raw := NoMethod(*s)
  354. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  355. }
  356. // GooglePrivacyDlpV2BigQueryField: Message defining a field of a
  357. // BigQuery table.
  358. type GooglePrivacyDlpV2BigQueryField struct {
  359. // Field: Designated field in the BigQuery table.
  360. Field *GooglePrivacyDlpV2FieldId `json:"field,omitempty"`
  361. // Table: Source table of the field.
  362. Table *GooglePrivacyDlpV2BigQueryTable `json:"table,omitempty"`
  363. // ForceSendFields is a list of field names (e.g. "Field") to
  364. // unconditionally include in API requests. By default, fields with
  365. // empty values are omitted from API requests. However, any non-pointer,
  366. // non-interface field appearing in ForceSendFields will be sent to the
  367. // server regardless of whether the field is empty or not. This may be
  368. // used to include empty fields in Patch requests.
  369. ForceSendFields []string `json:"-"`
  370. // NullFields is a list of field names (e.g. "Field") to include in API
  371. // requests with the JSON null value. By default, fields with empty
  372. // values are omitted from API requests. However, any field with an
  373. // empty value appearing in NullFields will be sent to the server as
  374. // null. It is an error if a field in this list has a non-empty value.
  375. // This may be used to include null fields in Patch requests.
  376. NullFields []string `json:"-"`
  377. }
  378. func (s *GooglePrivacyDlpV2BigQueryField) MarshalJSON() ([]byte, error) {
  379. type NoMethod GooglePrivacyDlpV2BigQueryField
  380. raw := NoMethod(*s)
  381. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  382. }
  383. // GooglePrivacyDlpV2BigQueryKey: Row key for identifying a record in
  384. // BigQuery table.
  385. type GooglePrivacyDlpV2BigQueryKey struct {
  386. // RowNumber: Absolute number of the row from the beginning of the table
  387. // at the time
  388. // of scanning.
  389. RowNumber int64 `json:"rowNumber,omitempty,string"`
  390. // TableReference: Complete BigQuery table reference.
  391. TableReference *GooglePrivacyDlpV2BigQueryTable `json:"tableReference,omitempty"`
  392. // ForceSendFields is a list of field names (e.g. "RowNumber") to
  393. // unconditionally include in API requests. By default, fields with
  394. // empty values are omitted from API requests. However, any non-pointer,
  395. // non-interface field appearing in ForceSendFields will be sent to the
  396. // server regardless of whether the field is empty or not. This may be
  397. // used to include empty fields in Patch requests.
  398. ForceSendFields []string `json:"-"`
  399. // NullFields is a list of field names (e.g. "RowNumber") to include in
  400. // API requests with the JSON null value. By default, fields with empty
  401. // values are omitted from API requests. However, any field with an
  402. // empty value appearing in NullFields will be sent to the server as
  403. // null. It is an error if a field in this list has a non-empty value.
  404. // This may be used to include null fields in Patch requests.
  405. NullFields []string `json:"-"`
  406. }
  407. func (s *GooglePrivacyDlpV2BigQueryKey) MarshalJSON() ([]byte, error) {
  408. type NoMethod GooglePrivacyDlpV2BigQueryKey
  409. raw := NoMethod(*s)
  410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  411. }
  412. // GooglePrivacyDlpV2BigQueryOptions: Options defining BigQuery table
  413. // and row identifiers.
  414. type GooglePrivacyDlpV2BigQueryOptions struct {
  415. // ExcludedFields: References to fields excluded from scanning. This
  416. // allows you to skip
  417. // inspection of entire columns which you know have no findings.
  418. ExcludedFields []*GooglePrivacyDlpV2FieldId `json:"excludedFields,omitempty"`
  419. // IdentifyingFields: References to fields uniquely identifying rows
  420. // within the table.
  421. // Nested fields in the format, like `person.birthdate.year`, are
  422. // allowed.
  423. IdentifyingFields []*GooglePrivacyDlpV2FieldId `json:"identifyingFields,omitempty"`
  424. // RowsLimit: Max number of rows to scan. If the table has more rows
  425. // than this value, the
  426. // rest of the rows are omitted. If not set, or if set to 0, all rows
  427. // will be
  428. // scanned. Only one of rows_limit and rows_limit_percent can be
  429. // specified.
  430. // Cannot be used in conjunction with TimespanConfig.
  431. RowsLimit int64 `json:"rowsLimit,omitempty,string"`
  432. // RowsLimitPercent: Max percentage of rows to scan. The rest are
  433. // omitted. The number of rows
  434. // scanned is rounded down. Must be between 0 and 100, inclusively. Both
  435. // 0 and
  436. // 100 means no limit. Defaults to 0. Only one of rows_limit
  437. // and
  438. // rows_limit_percent can be specified. Cannot be used in conjunction
  439. // with
  440. // TimespanConfig.
  441. RowsLimitPercent int64 `json:"rowsLimitPercent,omitempty"`
  442. // Possible values:
  443. // "SAMPLE_METHOD_UNSPECIFIED"
  444. // "TOP" - Scan from the top (default).
  445. // "RANDOM_START" - Randomly pick the row to start scanning. The
  446. // scanned rows are contiguous.
  447. SampleMethod string `json:"sampleMethod,omitempty"`
  448. // TableReference: Complete BigQuery table reference.
  449. TableReference *GooglePrivacyDlpV2BigQueryTable `json:"tableReference,omitempty"`
  450. // ForceSendFields is a list of field names (e.g. "ExcludedFields") to
  451. // unconditionally include in API requests. By default, fields with
  452. // empty values are omitted from API requests. However, any non-pointer,
  453. // non-interface field appearing in ForceSendFields will be sent to the
  454. // server regardless of whether the field is empty or not. This may be
  455. // used to include empty fields in Patch requests.
  456. ForceSendFields []string `json:"-"`
  457. // NullFields is a list of field names (e.g. "ExcludedFields") to
  458. // include in API requests with the JSON null value. By default, fields
  459. // with empty values are omitted from API requests. However, any field
  460. // with an empty value appearing in NullFields will be sent to the
  461. // server as null. It is an error if a field in this list has a
  462. // non-empty value. This may be used to include null fields in Patch
  463. // requests.
  464. NullFields []string `json:"-"`
  465. }
  466. func (s *GooglePrivacyDlpV2BigQueryOptions) MarshalJSON() ([]byte, error) {
  467. type NoMethod GooglePrivacyDlpV2BigQueryOptions
  468. raw := NoMethod(*s)
  469. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  470. }
  471. // GooglePrivacyDlpV2BigQueryTable: Message defining the location of a
  472. // BigQuery table. A table is uniquely
  473. // identified by its project_id, dataset_id, and table_name. Within a
  474. // query
  475. // a table is often referenced with a string in the format
  476. // of:
  477. // `<project_id>:<dataset_id>.<table_id>`
  478. // or
  479. // `<project_id>.<dataset_id>.<table_id>`.
  480. type GooglePrivacyDlpV2BigQueryTable struct {
  481. // DatasetId: Dataset ID of the table.
  482. DatasetId string `json:"datasetId,omitempty"`
  483. // ProjectId: The Google Cloud Platform project ID of the project
  484. // containing the table.
  485. // If omitted, project ID is inferred from the API call.
  486. ProjectId string `json:"projectId,omitempty"`
  487. // TableId: Name of the table.
  488. TableId string `json:"tableId,omitempty"`
  489. // ForceSendFields is a list of field names (e.g. "DatasetId") to
  490. // unconditionally include in API requests. By default, fields with
  491. // empty values are omitted from API requests. However, any non-pointer,
  492. // non-interface field appearing in ForceSendFields will be sent to the
  493. // server regardless of whether the field is empty or not. This may be
  494. // used to include empty fields in Patch requests.
  495. ForceSendFields []string `json:"-"`
  496. // NullFields is a list of field names (e.g. "DatasetId") to include in
  497. // API requests with the JSON null value. By default, fields with empty
  498. // values are omitted from API requests. However, any field with an
  499. // empty value appearing in NullFields will be sent to the server as
  500. // null. It is an error if a field in this list has a non-empty value.
  501. // This may be used to include null fields in Patch requests.
  502. NullFields []string `json:"-"`
  503. }
  504. func (s *GooglePrivacyDlpV2BigQueryTable) MarshalJSON() ([]byte, error) {
  505. type NoMethod GooglePrivacyDlpV2BigQueryTable
  506. raw := NoMethod(*s)
  507. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  508. }
  509. // GooglePrivacyDlpV2BoundingBox: Bounding box encompassing detected
  510. // text within an image.
  511. type GooglePrivacyDlpV2BoundingBox struct {
  512. // Height: Height of the bounding box in pixels.
  513. Height int64 `json:"height,omitempty"`
  514. // Left: Left coordinate of the bounding box. (0,0) is upper left.
  515. Left int64 `json:"left,omitempty"`
  516. // Top: Top coordinate of the bounding box. (0,0) is upper left.
  517. Top int64 `json:"top,omitempty"`
  518. // Width: Width of the bounding box in pixels.
  519. Width int64 `json:"width,omitempty"`
  520. // ForceSendFields is a list of field names (e.g. "Height") to
  521. // unconditionally include in API requests. By default, fields with
  522. // empty values are omitted from API requests. However, any non-pointer,
  523. // non-interface field appearing in ForceSendFields will be sent to the
  524. // server regardless of whether the field is empty or not. This may be
  525. // used to include empty fields in Patch requests.
  526. ForceSendFields []string `json:"-"`
  527. // NullFields is a list of field names (e.g. "Height") to include in API
  528. // requests with the JSON null value. By default, fields with empty
  529. // values are omitted from API requests. However, any field with an
  530. // empty value appearing in NullFields will be sent to the server as
  531. // null. It is an error if a field in this list has a non-empty value.
  532. // This may be used to include null fields in Patch requests.
  533. NullFields []string `json:"-"`
  534. }
  535. func (s *GooglePrivacyDlpV2BoundingBox) MarshalJSON() ([]byte, error) {
  536. type NoMethod GooglePrivacyDlpV2BoundingBox
  537. raw := NoMethod(*s)
  538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  539. }
  540. // GooglePrivacyDlpV2Bucket: Bucket is represented as a range, along
  541. // with replacement values.
  542. type GooglePrivacyDlpV2Bucket struct {
  543. // Max: Upper bound of the range, exclusive; type must match min.
  544. Max *GooglePrivacyDlpV2Value `json:"max,omitempty"`
  545. // Min: Lower bound of the range, inclusive. Type should be the same as
  546. // max if
  547. // used.
  548. Min *GooglePrivacyDlpV2Value `json:"min,omitempty"`
  549. // ReplacementValue: Replacement value for this bucket. If not
  550. // provided
  551. // the default behavior will be to hyphenate the min-max range.
  552. ReplacementValue *GooglePrivacyDlpV2Value `json:"replacementValue,omitempty"`
  553. // ForceSendFields is a list of field names (e.g. "Max") to
  554. // unconditionally include in API requests. By default, fields with
  555. // empty values are omitted from API requests. However, any non-pointer,
  556. // non-interface field appearing in ForceSendFields will be sent to the
  557. // server regardless of whether the field is empty or not. This may be
  558. // used to include empty fields in Patch requests.
  559. ForceSendFields []string `json:"-"`
  560. // NullFields is a list of field names (e.g. "Max") to include in API
  561. // requests with the JSON null value. By default, fields with empty
  562. // values are omitted from API requests. However, any field with an
  563. // empty value appearing in NullFields will be sent to the server as
  564. // null. It is an error if a field in this list has a non-empty value.
  565. // This may be used to include null fields in Patch requests.
  566. NullFields []string `json:"-"`
  567. }
  568. func (s *GooglePrivacyDlpV2Bucket) MarshalJSON() ([]byte, error) {
  569. type NoMethod GooglePrivacyDlpV2Bucket
  570. raw := NoMethod(*s)
  571. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  572. }
  573. // GooglePrivacyDlpV2BucketingConfig: Generalization function that
  574. // buckets values based on ranges. The ranges and
  575. // replacement values are dynamically provided by the user for custom
  576. // behavior,
  577. // such as 1-30 -> LOW 31-65 -> MEDIUM 66-100 -> HIGH
  578. // This can be used on
  579. // data of type: number, long, string, timestamp.
  580. // If the bound `Value` type differs from the type of data being
  581. // transformed, we
  582. // will first attempt converting the type of the data to be transformed
  583. // to match
  584. // the type of the bound before comparing.
  585. // See https://cloud.google.com/dlp/docs/concepts-bucketing to learn
  586. // more.
  587. type GooglePrivacyDlpV2BucketingConfig struct {
  588. // Buckets: Set of buckets. Ranges must be non-overlapping.
  589. Buckets []*GooglePrivacyDlpV2Bucket `json:"buckets,omitempty"`
  590. // ForceSendFields is a list of field names (e.g. "Buckets") to
  591. // unconditionally include in API requests. By default, fields with
  592. // empty values are omitted from API requests. However, any non-pointer,
  593. // non-interface field appearing in ForceSendFields will be sent to the
  594. // server regardless of whether the field is empty or not. This may be
  595. // used to include empty fields in Patch requests.
  596. ForceSendFields []string `json:"-"`
  597. // NullFields is a list of field names (e.g. "Buckets") to include in
  598. // API requests with the JSON null value. By default, fields with empty
  599. // values are omitted from API requests. However, any field with an
  600. // empty value appearing in NullFields will be sent to the server as
  601. // null. It is an error if a field in this list has a non-empty value.
  602. // This may be used to include null fields in Patch requests.
  603. NullFields []string `json:"-"`
  604. }
  605. func (s *GooglePrivacyDlpV2BucketingConfig) MarshalJSON() ([]byte, error) {
  606. type NoMethod GooglePrivacyDlpV2BucketingConfig
  607. raw := NoMethod(*s)
  608. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  609. }
  610. // GooglePrivacyDlpV2ByteContentItem: Container for bytes to inspect or
  611. // redact.
  612. type GooglePrivacyDlpV2ByteContentItem struct {
  613. // Data: Content data to inspect or redact.
  614. Data string `json:"data,omitempty"`
  615. // Type: The type of data stored in the bytes string. Default will be
  616. // TEXT_UTF8.
  617. //
  618. // Possible values:
  619. // "BYTES_TYPE_UNSPECIFIED"
  620. // "IMAGE"
  621. // "IMAGE_JPEG"
  622. // "IMAGE_BMP"
  623. // "IMAGE_PNG"
  624. // "IMAGE_SVG"
  625. // "TEXT_UTF8"
  626. Type string `json:"type,omitempty"`
  627. // ForceSendFields is a list of field names (e.g. "Data") to
  628. // unconditionally include in API requests. By default, fields with
  629. // empty values are omitted from API requests. However, any non-pointer,
  630. // non-interface field appearing in ForceSendFields will be sent to the
  631. // server regardless of whether the field is empty or not. This may be
  632. // used to include empty fields in Patch requests.
  633. ForceSendFields []string `json:"-"`
  634. // NullFields is a list of field names (e.g. "Data") to include in API
  635. // requests with the JSON null value. By default, fields with empty
  636. // values are omitted from API requests. However, any field with an
  637. // empty value appearing in NullFields will be sent to the server as
  638. // null. It is an error if a field in this list has a non-empty value.
  639. // This may be used to include null fields in Patch requests.
  640. NullFields []string `json:"-"`
  641. }
  642. func (s *GooglePrivacyDlpV2ByteContentItem) MarshalJSON() ([]byte, error) {
  643. type NoMethod GooglePrivacyDlpV2ByteContentItem
  644. raw := NoMethod(*s)
  645. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  646. }
  647. // GooglePrivacyDlpV2CancelDlpJobRequest: The request message for
  648. // canceling a DLP job.
  649. type GooglePrivacyDlpV2CancelDlpJobRequest struct {
  650. }
  651. // GooglePrivacyDlpV2CategoricalStatsConfig: Compute numerical stats
  652. // over an individual column, including
  653. // number of distinct values and value count distribution.
  654. type GooglePrivacyDlpV2CategoricalStatsConfig struct {
  655. // Field: Field to compute categorical stats on. All column types
  656. // are
  657. // supported except for arrays and structs. However, it may be
  658. // more
  659. // informative to use NumericalStats when the field type is
  660. // supported,
  661. // depending on the data.
  662. Field *GooglePrivacyDlpV2FieldId `json:"field,omitempty"`
  663. // ForceSendFields is a list of field names (e.g. "Field") to
  664. // unconditionally include in API requests. By default, fields with
  665. // empty values are omitted from API requests. However, any non-pointer,
  666. // non-interface field appearing in ForceSendFields will be sent to the
  667. // server regardless of whether the field is empty or not. This may be
  668. // used to include empty fields in Patch requests.
  669. ForceSendFields []string `json:"-"`
  670. // NullFields is a list of field names (e.g. "Field") to include in API
  671. // requests with the JSON null value. By default, fields with empty
  672. // values are omitted from API requests. However, any field with an
  673. // empty value appearing in NullFields will be sent to the server as
  674. // null. It is an error if a field in this list has a non-empty value.
  675. // This may be used to include null fields in Patch requests.
  676. NullFields []string `json:"-"`
  677. }
  678. func (s *GooglePrivacyDlpV2CategoricalStatsConfig) MarshalJSON() ([]byte, error) {
  679. type NoMethod GooglePrivacyDlpV2CategoricalStatsConfig
  680. raw := NoMethod(*s)
  681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  682. }
  683. type GooglePrivacyDlpV2CategoricalStatsHistogramBucket struct {
  684. // BucketSize: Total number of values in this bucket.
  685. BucketSize int64 `json:"bucketSize,omitempty,string"`
  686. // BucketValueCount: Total number of distinct values in this bucket.
  687. BucketValueCount int64 `json:"bucketValueCount,omitempty,string"`
  688. // BucketValues: Sample of value frequencies in this bucket. The total
  689. // number of
  690. // values returned per bucket is capped at 20.
  691. BucketValues []*GooglePrivacyDlpV2ValueFrequency `json:"bucketValues,omitempty"`
  692. // ValueFrequencyLowerBound: Lower bound on the value frequency of the
  693. // values in this bucket.
  694. ValueFrequencyLowerBound int64 `json:"valueFrequencyLowerBound,omitempty,string"`
  695. // ValueFrequencyUpperBound: Upper bound on the value frequency of the
  696. // values in this bucket.
  697. ValueFrequencyUpperBound int64 `json:"valueFrequencyUpperBound,omitempty,string"`
  698. // ForceSendFields is a list of field names (e.g. "BucketSize") to
  699. // unconditionally include in API requests. By default, fields with
  700. // empty values are omitted from API requests. However, any non-pointer,
  701. // non-interface field appearing in ForceSendFields will be sent to the
  702. // server regardless of whether the field is empty or not. This may be
  703. // used to include empty fields in Patch requests.
  704. ForceSendFields []string `json:"-"`
  705. // NullFields is a list of field names (e.g. "BucketSize") to include in
  706. // API requests with the JSON null value. By default, fields with empty
  707. // values are omitted from API requests. However, any field with an
  708. // empty value appearing in NullFields will be sent to the server as
  709. // null. It is an error if a field in this list has a non-empty value.
  710. // This may be used to include null fields in Patch requests.
  711. NullFields []string `json:"-"`
  712. }
  713. func (s *GooglePrivacyDlpV2CategoricalStatsHistogramBucket) MarshalJSON() ([]byte, error) {
  714. type NoMethod GooglePrivacyDlpV2CategoricalStatsHistogramBucket
  715. raw := NoMethod(*s)
  716. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  717. }
  718. // GooglePrivacyDlpV2CategoricalStatsResult: Result of the categorical
  719. // stats computation.
  720. type GooglePrivacyDlpV2CategoricalStatsResult struct {
  721. // ValueFrequencyHistogramBuckets: Histogram of value frequencies in the
  722. // column.
  723. ValueFrequencyHistogramBuckets []*GooglePrivacyDlpV2CategoricalStatsHistogramBucket `json:"valueFrequencyHistogramBuckets,omitempty"`
  724. // ForceSendFields is a list of field names (e.g.
  725. // "ValueFrequencyHistogramBuckets") to unconditionally include in API
  726. // requests. By default, fields with empty values are omitted from API
  727. // requests. However, any non-pointer, non-interface field appearing in
  728. // ForceSendFields will be sent to the server regardless of whether the
  729. // field is empty or not. This may be used to include empty fields in
  730. // Patch requests.
  731. ForceSendFields []string `json:"-"`
  732. // NullFields is a list of field names (e.g.
  733. // "ValueFrequencyHistogramBuckets") to include in API requests with the
  734. // JSON null value. By default, fields with empty values are omitted
  735. // from API requests. However, any field with an empty value appearing
  736. // in NullFields will be sent to the server as null. It is an error if a
  737. // field in this list has a non-empty value. This may be used to include
  738. // null fields in Patch requests.
  739. NullFields []string `json:"-"`
  740. }
  741. func (s *GooglePrivacyDlpV2CategoricalStatsResult) MarshalJSON() ([]byte, error) {
  742. type NoMethod GooglePrivacyDlpV2CategoricalStatsResult
  743. raw := NoMethod(*s)
  744. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  745. }
  746. // GooglePrivacyDlpV2CharacterMaskConfig: Partially mask a string by
  747. // replacing a given number of characters with a
  748. // fixed character. Masking can start from the beginning or end of the
  749. // string.
  750. // This can be used on data of any type (numbers, longs, and so on) and
  751. // when
  752. // de-identifying structured data we'll attempt to preserve the original
  753. // data's
  754. // type. (This allows you to take a long like 123 and modify it to a
  755. // string like
  756. // **3.
  757. type GooglePrivacyDlpV2CharacterMaskConfig struct {
  758. // CharactersToIgnore: When masking a string, items in this list will be
  759. // skipped when replacing.
  760. // For example, if your string is 555-555-5555 and you ask us to skip
  761. // `-` and
  762. // mask 5 chars with * we would produce ***-*55-5555.
  763. CharactersToIgnore []*GooglePrivacyDlpV2CharsToIgnore `json:"charactersToIgnore,omitempty"`
  764. // MaskingCharacter: Character to mask the sensitive values&mdash;for
  765. // example, "*" for an
  766. // alphabetic string such as name, or "0" for a numeric string such as
  767. // ZIP
  768. // code or credit card number. String must have length 1. If not
  769. // supplied, we
  770. // will default to "*" for strings, 0 for digits.
  771. MaskingCharacter string `json:"maskingCharacter,omitempty"`
  772. // NumberToMask: Number of characters to mask. If not set, all matching
  773. // chars will be
  774. // masked. Skipped characters do not count towards this tally.
  775. NumberToMask int64 `json:"numberToMask,omitempty"`
  776. // ReverseOrder: Mask characters in reverse order. For example, if
  777. // `masking_character` is
  778. // '0', number_to_mask is 14, and `reverse_order` is false,
  779. // then
  780. // 1234-5678-9012-3456 -> 00000000000000-3456
  781. // If `masking_character` is '*', `number_to_mask` is 3, and
  782. // `reverse_order`
  783. // is true, then 12345 -> 12***
  784. ReverseOrder bool `json:"reverseOrder,omitempty"`
  785. // ForceSendFields is a list of field names (e.g. "CharactersToIgnore")
  786. // to unconditionally include in API requests. By default, fields with
  787. // empty values are omitted from API requests. However, any non-pointer,
  788. // non-interface field appearing in ForceSendFields will be sent to the
  789. // server regardless of whether the field is empty or not. This may be
  790. // used to include empty fields in Patch requests.
  791. ForceSendFields []string `json:"-"`
  792. // NullFields is a list of field names (e.g. "CharactersToIgnore") to
  793. // include in API requests with the JSON null value. By default, fields
  794. // with empty values are omitted from API requests. However, any field
  795. // with an empty value appearing in NullFields will be sent to the
  796. // server as null. It is an error if a field in this list has a
  797. // non-empty value. This may be used to include null fields in Patch
  798. // requests.
  799. NullFields []string `json:"-"`
  800. }
  801. func (s *GooglePrivacyDlpV2CharacterMaskConfig) MarshalJSON() ([]byte, error) {
  802. type NoMethod GooglePrivacyDlpV2CharacterMaskConfig
  803. raw := NoMethod(*s)
  804. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  805. }
  806. // GooglePrivacyDlpV2CharsToIgnore: Characters to skip when doing
  807. // deidentification of a value. These will be left
  808. // alone and skipped.
  809. type GooglePrivacyDlpV2CharsToIgnore struct {
  810. CharactersToSkip string `json:"charactersToSkip,omitempty"`
  811. // Possible values:
  812. // "COMMON_CHARS_TO_IGNORE_UNSPECIFIED"
  813. // "NUMERIC" - 0-9
  814. // "ALPHA_UPPER_CASE" - A-Z
  815. // "ALPHA_LOWER_CASE" - a-z
  816. // "PUNCTUATION" - US Punctuation, one of
  817. // !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
  818. // "WHITESPACE" - Whitespace character, one of [ \t\n\x0B\f\r]
  819. CommonCharactersToIgnore string `json:"commonCharactersToIgnore,omitempty"`
  820. // ForceSendFields is a list of field names (e.g. "CharactersToSkip") to
  821. // unconditionally include in API requests. By default, fields with
  822. // empty values are omitted from API requests. However, any non-pointer,
  823. // non-interface field appearing in ForceSendFields will be sent to the
  824. // server regardless of whether the field is empty or not. This may be
  825. // used to include empty fields in Patch requests.
  826. ForceSendFields []string `json:"-"`
  827. // NullFields is a list of field names (e.g. "CharactersToSkip") to
  828. // include in API requests with the JSON null value. By default, fields
  829. // with empty values are omitted from API requests. However, any field
  830. // with an empty value appearing in NullFields will be sent to the
  831. // server as null. It is an error if a field in this list has a
  832. // non-empty value. This may be used to include null fields in Patch
  833. // requests.
  834. NullFields []string `json:"-"`
  835. }
  836. func (s *GooglePrivacyDlpV2CharsToIgnore) MarshalJSON() ([]byte, error) {
  837. type NoMethod GooglePrivacyDlpV2CharsToIgnore
  838. raw := NoMethod(*s)
  839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  840. }
  841. // GooglePrivacyDlpV2CloudStorageFileSet: Message representing a set of
  842. // files in Cloud Storage.
  843. type GooglePrivacyDlpV2CloudStorageFileSet struct {
  844. // Url: The url, in the format `gs://<bucket>/<path>`. Trailing wildcard
  845. // in the
  846. // path is allowed.
  847. Url string `json:"url,omitempty"`
  848. // ForceSendFields is a list of field names (e.g. "Url") to
  849. // unconditionally include in API requests. By default, fields with
  850. // empty values are omitted from API requests. However, any non-pointer,
  851. // non-interface field appearing in ForceSendFields will be sent to the
  852. // server regardless of whether the field is empty or not. This may be
  853. // used to include empty fields in Patch requests.
  854. ForceSendFields []string `json:"-"`
  855. // NullFields is a list of field names (e.g. "Url") to include in API
  856. // requests with the JSON null value. By default, fields with empty
  857. // values are omitted from API requests. However, any field with an
  858. // empty value appearing in NullFields will be sent to the server as
  859. // null. It is an error if a field in this list has a non-empty value.
  860. // This may be used to include null fields in Patch requests.
  861. NullFields []string `json:"-"`
  862. }
  863. func (s *GooglePrivacyDlpV2CloudStorageFileSet) MarshalJSON() ([]byte, error) {
  864. type NoMethod GooglePrivacyDlpV2CloudStorageFileSet
  865. raw := NoMethod(*s)
  866. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  867. }
  868. // GooglePrivacyDlpV2CloudStorageOptions: Options defining a file or a
  869. // set of files within a Google Cloud Storage
  870. // bucket.
  871. type GooglePrivacyDlpV2CloudStorageOptions struct {
  872. // BytesLimitPerFile: Max number of bytes to scan from a file. If a
  873. // scanned file's size is bigger
  874. // than this value then the rest of the bytes are omitted. Only one
  875. // of bytes_limit_per_file and bytes_limit_per_file_percent can be
  876. // specified.
  877. BytesLimitPerFile int64 `json:"bytesLimitPerFile,omitempty,string"`
  878. // BytesLimitPerFilePercent: Max percentage of bytes to scan from a
  879. // file. The rest are omitted. The
  880. // number of bytes scanned is rounded down. Must be between 0 and
  881. // 100,
  882. // inclusively. Both 0 and 100 means no limit. Defaults to 0. Only
  883. // one
  884. // of bytes_limit_per_file and bytes_limit_per_file_percent can be
  885. // specified.
  886. BytesLimitPerFilePercent int64 `json:"bytesLimitPerFilePercent,omitempty"`
  887. // FileSet: The set of one or more files to scan.
  888. FileSet *GooglePrivacyDlpV2FileSet `json:"fileSet,omitempty"`
  889. // FileTypes: List of file type groups to include in the scan.
  890. // If empty, all files are scanned and available data format
  891. // processors
  892. // are applied. In addition, the binary content of the selected files
  893. // is always scanned as well.
  894. //
  895. // Possible values:
  896. // "FILE_TYPE_UNSPECIFIED" - Includes all files.
  897. // "BINARY_FILE" - Includes all file extensions not covered by text
  898. // file types.
  899. // "TEXT_FILE" - Included file extensions:
  900. // asc, brf, c, cc, cpp, csv, cxx, c++, cs, css, dart, eml, go, h, hh,
  901. // hpp,
  902. // hxx, h++, hs, html, htm, shtml, shtm, xhtml, lhs, ini, java, js,
  903. // json,
  904. // ocaml, md, mkd, markdown, m, ml, mli, pl, pm, php, phtml, pht, py,
  905. // pyw,
  906. // rb, rbw, rs, rc, scala, sh, sql, tex, txt, text, tsv, vcard, vcs,
  907. // wml,
  908. // xml, xsl, xsd, yml, yaml.
  909. // "IMAGE" - Included file extensions:
  910. // bmp, gif, jpg, jpeg, jpe, png.
  911. // bytes_limit_per_file has no effect on image files.
  912. FileTypes []string `json:"fileTypes,omitempty"`
  913. // FilesLimitPercent: Limits the number of files to scan to this
  914. // percentage of the input FileSet.
  915. // Number of files scanned is rounded down. Must be between 0 and
  916. // 100,
  917. // inclusively. Both 0 and 100 means no limit. Defaults to 0.
  918. FilesLimitPercent int64 `json:"filesLimitPercent,omitempty"`
  919. // Possible values:
  920. // "SAMPLE_METHOD_UNSPECIFIED"
  921. // "TOP" - Scan from the top (default).
  922. // "RANDOM_START" - For each file larger than bytes_limit_per_file,
  923. // randomly pick the offset
  924. // to start scanning. The scanned bytes are contiguous.
  925. SampleMethod string `json:"sampleMethod,omitempty"`
  926. // ForceSendFields is a list of field names (e.g. "BytesLimitPerFile")
  927. // to unconditionally include in API requests. By default, fields with
  928. // empty values are omitted from API requests. However, any non-pointer,
  929. // non-interface field appearing in ForceSendFields will be sent to the
  930. // server regardless of whether the field is empty or not. This may be
  931. // used to include empty fields in Patch requests.
  932. ForceSendFields []string `json:"-"`
  933. // NullFields is a list of field names (e.g. "BytesLimitPerFile") to
  934. // include in API requests with the JSON null value. By default, fields
  935. // with empty values are omitted from API requests. However, any field
  936. // with an empty value appearing in NullFields will be sent to the
  937. // server as null. It is an error if a field in this list has a
  938. // non-empty value. This may be used to include null fields in Patch
  939. // requests.
  940. NullFields []string `json:"-"`
  941. }
  942. func (s *GooglePrivacyDlpV2CloudStorageOptions) MarshalJSON() ([]byte, error) {
  943. type NoMethod GooglePrivacyDlpV2CloudStorageOptions
  944. raw := NoMethod(*s)
  945. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  946. }
  947. // GooglePrivacyDlpV2CloudStoragePath: Message representing a single
  948. // file or path in Cloud Storage.
  949. type GooglePrivacyDlpV2CloudStoragePath struct {
  950. // Path: A url representing a file or path (no wildcards) in Cloud
  951. // Storage.
  952. // Example: gs://[BUCKET_NAME]/dictionary.txt
  953. Path string `json:"path,omitempty"`
  954. // ForceSendFields is a list of field names (e.g. "Path") to
  955. // unconditionally include in API requests. By default, fields with
  956. // empty values are omitted from API requests. However, any non-pointer,
  957. // non-interface field appearing in ForceSendFields will be sent to the
  958. // server regardless of whether the field is empty or not. This may be
  959. // used to include empty fields in Patch requests.
  960. ForceSendFields []string `json:"-"`
  961. // NullFields is a list of field names (e.g. "Path") to include in API
  962. // requests with the JSON null value. By default, fields with empty
  963. // values are omitted from API requests. However, any field with an
  964. // empty value appearing in NullFields will be sent to the server as
  965. // null. It is an error if a field in this list has a non-empty value.
  966. // This may be used to include null fields in Patch requests.
  967. NullFields []string `json:"-"`
  968. }
  969. func (s *GooglePrivacyDlpV2CloudStoragePath) MarshalJSON() ([]byte, error) {
  970. type NoMethod GooglePrivacyDlpV2CloudStoragePath
  971. raw := NoMethod(*s)
  972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  973. }
  974. // GooglePrivacyDlpV2CloudStorageRegexFileSet: Message representing a
  975. // set of files in a Cloud Storage bucket. Regular
  976. // expressions are used to allow fine-grained control over which files
  977. // in the
  978. // bucket to include.
  979. //
  980. // Included files are those that match at least one item in
  981. // `include_regex` and
  982. // do not match any items in `exclude_regex`. Note that a file that
  983. // matches
  984. // items from both lists will _not_ be included. For a match to occur,
  985. // the
  986. // entire file path (i.e., everything in the url after the bucket name)
  987. // must
  988. // match the regular expression.
  989. //
  990. // For example, given the input `{bucket_name: "mybucket",
  991. // include_regex:
  992. // ["directory1/.*"], exclude_regex:
  993. // ["directory1/excluded.*"]}`:
  994. //
  995. // * `gs://mybucket/directory1/myfile` will be included
  996. // * `gs://mybucket/directory1/directory2/myfile` will be included (`.*`
  997. // matches
  998. // across `/`)
  999. // * `gs://mybucket/directory0/directory1/myfile` will _not_ be included
  1000. // (the
  1001. // full path doesn't match any items in `include_regex`)
  1002. // * `gs://mybucket/directory1/excludedfile` will _not_ be included (the
  1003. // path
  1004. // matches an item in `exclude_regex`)
  1005. //
  1006. // If `include_regex` is left empty, it will match all files by
  1007. // default
  1008. // (this is equivalent to setting `include_regex: [".*"]`).
  1009. //
  1010. // Some other common use cases:
  1011. //
  1012. // * `{bucket_name: "mybucket", exclude_regex: [".*\.pdf"]}` will
  1013. // include all
  1014. // files in `mybucket` except for .pdf files
  1015. // * `{bucket_name: "mybucket", include_regex: ["directory/[^/]+"]}`
  1016. // will
  1017. // include all files directly under `gs://mybucket/directory/`, without
  1018. // matching
  1019. // across `/`
  1020. type GooglePrivacyDlpV2CloudStorageRegexFileSet struct {
  1021. // BucketName: The name of a Cloud Storage bucket. Required.
  1022. BucketName string `json:"bucketName,omitempty"`
  1023. // ExcludeRegex: A list of regular expressions matching file paths to
  1024. // exclude. All files in
  1025. // the bucket that match at least one of these regular expressions will
  1026. // be
  1027. // excluded from the scan.
  1028. //
  1029. // Regular expressions use
  1030. // RE2
  1031. // [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be
  1032. // found
  1033. // under the google/re2 repository on GitHub.
  1034. ExcludeRegex []string `json:"excludeRegex,omitempty"`
  1035. // IncludeRegex: A list of regular expressions matching file paths to
  1036. // include. All files in
  1037. // the bucket that match at least one of these regular expressions will
  1038. // be
  1039. // included in the set of files, except for those that also match an
  1040. // item in
  1041. // `exclude_regex`. Leaving this field empty will match all files by
  1042. // default
  1043. // (this is equivalent to including `.*` in the list).
  1044. //
  1045. // Regular expressions use
  1046. // RE2
  1047. // [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be
  1048. // found
  1049. // under the google/re2 repository on GitHub.
  1050. IncludeRegex []string `json:"includeRegex,omitempty"`
  1051. // ForceSendFields is a list of field names (e.g. "BucketName") to
  1052. // unconditionally include in API requests. By default, fields with
  1053. // empty values are omitted from API requests. However, any non-pointer,
  1054. // non-interface field appearing in ForceSendFields will be sent to the
  1055. // server regardless of whether the field is empty or not. This may be
  1056. // used to include empty fields in Patch requests.
  1057. ForceSendFields []string `json:"-"`
  1058. // NullFields is a list of field names (e.g. "BucketName") to include in
  1059. // API requests with the JSON null value. By default, fields with empty
  1060. // values are omitted from API requests. However, any field with an
  1061. // empty value appearing in NullFields will be sent to the server as
  1062. // null. It is an error if a field in this list has a non-empty value.
  1063. // This may be used to include null fields in Patch requests.
  1064. NullFields []string `json:"-"`
  1065. }
  1066. func (s *GooglePrivacyDlpV2CloudStorageRegexFileSet) MarshalJSON() ([]byte, error) {
  1067. type NoMethod GooglePrivacyDlpV2CloudStorageRegexFileSet
  1068. raw := NoMethod(*s)
  1069. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1070. }
  1071. // GooglePrivacyDlpV2Color: Represents a color in the RGB color space.
  1072. type GooglePrivacyDlpV2Color struct {
  1073. // Blue: The amount of blue in the color as a value in the interval [0,
  1074. // 1].
  1075. Blue float64 `json:"blue,omitempty"`
  1076. // Green: The amount of green in the color as a value in the interval
  1077. // [0, 1].
  1078. Green float64 `json:"green,omitempty"`
  1079. // Red: The amount of red in the color as a value in the interval [0,
  1080. // 1].
  1081. Red float64 `json:"red,omitempty"`
  1082. // ForceSendFields is a list of field names (e.g. "Blue") to
  1083. // unconditionally include in API requests. By default, fields with
  1084. // empty values are omitted from API requests. However, any non-pointer,
  1085. // non-interface field appearing in ForceSendFields will be sent to the
  1086. // server regardless of whether the field is empty or not. This may be
  1087. // used to include empty fields in Patch requests.
  1088. ForceSendFields []string `json:"-"`
  1089. // NullFields is a list of field names (e.g. "Blue") to include in API
  1090. // requests with the JSON null value. By default, fields with empty
  1091. // values are omitted from API requests. However, any field with an
  1092. // empty value appearing in NullFields will be sent to the server as
  1093. // null. It is an error if a field in this list has a non-empty value.
  1094. // This may be used to include null fields in Patch requests.
  1095. NullFields []string `json:"-"`
  1096. }
  1097. func (s *GooglePrivacyDlpV2Color) MarshalJSON() ([]byte, error) {
  1098. type NoMethod GooglePrivacyDlpV2Color
  1099. raw := NoMethod(*s)
  1100. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1101. }
  1102. func (s *GooglePrivacyDlpV2Color) UnmarshalJSON(data []byte) error {
  1103. type NoMethod GooglePrivacyDlpV2Color
  1104. var s1 struct {
  1105. Blue gensupport.JSONFloat64 `json:"blue"`
  1106. Green gensupport.JSONFloat64 `json:"green"`
  1107. Red gensupport.JSONFloat64 `json:"red"`
  1108. *NoMethod
  1109. }
  1110. s1.NoMethod = (*NoMethod)(s)
  1111. if err := json.Unmarshal(data, &s1); err != nil {
  1112. return err
  1113. }
  1114. s.Blue = float64(s1.Blue)
  1115. s.Green = float64(s1.Green)
  1116. s.Red = float64(s1.Red)
  1117. return nil
  1118. }
  1119. // GooglePrivacyDlpV2Condition: The field type of `value` and `field` do
  1120. // not need to match to be
  1121. // considered equal, but not all comparisons are possible.
  1122. // EQUAL_TO and NOT_EQUAL_TO attempt to compare even with incompatible
  1123. // types,
  1124. // but all other comparisons are invalid with incompatible types.
  1125. // A `value` of type:
  1126. //
  1127. // - `string` can be compared against all other types
  1128. // - `boolean` can only be compared against other booleans
  1129. // - `integer` can be compared against doubles or a string if the string
  1130. // value
  1131. // can be parsed as an integer.
  1132. // - `double` can be compared against integers or a string if the string
  1133. // can
  1134. // be parsed as a double.
  1135. // - `Timestamp` can be compared against strings in RFC 3339 date
  1136. // string
  1137. // format.
  1138. // - `TimeOfDay` can be compared against timestamps and strings in the
  1139. // format
  1140. // of 'HH:mm:ss'.
  1141. //
  1142. // If we fail to compare do to type mismatch, a warning will be given
  1143. // and
  1144. // the condition will evaluate to false.
  1145. type GooglePrivacyDlpV2Condition struct {
  1146. // Field: Field within the record this condition is evaluated against.
  1147. // [required]
  1148. Field *GooglePrivacyDlpV2FieldId `json:"field,omitempty"`
  1149. // Operator: Operator used to compare the field or infoType to the
  1150. // value. [required]
  1151. //
  1152. // Possible values:
  1153. // "RELATIONAL_OPERATOR_UNSPECIFIED"
  1154. // "EQUAL_TO" - Equal. Attempts to match even with incompatible types.
  1155. // "NOT_EQUAL_TO" - Not equal to. Attempts to match even with
  1156. // incompatible types.
  1157. // "GREATER_THAN" - Greater than.
  1158. // "LESS_THAN" - Less than.
  1159. // "GREATER_THAN_OR_EQUALS" - Greater than or equals.
  1160. // "LESS_THAN_OR_EQUALS" - Less than or equals.
  1161. // "EXISTS" - Exists
  1162. Operator string `json:"operator,omitempty"`
  1163. // Value: Value to compare against. [Required, except for `EXISTS`
  1164. // tests.]
  1165. Value *GooglePrivacyDlpV2Value `json:"value,omitempty"`
  1166. // ForceSendFields is a list of field names (e.g. "Field") to
  1167. // unconditionally include in API requests. By default, fields with
  1168. // empty values are omitted from API requests. However, any non-pointer,
  1169. // non-interface field appearing in ForceSendFields will be sent to the
  1170. // server regardless of whether the field is empty or not. This may be
  1171. // used to include empty fields in Patch requests.
  1172. ForceSendFields []string `json:"-"`
  1173. // NullFields is a list of field names (e.g. "Field") to include in API
  1174. // requests with the JSON null value. By default, fields with empty
  1175. // values are omitted from API requests. However, any field with an
  1176. // empty value appearing in NullFields will be sent to the server as
  1177. // null. It is an error if a field in this list has a non-empty value.
  1178. // This may be used to include null fields in Patch requests.
  1179. NullFields []string `json:"-"`
  1180. }
  1181. func (s *GooglePrivacyDlpV2Condition) MarshalJSON() ([]byte, error) {
  1182. type NoMethod GooglePrivacyDlpV2Condition
  1183. raw := NoMethod(*s)
  1184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1185. }
  1186. // GooglePrivacyDlpV2Conditions: A collection of conditions.
  1187. type GooglePrivacyDlpV2Conditions struct {
  1188. Conditions []*GooglePrivacyDlpV2Condition `json:"conditions,omitempty"`
  1189. // ForceSendFields is a list of field names (e.g. "Conditions") to
  1190. // unconditionally include in API requests. By default, fields with
  1191. // empty values are omitted from API requests. However, any non-pointer,
  1192. // non-interface field appearing in ForceSendFields will be sent to the
  1193. // server regardless of whether the field is empty or not. This may be
  1194. // used to include empty fields in Patch requests.
  1195. ForceSendFields []string `json:"-"`
  1196. // NullFields is a list of field names (e.g. "Conditions") to include in
  1197. // API requests with the JSON null value. By default, fields with empty
  1198. // values are omitted from API requests. However, any field with an
  1199. // empty value appearing in NullFields will be sent to the server as
  1200. // null. It is an error if a field in this list has a non-empty value.
  1201. // This may be used to include null fields in Patch requests.
  1202. NullFields []string `json:"-"`
  1203. }
  1204. func (s *GooglePrivacyDlpV2Conditions) MarshalJSON() ([]byte, error) {
  1205. type NoMethod GooglePrivacyDlpV2Conditions
  1206. raw := NoMethod(*s)
  1207. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1208. }
  1209. // GooglePrivacyDlpV2ContentItem: Container structure for the content to
  1210. // inspect.
  1211. type GooglePrivacyDlpV2ContentItem struct {
  1212. // ByteItem: Content data to inspect or redact. Replaces `type` and
  1213. // `data`.
  1214. ByteItem *GooglePrivacyDlpV2ByteContentItem `json:"byteItem,omitempty"`
  1215. // Table: Structured content for inspection.
  1216. // See
  1217. // https://cloud.google.com/dlp/docs/inspecting-text#inspecting_a_tab
  1218. // le to
  1219. // learn more.
  1220. Table *GooglePrivacyDlpV2Table `json:"table,omitempty"`
  1221. // Value: String data to inspect or redact.
  1222. Value string `json:"value,omitempty"`
  1223. // ForceSendFields is a list of field names (e.g. "ByteItem") to
  1224. // unconditionally include in API requests. By default, fields with
  1225. // empty values are omitted from API requests. However, any non-pointer,
  1226. // non-interface field appearing in ForceSendFields will be sent to the
  1227. // server regardless of whether the field is empty or not. This may be
  1228. // used to include empty fields in Patch requests.
  1229. ForceSendFields []string `json:"-"`
  1230. // NullFields is a list of field names (e.g. "ByteItem") to include in
  1231. // API requests with the JSON null value. By default, fields with empty
  1232. // values are omitted from API requests. However, any field with an
  1233. // empty value appearing in NullFields will be sent to the server as
  1234. // null. It is an error if a field in this list has a non-empty value.
  1235. // This may be used to include null fields in Patch requests.
  1236. NullFields []string `json:"-"`
  1237. }
  1238. func (s *GooglePrivacyDlpV2ContentItem) MarshalJSON() ([]byte, error) {
  1239. type NoMethod GooglePrivacyDlpV2ContentItem
  1240. raw := NoMethod(*s)
  1241. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1242. }
  1243. // GooglePrivacyDlpV2ContentLocation: Findings container location data.
  1244. type GooglePrivacyDlpV2ContentLocation struct {
  1245. // ContainerName: Name of the container where the finding is
  1246. // located.
  1247. // The top level name is the source file name or table name. Names of
  1248. // some
  1249. // common storage containers are formatted as follows:
  1250. //
  1251. // * BigQuery tables: `<project_id>:<dataset_id>.<table_id>`
  1252. // * Cloud Storage files: `gs://<bucket>/<path>`
  1253. // * Datastore namespace: <namespace>
  1254. //
  1255. // Nested names could be absent if the embedded object has no
  1256. // string
  1257. // identifier (for an example an image contained within a document).
  1258. ContainerName string `json:"containerName,omitempty"`
  1259. // ContainerTimestamp: Findings container modification timestamp, if
  1260. // applicable.
  1261. // For Google Cloud Storage contains last file modification
  1262. // timestamp.
  1263. // For BigQuery table contains last_modified_time property.
  1264. // For Datastore - not populated.
  1265. ContainerTimestamp string `json:"containerTimestamp,omitempty"`
  1266. // ContainerVersion: Findings container version, if
  1267. // available
  1268. // ("generation" for Google Cloud Storage).
  1269. ContainerVersion string `json:"containerVersion,omitempty"`
  1270. // DocumentLocation: Location data for document files.
  1271. DocumentLocation *GooglePrivacyDlpV2DocumentLocation `json:"documentLocation,omitempty"`
  1272. // ImageLocation: Location within an image's pixels.
  1273. ImageLocation *GooglePrivacyDlpV2ImageLocation `json:"imageLocation,omitempty"`
  1274. // RecordLocation: Location within a row or record of a database table.
  1275. RecordLocation *GooglePrivacyDlpV2RecordLocation `json:"recordLocation,omitempty"`
  1276. // ForceSendFields is a list of field names (e.g. "ContainerName") to
  1277. // unconditionally include in API requests. By default, fields with
  1278. // empty values are omitted from API requests. However, any non-pointer,
  1279. // non-interface field appearing in ForceSendFields will be sent to the
  1280. // server regardless of whether the field is empty or not. This may be
  1281. // used to include empty fields in Patch requests.
  1282. ForceSendFields []string `json:"-"`
  1283. // NullFields is a list of field names (e.g. "ContainerName") to include
  1284. // in API requests with the JSON null value. By default, fields with
  1285. // empty values are omitted from API requests. However, any field with
  1286. // an empty value appearing in NullFields will be sent to the server as
  1287. // null. It is an error if a field in this list has a non-empty value.
  1288. // This may be used to include null fields in Patch requests.
  1289. NullFields []string `json:"-"`
  1290. }
  1291. func (s *GooglePrivacyDlpV2ContentLocation) MarshalJSON() ([]byte, error) {
  1292. type NoMethod GooglePrivacyDlpV2ContentLocation
  1293. raw := NoMethod(*s)
  1294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1295. }
  1296. // GooglePrivacyDlpV2CreateDeidentifyTemplateRequest: Request message
  1297. // for CreateDeidentifyTemplate.
  1298. type GooglePrivacyDlpV2CreateDeidentifyTemplateRequest struct {
  1299. // DeidentifyTemplate: The DeidentifyTemplate to create.
  1300. DeidentifyTemplate *GooglePrivacyDlpV2DeidentifyTemplate `json:"deidentifyTemplate,omitempty"`
  1301. // TemplateId: The template id can contain uppercase and lowercase
  1302. // letters,
  1303. // numbers, and hyphens; that is, it must match the regular
  1304. // expression: `[a-zA-Z\\d-_]+`. The maximum length is 100
  1305. // characters. Can be empty to allow the system to generate one.
  1306. TemplateId string `json:"templateId,omitempty"`
  1307. // ForceSendFields is a list of field names (e.g. "DeidentifyTemplate")
  1308. // to unconditionally include in API requests. By default, fields with
  1309. // empty values are omitted from API requests. However, any non-pointer,
  1310. // non-interface field appearing in ForceSendFields will be sent to the
  1311. // server regardless of whether the field is empty or not. This may be
  1312. // used to include empty fields in Patch requests.
  1313. ForceSendFields []string `json:"-"`
  1314. // NullFields is a list of field names (e.g. "DeidentifyTemplate") to
  1315. // include in API requests with the JSON null value. By default, fields
  1316. // with empty values are omitted from API requests. However, any field
  1317. // with an empty value appearing in NullFields will be sent to the
  1318. // server as null. It is an error if a field in this list has a
  1319. // non-empty value. This may be used to include null fields in Patch
  1320. // requests.
  1321. NullFields []string `json:"-"`
  1322. }
  1323. func (s *GooglePrivacyDlpV2CreateDeidentifyTemplateRequest) MarshalJSON() ([]byte, error) {
  1324. type NoMethod GooglePrivacyDlpV2CreateDeidentifyTemplateRequest
  1325. raw := NoMethod(*s)
  1326. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1327. }
  1328. // GooglePrivacyDlpV2CreateDlpJobRequest: Request message for
  1329. // CreateDlpJobRequest. Used to initiate long running
  1330. // jobs such as calculating risk metrics or inspecting Google
  1331. // Cloud
  1332. // Storage.
  1333. type GooglePrivacyDlpV2CreateDlpJobRequest struct {
  1334. InspectJob *GooglePrivacyDlpV2InspectJobConfig `json:"inspectJob,omitempty"`
  1335. // JobId: The job id can contain uppercase and lowercase
  1336. // letters,
  1337. // numbers, and hyphens; that is, it must match the regular
  1338. // expression: `[a-zA-Z\\d-_]+`. The maximum length is 100
  1339. // characters. Can be empty to allow the system to generate one.
  1340. JobId string `json:"jobId,omitempty"`
  1341. RiskJob *GooglePrivacyDlpV2RiskAnalysisJobConfig `json:"riskJob,omitempty"`
  1342. // ForceSendFields is a list of field names (e.g. "InspectJob") to
  1343. // unconditionally include in API requests. By default, fields with
  1344. // empty values are omitted from API requests. However, any non-pointer,
  1345. // non-interface field appearing in ForceSendFields will be sent to the
  1346. // server regardless of whether the field is empty or not. This may be
  1347. // used to include empty fields in Patch requests.
  1348. ForceSendFields []string `json:"-"`
  1349. // NullFields is a list of field names (e.g. "InspectJob") to include in
  1350. // API requests with the JSON null value. By default, fields with empty
  1351. // values are omitted from API requests. However, any field with an
  1352. // empty value appearing in NullFields will be sent to the server as
  1353. // null. It is an error if a field in this list has a non-empty value.
  1354. // This may be used to include null fields in Patch requests.
  1355. NullFields []string `json:"-"`
  1356. }
  1357. func (s *GooglePrivacyDlpV2CreateDlpJobRequest) MarshalJSON() ([]byte, error) {
  1358. type NoMethod GooglePrivacyDlpV2CreateDlpJobRequest
  1359. raw := NoMethod(*s)
  1360. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1361. }
  1362. // GooglePrivacyDlpV2CreateInspectTemplateRequest: Request message for
  1363. // CreateInspectTemplate.
  1364. type GooglePrivacyDlpV2CreateInspectTemplateRequest struct {
  1365. // InspectTemplate: The InspectTemplate to create.
  1366. InspectTemplate *GooglePrivacyDlpV2InspectTemplate `json:"inspectTemplate,omitempty"`
  1367. // TemplateId: The template id can contain uppercase and lowercase
  1368. // letters,
  1369. // numbers, and hyphens; that is, it must match the regular
  1370. // expression: `[a-zA-Z\\d-_]+`. The maximum length is 100
  1371. // characters. Can be empty to allow the system to generate one.
  1372. TemplateId string `json:"templateId,omitempty"`
  1373. // ForceSendFields is a list of field names (e.g. "InspectTemplate") to
  1374. // unconditionally include in API requests. By default, fields with
  1375. // empty values are omitted from API requests. However, any non-pointer,
  1376. // non-interface field appearing in ForceSendFields will be sent to the
  1377. // server regardless of whether the field is empty or not. This may be
  1378. // used to include empty fields in Patch requests.
  1379. ForceSendFields []string `json:"-"`
  1380. // NullFields is a list of field names (e.g. "InspectTemplate") to
  1381. // include in API requests with the JSON null value. By default, fields
  1382. // with empty values are omitted from API requests. However, any field
  1383. // with an empty value appearing in NullFields will be sent to the
  1384. // server as null. It is an error if a field in this list has a
  1385. // non-empty value. This may be used to include null fields in Patch
  1386. // requests.
  1387. NullFields []string `json:"-"`
  1388. }
  1389. func (s *GooglePrivacyDlpV2CreateInspectTemplateRequest) MarshalJSON() ([]byte, error) {
  1390. type NoMethod GooglePrivacyDlpV2CreateInspectTemplateRequest
  1391. raw := NoMethod(*s)
  1392. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1393. }
  1394. // GooglePrivacyDlpV2CreateJobTriggerRequest: Request message for
  1395. // CreateJobTrigger.
  1396. type GooglePrivacyDlpV2CreateJobTriggerRequest struct {
  1397. // JobTrigger: The JobTrigger to create.
  1398. JobTrigger *GooglePrivacyDlpV2JobTrigger `json:"jobTrigger,omitempty"`
  1399. // TriggerId: The trigger id can contain uppercase and lowercase
  1400. // letters,
  1401. // numbers, and hyphens; that is, it must match the regular
  1402. // expression: `[a-zA-Z\\d-_]+`. The maximum length is 100
  1403. // characters. Can be empty to allow the system to generate one.
  1404. TriggerId string `json:"triggerId,omitempty"`
  1405. // ForceSendFields is a list of field names (e.g. "JobTrigger") to
  1406. // unconditionally include in API requests. By default, fields with
  1407. // empty values are omitted from API requests. However, any non-pointer,
  1408. // non-interface field appearing in ForceSendFields will be sent to the
  1409. // server regardless of whether the field is empty or not. This may be
  1410. // used to include empty fields in Patch requests.
  1411. ForceSendFields []string `json:"-"`
  1412. // NullFields is a list of field names (e.g. "JobTrigger") to include in
  1413. // API requests with the JSON null value. By default, fields with empty
  1414. // values are omitted from API requests. However, any field with an
  1415. // empty value appearing in NullFields will be sent to the server as
  1416. // null. It is an error if a field in this list has a non-empty value.
  1417. // This may be used to include null fields in Patch requests.
  1418. NullFields []string `json:"-"`
  1419. }
  1420. func (s *GooglePrivacyDlpV2CreateJobTriggerRequest) MarshalJSON() ([]byte, error) {
  1421. type NoMethod GooglePrivacyDlpV2CreateJobTriggerRequest
  1422. raw := NoMethod(*s)
  1423. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1424. }
  1425. // GooglePrivacyDlpV2CreateStoredInfoTypeRequest: Request message for
  1426. // CreateStoredInfoType.
  1427. type GooglePrivacyDlpV2CreateStoredInfoTypeRequest struct {
  1428. // Config: Configuration of the storedInfoType to create.
  1429. Config *GooglePrivacyDlpV2StoredInfoTypeConfig `json:"config,omitempty"`
  1430. // StoredInfoTypeId: The storedInfoType ID can contain uppercase and
  1431. // lowercase letters,
  1432. // numbers, and hyphens; that is, it must match the regular
  1433. // expression: `[a-zA-Z\\d-_]+`. The maximum length is 100
  1434. // characters. Can be empty to allow the system to generate one.
  1435. StoredInfoTypeId string `json:"storedInfoTypeId,omitempty"`
  1436. // ForceSendFields is a list of field names (e.g. "Config") to
  1437. // unconditionally include in API requests. By default, fields with
  1438. // empty values are omitted from API requests. However, any non-pointer,
  1439. // non-interface field appearing in ForceSendFields will be sent to the
  1440. // server regardless of whether the field is empty or not. This may be
  1441. // used to include empty fields in Patch requests.
  1442. ForceSendFields []string `json:"-"`
  1443. // NullFields is a list of field names (e.g. "Config") to include in API
  1444. // requests with the JSON null value. By default, fields with empty
  1445. // values are omitted from API requests. However, any field with an
  1446. // empty value appearing in NullFields will be sent to the server as
  1447. // null. It is an error if a field in this list has a non-empty value.
  1448. // This may be used to include null fields in Patch requests.
  1449. NullFields []string `json:"-"`
  1450. }
  1451. func (s *GooglePrivacyDlpV2CreateStoredInfoTypeRequest) MarshalJSON() ([]byte, error) {
  1452. type NoMethod GooglePrivacyDlpV2CreateStoredInfoTypeRequest
  1453. raw := NoMethod(*s)
  1454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1455. }
  1456. // GooglePrivacyDlpV2CryptoHashConfig: Pseudonymization method that
  1457. // generates surrogates via cryptographic hashing.
  1458. // Uses SHA-256.
  1459. // The key size must be either 32 or 64 bytes.
  1460. // Outputs a base64 encoded representation of the hashed output
  1461. // (for example,
  1462. // L7k0BHmF1ha5U3NfGykjro4xWi1MPVQPjhMAZbSV9mM=).
  1463. // Currently, only string and integer values can be hashed.
  1464. // See https://cloud.google.com/dlp/docs/pseudonymization to learn more.
  1465. type GooglePrivacyDlpV2CryptoHashConfig struct {
  1466. // CryptoKey: The key used by the hash function.
  1467. CryptoKey *GooglePrivacyDlpV2CryptoKey `json:"cryptoKey,omitempty"`
  1468. // ForceSendFields is a list of field names (e.g. "CryptoKey") to
  1469. // unconditionally include in API requests. By default, fields with
  1470. // empty values are omitted from API requests. However, any non-pointer,
  1471. // non-interface field appearing in ForceSendFields will be sent to the
  1472. // server regardless of whether the field is empty or not. This may be
  1473. // used to include empty fields in Patch requests.
  1474. ForceSendFields []string `json:"-"`
  1475. // NullFields is a list of field names (e.g. "CryptoKey") to include in
  1476. // API requests with the JSON null value. By default, fields with empty
  1477. // values are omitted from API requests. However, any field with an
  1478. // empty value appearing in NullFields will be sent to the server as
  1479. // null. It is an error if a field in this list has a non-empty value.
  1480. // This may be used to include null fields in Patch requests.
  1481. NullFields []string `json:"-"`
  1482. }
  1483. func (s *GooglePrivacyDlpV2CryptoHashConfig) MarshalJSON() ([]byte, error) {
  1484. type NoMethod GooglePrivacyDlpV2CryptoHashConfig
  1485. raw := NoMethod(*s)
  1486. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1487. }
  1488. // GooglePrivacyDlpV2CryptoKey: This is a data encryption key (DEK) (as
  1489. // opposed to
  1490. // a key encryption key (KEK) stored by KMS).
  1491. // When using KMS to wrap/unwrap DEKs, be sure to set an appropriate
  1492. // IAM policy on the KMS CryptoKey (KEK) to ensure an attacker
  1493. // cannot
  1494. // unwrap the data crypto key.
  1495. type GooglePrivacyDlpV2CryptoKey struct {
  1496. KmsWrapped *GooglePrivacyDlpV2KmsWrappedCryptoKey `json:"kmsWrapped,omitempty"`
  1497. Transient *GooglePrivacyDlpV2TransientCryptoKey `json:"transient,omitempty"`
  1498. Unwrapped *GooglePrivacyDlpV2UnwrappedCryptoKey `json:"unwrapped,omitempty"`
  1499. // ForceSendFields is a list of field names (e.g. "KmsWrapped") to
  1500. // unconditionally include in API requests. By default, fields with
  1501. // empty values are omitted from API requests. However, any non-pointer,
  1502. // non-interface field appearing in ForceSendFields will be sent to the
  1503. // server regardless of whether the field is empty or not. This may be
  1504. // used to include empty fields in Patch requests.
  1505. ForceSendFields []string `json:"-"`
  1506. // NullFields is a list of field names (e.g. "KmsWrapped") to include in
  1507. // API requests with the JSON null value. By default, fields with empty
  1508. // values are omitted from API requests. However, any field with an
  1509. // empty value appearing in NullFields will be sent to the server as
  1510. // null. It is an error if a field in this list has a non-empty value.
  1511. // This may be used to include null fields in Patch requests.
  1512. NullFields []string `json:"-"`
  1513. }
  1514. func (s *GooglePrivacyDlpV2CryptoKey) MarshalJSON() ([]byte, error) {
  1515. type NoMethod GooglePrivacyDlpV2CryptoKey
  1516. raw := NoMethod(*s)
  1517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1518. }
  1519. // GooglePrivacyDlpV2CryptoReplaceFfxFpeConfig: Note: We recommend using
  1520. // CryptoDeterministicConfig for all use cases which
  1521. // do not require preserving the input alphabet space and size, plus
  1522. // warrant
  1523. // referential integrity.
  1524. type GooglePrivacyDlpV2CryptoReplaceFfxFpeConfig struct {
  1525. // Possible values:
  1526. // "FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED"
  1527. // "NUMERIC" - [0-9] (radix of 10)
  1528. // "HEXADECIMAL" - [0-9A-F] (radix of 16)
  1529. // "UPPER_CASE_ALPHA_NUMERIC" - [0-9A-Z] (radix of 36)
  1530. // "ALPHA_NUMERIC" - [0-9A-Za-z] (radix of 62)
  1531. CommonAlphabet string `json:"commonAlphabet,omitempty"`
  1532. // Context: The 'tweak', a context may be used for higher security since
  1533. // the same
  1534. // identifier in two different contexts won't be given the same
  1535. // surrogate. If
  1536. // the context is not set, a default tweak will be used.
  1537. //
  1538. // If the context is set but:
  1539. //
  1540. // 1. there is no record present when transforming a given value or
  1541. // 1. the field is not present when transforming a given value,
  1542. //
  1543. // a default tweak will be used.
  1544. //
  1545. // Note that case (1) is expected when an `InfoTypeTransformation`
  1546. // is
  1547. // applied to both structured and non-structured
  1548. // `ContentItem`s.
  1549. // Currently, the referenced field may be of value type integer or
  1550. // string.
  1551. //
  1552. // The tweak is constructed as a sequence of bytes in big endian byte
  1553. // order
  1554. // such that:
  1555. //
  1556. // - a 64 bit integer is encoded followed by a single byte of value 1
  1557. // - a string is encoded in UTF-8 format followed by a single byte of
  1558. // value 2
  1559. Context *GooglePrivacyDlpV2FieldId `json:"context,omitempty"`
  1560. // CryptoKey: The key used by the encryption algorithm. [required]
  1561. CryptoKey *GooglePrivacyDlpV2CryptoKey `json:"cryptoKey,omitempty"`
  1562. // CustomAlphabet: This is supported by mapping these to the
  1563. // alphanumeric characters
  1564. // that the FFX mode natively supports. This happens
  1565. // before/after
  1566. // encryption/decryption.
  1567. // Each character listed must appear only once.
  1568. // Number of characters must be in the range [2, 62].
  1569. // This must be encoded as ASCII.
  1570. // The order of characters does not matter.
  1571. CustomAlphabet string `json:"customAlphabet,omitempty"`
  1572. // Radix: The native way to select the alphabet. Must be in the range
  1573. // [2, 62].
  1574. Radix int64 `json:"radix,omitempty"`
  1575. // SurrogateInfoType: The custom infoType to annotate the surrogate
  1576. // with.
  1577. // This annotation will be applied to the surrogate by prefixing it
  1578. // with
  1579. // the name of the custom infoType followed by the number of
  1580. // characters comprising the surrogate. The following scheme defines
  1581. // the
  1582. // format: info_type_name(surrogate_character_count):surrogate
  1583. //
  1584. // For example, if the name of custom infoType is 'MY_TOKEN_INFO_TYPE'
  1585. // and
  1586. // the surrogate is 'abc', the full replacement value
  1587. // will be: 'MY_TOKEN_INFO_TYPE(3):abc'
  1588. //
  1589. // This annotation identifies the surrogate when inspecting content
  1590. // using the
  1591. // custom
  1592. // infoType
  1593. // [`SurrogateType`](/dlp/docs/reference/rest/v2/InspectConfig#s
  1594. // urrogatetype).
  1595. // This facilitates reversal of the surrogate when it occurs in free
  1596. // text.
  1597. //
  1598. // In order for inspection to work properly, the name of this infoType
  1599. // must
  1600. // not occur naturally anywhere in your data; otherwise, inspection
  1601. // may
  1602. // find a surrogate that does not correspond to an actual
  1603. // identifier.
  1604. // Therefore, choose your custom infoType name carefully after
  1605. // considering
  1606. // what your data looks like. One way to select a name that has a high
  1607. // chance
  1608. // of yielding reliable detection is to include one or more unicode
  1609. // characters
  1610. // that are highly improbable to exist in your data.
  1611. // For example, assuming your data is entered from a regular ASCII
  1612. // keyboard,
  1613. // the symbol with the hex code point 29DD might be used like
  1614. // so:
  1615. // ⧝MY_TOKEN_TYPE
  1616. SurrogateInfoType *GooglePrivacyDlpV2InfoType `json:"surrogateInfoType,omitempty"`
  1617. // ForceSendFields is a list of field names (e.g. "CommonAlphabet") to
  1618. // unconditionally include in API requests. By default, fields with
  1619. // empty values are omitted from API requests. However, any non-pointer,
  1620. // non-interface field appearing in ForceSendFields will be sent to the
  1621. // server regardless of whether the field is empty or not. This may be
  1622. // used to include empty fields in Patch requests.
  1623. ForceSendFields []string `json:"-"`
  1624. // NullFields is a list of field names (e.g. "CommonAlphabet") to
  1625. // include in API requests with the JSON null value. By default, fields
  1626. // with empty values are omitted from API requests. However, any field
  1627. // with an empty value appearing in NullFields will be sent to the
  1628. // server as null. It is an error if a field in this list has a
  1629. // non-empty value. This may be used to include null fields in Patch
  1630. // requests.
  1631. NullFields []string `json:"-"`
  1632. }
  1633. func (s *GooglePrivacyDlpV2CryptoReplaceFfxFpeConfig) MarshalJSON() ([]byte, error) {
  1634. type NoMethod GooglePrivacyDlpV2CryptoReplaceFfxFpeConfig
  1635. raw := NoMethod(*s)
  1636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1637. }
  1638. // GooglePrivacyDlpV2CustomInfoType: Custom information type provided by
  1639. // the user. Used to find domain-specific
  1640. // sensitive information configurable to the data in question.
  1641. type GooglePrivacyDlpV2CustomInfoType struct {
  1642. // DetectionRules: Set of detection rules to apply to all findings of
  1643. // this CustomInfoType.
  1644. // Rules are applied in order that they are specified. Not supported for
  1645. // the
  1646. // `surrogate_type` CustomInfoType.
  1647. DetectionRules []*GooglePrivacyDlpV2DetectionRule `json:"detectionRules,omitempty"`
  1648. // Dictionary: A list of phrases to detect as a CustomInfoType.
  1649. Dictionary *GooglePrivacyDlpV2Dictionary `json:"dictionary,omitempty"`
  1650. // ExclusionType: If set to EXCLUSION_TYPE_EXCLUDE this infoType will
  1651. // not cause a finding
  1652. // to be returned. It still can be used for rules matching.
  1653. //
  1654. // Possible values:
  1655. // "EXCLUSION_TYPE_UNSPECIFIED" - A finding of this custom info type
  1656. // will not be excluded from results.
  1657. // "EXCLUSION_TYPE_EXCLUDE" - A finding of this custom info type will
  1658. // be excluded from final results,
  1659. // but can still affect rule execution.
  1660. ExclusionType string `json:"exclusionType,omitempty"`
  1661. // InfoType: CustomInfoType can either be a new infoType, or an
  1662. // extension of built-in
  1663. // infoType, when the name matches one of existing infoTypes and that
  1664. // infoType
  1665. // is specified in `InspectContent.info_types` field. Specifying the
  1666. // latter
  1667. // adds findings to the one detected by the system. If built-in info
  1668. // type is
  1669. // not specified in `InspectContent.info_types` list then the name is
  1670. // treated
  1671. // as a custom info type.
  1672. InfoType *GooglePrivacyDlpV2InfoType `json:"infoType,omitempty"`
  1673. // Likelihood: Likelihood to return for this CustomInfoType. This base
  1674. // value can be
  1675. // altered by a detection rule if the finding meets the criteria
  1676. // specified by
  1677. // the rule. Defaults to `VERY_LIKELY` if not specified.
  1678. //
  1679. // Possible values:
  1680. // "LIKELIHOOD_UNSPECIFIED" - Default value; same as POSSIBLE.
  1681. // "VERY_UNLIKELY" - Few matching elements.
  1682. // "UNLIKELY"
  1683. // "POSSIBLE" - Some matching elements.
  1684. // "LIKELY"
  1685. // "VERY_LIKELY" - Many matching elements.
  1686. Likelihood string `json:"likelihood,omitempty"`
  1687. // Regex: Regular expression based CustomInfoType.
  1688. Regex *GooglePrivacyDlpV2Regex `json:"regex,omitempty"`
  1689. // StoredType: Load an existing `StoredInfoType` resource for use
  1690. // in
  1691. // `InspectDataSource`. Not currently supported in `InspectContent`.
  1692. StoredType *GooglePrivacyDlpV2StoredType `json:"storedType,omitempty"`
  1693. // SurrogateType: Message for detecting output from deidentification
  1694. // transformations that
  1695. // support reversing.
  1696. SurrogateType *GooglePrivacyDlpV2SurrogateType `json:"surrogateType,omitempty"`
  1697. // ForceSendFields is a list of field names (e.g. "DetectionRules") to
  1698. // unconditionally include in API requests. By default, fields with
  1699. // empty values are omitted from API requests. However, any non-pointer,
  1700. // non-interface field appearing in ForceSendFields will be sent to the
  1701. // server regardless of whether the field is empty or not. This may be
  1702. // used to include empty fields in Patch requests.
  1703. ForceSendFields []string `json:"-"`
  1704. // NullFields is a list of field names (e.g. "DetectionRules") to
  1705. // include in API requests with the JSON null value. By default, fields
  1706. // with empty values are omitted from API requests. However, any field
  1707. // with an empty value appearing in NullFields will be sent to the
  1708. // server as null. It is an error if a field in this list has a
  1709. // non-empty value. This may be used to include null fields in Patch
  1710. // requests.
  1711. NullFields []string `json:"-"`
  1712. }
  1713. func (s *GooglePrivacyDlpV2CustomInfoType) MarshalJSON() ([]byte, error) {
  1714. type NoMethod GooglePrivacyDlpV2CustomInfoType
  1715. raw := NoMethod(*s)
  1716. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1717. }
  1718. // GooglePrivacyDlpV2DatastoreKey: Record key for a finding in Cloud
  1719. // Datastore.
  1720. type GooglePrivacyDlpV2DatastoreKey struct {
  1721. // EntityKey: Datastore entity key.
  1722. EntityKey *GooglePrivacyDlpV2Key `json:"entityKey,omitempty"`
  1723. // ForceSendFields is a list of field names (e.g. "EntityKey") to
  1724. // unconditionally include in API requests. By default, fields with
  1725. // empty values are omitted from API requests. However, any non-pointer,
  1726. // non-interface field appearing in ForceSendFields will be sent to the
  1727. // server regardless of whether the field is empty or not. This may be
  1728. // used to include empty fields in Patch requests.
  1729. ForceSendFields []string `json:"-"`
  1730. // NullFields is a list of field names (e.g. "EntityKey") to include in
  1731. // API requests with the JSON null value. By default, fields with empty
  1732. // values are omitted from API requests. However, any field with an
  1733. // empty value appearing in NullFields will be sent to the server as
  1734. // null. It is an error if a field in this list has a non-empty value.
  1735. // This may be used to include null fields in Patch requests.
  1736. NullFields []string `json:"-"`
  1737. }
  1738. func (s *GooglePrivacyDlpV2DatastoreKey) MarshalJSON() ([]byte, error) {
  1739. type NoMethod GooglePrivacyDlpV2DatastoreKey
  1740. raw := NoMethod(*s)
  1741. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1742. }
  1743. // GooglePrivacyDlpV2DatastoreOptions: Options defining a data set
  1744. // within Google Cloud Datastore.
  1745. type GooglePrivacyDlpV2DatastoreOptions struct {
  1746. // Kind: The kind to process.
  1747. Kind *GooglePrivacyDlpV2KindExpression `json:"kind,omitempty"`
  1748. // PartitionId: A partition ID identifies a grouping of entities. The
  1749. // grouping is always
  1750. // by project and namespace, however the namespace ID may be empty.
  1751. PartitionId *GooglePrivacyDlpV2PartitionId `json:"partitionId,omitempty"`
  1752. // ForceSendFields is a list of field names (e.g. "Kind") to
  1753. // unconditionally include in API requests. By default, fields with
  1754. // empty values are omitted from API requests. However, any non-pointer,
  1755. // non-interface field appearing in ForceSendFields will be sent to the
  1756. // server regardless of whether the field is empty or not. This may be
  1757. // used to include empty fields in Patch requests.
  1758. ForceSendFields []string `json:"-"`
  1759. // NullFields is a list of field names (e.g. "Kind") to include in API
  1760. // requests with the JSON null value. By default, fields with empty
  1761. // values are omitted from API requests. However, any field with an
  1762. // empty value appearing in NullFields will be sent to the server as
  1763. // null. It is an error if a field in this list has a non-empty value.
  1764. // This may be used to include null fields in Patch requests.
  1765. NullFields []string `json:"-"`
  1766. }
  1767. func (s *GooglePrivacyDlpV2DatastoreOptions) MarshalJSON() ([]byte, error) {
  1768. type NoMethod GooglePrivacyDlpV2DatastoreOptions
  1769. raw := NoMethod(*s)
  1770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1771. }
  1772. // GooglePrivacyDlpV2DateShiftConfig: Shifts dates by random number of
  1773. // days, with option to be consistent for the
  1774. // same context. See
  1775. // https://cloud.google.com/dlp/docs/concepts-date-shifting
  1776. // to learn more.
  1777. type GooglePrivacyDlpV2DateShiftConfig struct {
  1778. // Context: Points to the field that contains the context, for example,
  1779. // an entity id.
  1780. // If set, must also set method. If set, shift will be consistent for
  1781. // the
  1782. // given context.
  1783. Context *GooglePrivacyDlpV2FieldId `json:"context,omitempty"`
  1784. // CryptoKey: Causes the shift to be computed based on this key and the
  1785. // context. This
  1786. // results in the same shift for the same context and crypto_key.
  1787. CryptoKey *GooglePrivacyDlpV2CryptoKey `json:"cryptoKey,omitempty"`
  1788. // LowerBoundDays: For example, -5 means shift date to at most 5 days
  1789. // back in the past.
  1790. // [Required]
  1791. LowerBoundDays int64 `json:"lowerBoundDays,omitempty"`
  1792. // UpperBoundDays: Range of shift in days. Actual shift will be selected
  1793. // at random within this
  1794. // range (inclusive ends). Negative means shift to earlier in time. Must
  1795. // not
  1796. // be more than 365250 days (1000 years) each direction.
  1797. //
  1798. // For example, 3 means shift date to at most 3 days into the
  1799. // future.
  1800. // [Required]
  1801. UpperBoundDays int64 `json:"upperBoundDays,omitempty"`
  1802. // ForceSendFields is a list of field names (e.g. "Context") to
  1803. // unconditionally include in API requests. By default, fields with
  1804. // empty values are omitted from API requests. However, any non-pointer,
  1805. // non-interface field appearing in ForceSendFields will be sent to the
  1806. // server regardless of whether the field is empty or not. This may be
  1807. // used to include empty fields in Patch requests.
  1808. ForceSendFields []string `json:"-"`
  1809. // NullFields is a list of field names (e.g. "Context") to include in
  1810. // API requests with the JSON null value. By default, fields with empty
  1811. // values are omitted from API requests. However, any field with an
  1812. // empty value appearing in NullFields will be sent to the server as
  1813. // null. It is an error if a field in this list has a non-empty value.
  1814. // This may be used to include null fields in Patch requests.
  1815. NullFields []string `json:"-"`
  1816. }
  1817. func (s *GooglePrivacyDlpV2DateShiftConfig) MarshalJSON() ([]byte, error) {
  1818. type NoMethod GooglePrivacyDlpV2DateShiftConfig
  1819. raw := NoMethod(*s)
  1820. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1821. }
  1822. // GooglePrivacyDlpV2DateTime: Message for a date time object.
  1823. // e.g. 2018-01-01, 5th August.
  1824. type GooglePrivacyDlpV2DateTime struct {
  1825. // Date: One or more of the following must be set. All fields are
  1826. // optional, but
  1827. // when set must be valid date or time values.
  1828. Date *GoogleTypeDate `json:"date,omitempty"`
  1829. // Possible values:
  1830. // "DAY_OF_WEEK_UNSPECIFIED" - The unspecified day-of-week.
  1831. // "MONDAY" - The day-of-week of Monday.
  1832. // "TUESDAY" - The day-of-week of Tuesday.
  1833. // "WEDNESDAY" - The day-of-week of Wednesday.
  1834. // "THURSDAY" - The day-of-week of Thursday.
  1835. // "FRIDAY" - The day-of-week of Friday.
  1836. // "SATURDAY" - The day-of-week of Saturday.
  1837. // "SUNDAY" - The day-of-week of Sunday.
  1838. DayOfWeek string `json:"dayOfWeek,omitempty"`
  1839. Time *GoogleTypeTimeOfDay `json:"time,omitempty"`
  1840. TimeZone *GooglePrivacyDlpV2TimeZone `json:"timeZone,omitempty"`
  1841. // ForceSendFields is a list of field names (e.g. "Date") to
  1842. // unconditionally include in API requests. By default, fields with
  1843. // empty values are omitted from API requests. However, any non-pointer,
  1844. // non-interface field appearing in ForceSendFields will be sent to the
  1845. // server regardless of whether the field is empty or not. This may be
  1846. // used to include empty fields in Patch requests.
  1847. ForceSendFields []string `json:"-"`
  1848. // NullFields is a list of field names (e.g. "Date") to include in API
  1849. // requests with the JSON null value. By default, fields with empty
  1850. // values are omitted from API requests. However, any field with an
  1851. // empty value appearing in NullFields will be sent to the server as
  1852. // null. It is an error if a field in this list has a non-empty value.
  1853. // This may be used to include null fields in Patch requests.
  1854. NullFields []string `json:"-"`
  1855. }
  1856. func (s *GooglePrivacyDlpV2DateTime) MarshalJSON() ([]byte, error) {
  1857. type NoMethod GooglePrivacyDlpV2DateTime
  1858. raw := NoMethod(*s)
  1859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1860. }
  1861. // GooglePrivacyDlpV2DeidentifyConfig: The configuration that controls
  1862. // how the data will change.
  1863. type GooglePrivacyDlpV2DeidentifyConfig struct {
  1864. // InfoTypeTransformations: Treat the dataset as free-form text and
  1865. // apply the same free text
  1866. // transformation everywhere.
  1867. InfoTypeTransformations *GooglePrivacyDlpV2InfoTypeTransformations `json:"infoTypeTransformations,omitempty"`
  1868. // RecordTransformations: Treat the dataset as structured.
  1869. // Transformations can be applied to
  1870. // specific locations within structured datasets, such as transforming
  1871. // a column within a table.
  1872. RecordTransformations *GooglePrivacyDlpV2RecordTransformations `json:"recordTransformations,omitempty"`
  1873. // ForceSendFields is a list of field names (e.g.
  1874. // "InfoTypeTransformations") to unconditionally include in API
  1875. // requests. By default, fields with empty values are omitted from API
  1876. // requests. However, any non-pointer, non-interface field appearing in
  1877. // ForceSendFields will be sent to the server regardless of whether the
  1878. // field is empty or not. This may be used to include empty fields in
  1879. // Patch requests.
  1880. ForceSendFields []string `json:"-"`
  1881. // NullFields is a list of field names (e.g. "InfoTypeTransformations")
  1882. // to include in API requests with the JSON null value. By default,
  1883. // fields with empty values are omitted from API requests. However, any
  1884. // field with an empty value appearing in NullFields will be sent to the
  1885. // server as null. It is an error if a field in this list has a
  1886. // non-empty value. This may be used to include null fields in Patch
  1887. // requests.
  1888. NullFields []string `json:"-"`
  1889. }
  1890. func (s *GooglePrivacyDlpV2DeidentifyConfig) MarshalJSON() ([]byte, error) {
  1891. type NoMethod GooglePrivacyDlpV2DeidentifyConfig
  1892. raw := NoMethod(*s)
  1893. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1894. }
  1895. // GooglePrivacyDlpV2DeidentifyContentRequest: Request to de-identify a
  1896. // list of items.
  1897. type GooglePrivacyDlpV2DeidentifyContentRequest struct {
  1898. // DeidentifyConfig: Configuration for the de-identification of the
  1899. // content item.
  1900. // Items specified here will override the template referenced by
  1901. // the
  1902. // deidentify_template_name argument.
  1903. DeidentifyConfig *GooglePrivacyDlpV2DeidentifyConfig `json:"deidentifyConfig,omitempty"`
  1904. // DeidentifyTemplateName: Optional template to use. Any configuration
  1905. // directly specified in
  1906. // deidentify_config will override those set in the template. Singular
  1907. // fields
  1908. // that are set in this request will replace their corresponding fields
  1909. // in the
  1910. // template. Repeated fields are appended. Singular sub-messages and
  1911. // groups
  1912. // are recursively merged.
  1913. DeidentifyTemplateName string `json:"deidentifyTemplateName,omitempty"`
  1914. // InspectConfig: Configuration for the inspector.
  1915. // Items specified here will override the template referenced by
  1916. // the
  1917. // inspect_template_name argument.
  1918. InspectConfig *GooglePrivacyDlpV2InspectConfig `json:"inspectConfig,omitempty"`
  1919. // InspectTemplateName: Optional template to use. Any configuration
  1920. // directly specified in
  1921. // inspect_config will override those set in the template. Singular
  1922. // fields
  1923. // that are set in this request will replace their corresponding fields
  1924. // in the
  1925. // template. Repeated fields are appended. Singular sub-messages and
  1926. // groups
  1927. // are recursively merged.
  1928. InspectTemplateName string `json:"inspectTemplateName,omitempty"`
  1929. // Item: The item to de-identify. Will be treated as text.
  1930. Item *GooglePrivacyDlpV2ContentItem `json:"item,omitempty"`
  1931. // ForceSendFields is a list of field names (e.g. "DeidentifyConfig") to
  1932. // unconditionally include in API requests. By default, fields with
  1933. // empty values are omitted from API requests. However, any non-pointer,
  1934. // non-interface field appearing in ForceSendFields will be sent to the
  1935. // server regardless of whether the field is empty or not. This may be
  1936. // used to include empty fields in Patch requests.
  1937. ForceSendFields []string `json:"-"`
  1938. // NullFields is a list of field names (e.g. "DeidentifyConfig") to
  1939. // include in API requests with the JSON null value. By default, fields
  1940. // with empty values are omitted from API requests. However, any field
  1941. // with an empty value appearing in NullFields will be sent to the
  1942. // server as null. It is an error if a field in this list has a
  1943. // non-empty value. This may be used to include null fields in Patch
  1944. // requests.
  1945. NullFields []string `json:"-"`
  1946. }
  1947. func (s *GooglePrivacyDlpV2DeidentifyContentRequest) MarshalJSON() ([]byte, error) {
  1948. type NoMethod GooglePrivacyDlpV2DeidentifyContentRequest
  1949. raw := NoMethod(*s)
  1950. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1951. }
  1952. // GooglePrivacyDlpV2DeidentifyContentResponse: Results of
  1953. // de-identifying a ContentItem.
  1954. type GooglePrivacyDlpV2DeidentifyContentResponse struct {
  1955. // Item: The de-identified item.
  1956. Item *GooglePrivacyDlpV2ContentItem `json:"item,omitempty"`
  1957. // Overview: An overview of the changes that were made on the `item`.
  1958. Overview *GooglePrivacyDlpV2TransformationOverview `json:"overview,omitempty"`
  1959. // ServerResponse contains the HTTP response code and headers from the
  1960. // server.
  1961. googleapi.ServerResponse `json:"-"`
  1962. // ForceSendFields is a list of field names (e.g. "Item") to
  1963. // unconditionally include in API requests. By default, fields with
  1964. // empty values are omitted from API requests. However, any non-pointer,
  1965. // non-interface field appearing in ForceSendFields will be sent to the
  1966. // server regardless of whether the field is empty or not. This may be
  1967. // used to include empty fields in Patch requests.
  1968. ForceSendFields []string `json:"-"`
  1969. // NullFields is a list of field names (e.g. "Item") to include in API
  1970. // requests with the JSON null value. By default, fields with empty
  1971. // values are omitted from API requests. However, any field with an
  1972. // empty value appearing in NullFields will be sent to the server as
  1973. // null. It is an error if a field in this list has a non-empty value.
  1974. // This may be used to include null fields in Patch requests.
  1975. NullFields []string `json:"-"`
  1976. }
  1977. func (s *GooglePrivacyDlpV2DeidentifyContentResponse) MarshalJSON() ([]byte, error) {
  1978. type NoMethod GooglePrivacyDlpV2DeidentifyContentResponse
  1979. raw := NoMethod(*s)
  1980. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1981. }
  1982. // GooglePrivacyDlpV2DeidentifyTemplate: The DeidentifyTemplates
  1983. // contains instructions on how to deidentify content.
  1984. // See https://cloud.google.com/dlp/docs/concepts-templates to learn
  1985. // more.
  1986. type GooglePrivacyDlpV2DeidentifyTemplate struct {
  1987. // CreateTime: The creation timestamp of a inspectTemplate, output only
  1988. // field.
  1989. CreateTime string `json:"createTime,omitempty"`
  1990. // DeidentifyConfig: ///////////// // The core content of the template
  1991. // // ///////////////
  1992. DeidentifyConfig *GooglePrivacyDlpV2DeidentifyConfig `json:"deidentifyConfig,omitempty"`
  1993. // Description: Short description (max 256 chars).
  1994. Description string `json:"description,omitempty"`
  1995. // DisplayName: Display name (max 256 chars).
  1996. DisplayName string `json:"displayName,omitempty"`
  1997. // Name: The template name. Output only.
  1998. //
  1999. // The template will have one of the following
  2000. // formats:
  2001. // `projects/PROJECT_ID/deidentifyTemplates/TEMPLATE_ID`
  2002. // OR
  2003. // `organizations/ORGANIZATION_ID/deidentifyTemplates/TEMPLATE_ID`
  2004. Name string `json:"name,omitempty"`
  2005. // UpdateTime: The last update timestamp of a inspectTemplate, output
  2006. // only field.
  2007. UpdateTime string `json:"updateTime,omitempty"`
  2008. // ServerResponse contains the HTTP response code and headers from the
  2009. // server.
  2010. googleapi.ServerResponse `json:"-"`
  2011. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  2012. // unconditionally include in API requests. By default, fields with
  2013. // empty values are omitted from API requests. However, any non-pointer,
  2014. // non-interface field appearing in ForceSendFields will be sent to the
  2015. // server regardless of whether the field is empty or not. This may be
  2016. // used to include empty fields in Patch requests.
  2017. ForceSendFields []string `json:"-"`
  2018. // NullFields is a list of field names (e.g. "CreateTime") to include in
  2019. // API requests with the JSON null value. By default, fields with empty
  2020. // values are omitted from API requests. However, any field with an
  2021. // empty value appearing in NullFields will be sent to the server as
  2022. // null. It is an error if a field in this list has a non-empty value.
  2023. // This may be used to include null fields in Patch requests.
  2024. NullFields []string `json:"-"`
  2025. }
  2026. func (s *GooglePrivacyDlpV2DeidentifyTemplate) MarshalJSON() ([]byte, error) {
  2027. type NoMethod GooglePrivacyDlpV2DeidentifyTemplate
  2028. raw := NoMethod(*s)
  2029. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2030. }
  2031. // GooglePrivacyDlpV2DeltaPresenceEstimationConfig: δ-presence metric,
  2032. // used to estimate how likely it is for an attacker to
  2033. // figure out that one given individual appears in a de-identified
  2034. // dataset.
  2035. // Similarly to the k-map metric, we cannot compute δ-presence exactly
  2036. // without
  2037. // knowing the attack dataset, so we use a statistical model instead.
  2038. type GooglePrivacyDlpV2DeltaPresenceEstimationConfig struct {
  2039. // AuxiliaryTables: Several auxiliary tables can be used in the
  2040. // analysis. Each custom_tag
  2041. // used to tag a quasi-identifiers field must appear in exactly
  2042. // one
  2043. // field of one auxiliary table.
  2044. AuxiliaryTables []*GooglePrivacyDlpV2StatisticalTable `json:"auxiliaryTables,omitempty"`
  2045. // QuasiIds: Fields considered to be quasi-identifiers. No two fields
  2046. // can have the
  2047. // same tag. [required]
  2048. QuasiIds []*GooglePrivacyDlpV2QuasiId `json:"quasiIds,omitempty"`
  2049. // RegionCode: ISO 3166-1 alpha-2 region code to use in the statistical
  2050. // modeling.
  2051. // Required if no column is tagged with a region-specific InfoType
  2052. // (like
  2053. // US_ZIP_5) or a region code.
  2054. RegionCode string `json:"regionCode,omitempty"`
  2055. // ForceSendFields is a list of field names (e.g. "AuxiliaryTables") to
  2056. // unconditionally include in API requests. By default, fields with
  2057. // empty values are omitted from API requests. However, any non-pointer,
  2058. // non-interface field appearing in ForceSendFields will be sent to the
  2059. // server regardless of whether the field is empty or not. This may be
  2060. // used to include empty fields in Patch requests.
  2061. ForceSendFields []string `json:"-"`
  2062. // NullFields is a list of field names (e.g. "AuxiliaryTables") to
  2063. // include in API requests with the JSON null value. By default, fields
  2064. // with empty values are omitted from API requests. However, any field
  2065. // with an empty value appearing in NullFields will be sent to the
  2066. // server as null. It is an error if a field in this list has a
  2067. // non-empty value. This may be used to include null fields in Patch
  2068. // requests.
  2069. NullFields []string `json:"-"`
  2070. }
  2071. func (s *GooglePrivacyDlpV2DeltaPresenceEstimationConfig) MarshalJSON() ([]byte, error) {
  2072. type NoMethod GooglePrivacyDlpV2DeltaPresenceEstimationConfig
  2073. raw := NoMethod(*s)
  2074. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2075. }
  2076. // GooglePrivacyDlpV2DeltaPresenceEstimationHistogramBucket: A
  2077. // DeltaPresenceEstimationHistogramBucket message with the
  2078. // following
  2079. // values:
  2080. // min_probability: 0.1
  2081. // max_probability: 0.2
  2082. // frequency: 42
  2083. // means that there are 42 records for which δ is in [0.1, 0.2).
  2084. // An
  2085. // important particular case is when min_probability = max_probability =
  2086. // 1:
  2087. // then, every individual who shares this quasi-identifier combination
  2088. // is in
  2089. // the dataset.
  2090. type GooglePrivacyDlpV2DeltaPresenceEstimationHistogramBucket struct {
  2091. // BucketSize: Number of records within these probability bounds.
  2092. BucketSize int64 `json:"bucketSize,omitempty,string"`
  2093. // BucketValueCount: Total number of distinct quasi-identifier tuple
  2094. // values in this bucket.
  2095. BucketValueCount int64 `json:"bucketValueCount,omitempty,string"`
  2096. // BucketValues: Sample of quasi-identifier tuple values in this bucket.
  2097. // The total
  2098. // number of classes returned per bucket is capped at 20.
  2099. BucketValues []*GooglePrivacyDlpV2DeltaPresenceEstimationQuasiIdValues `json:"bucketValues,omitempty"`
  2100. // MaxProbability: Always greater than or equal to min_probability.
  2101. MaxProbability float64 `json:"maxProbability,omitempty"`
  2102. // MinProbability: Between 0 and 1.
  2103. MinProbability float64 `json:"minProbability,omitempty"`
  2104. // ForceSendFields is a list of field names (e.g. "BucketSize") to
  2105. // unconditionally include in API requests. By default, fields with
  2106. // empty values are omitted from API requests. However, any non-pointer,
  2107. // non-interface field appearing in ForceSendFields will be sent to the
  2108. // server regardless of whether the field is empty or not. This may be
  2109. // used to include empty fields in Patch requests.
  2110. ForceSendFields []string `json:"-"`
  2111. // NullFields is a list of field names (e.g. "BucketSize") to include in
  2112. // API requests with the JSON null value. By default, fields with empty
  2113. // values are omitted from API requests. However, any field with an
  2114. // empty value appearing in NullFields will be sent to the server as
  2115. // null. It is an error if a field in this list has a non-empty value.
  2116. // This may be used to include null fields in Patch requests.
  2117. NullFields []string `json:"-"`
  2118. }
  2119. func (s *GooglePrivacyDlpV2DeltaPresenceEstimationHistogramBucket) MarshalJSON() ([]byte, error) {
  2120. type NoMethod GooglePrivacyDlpV2DeltaPresenceEstimationHistogramBucket
  2121. raw := NoMethod(*s)
  2122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2123. }
  2124. func (s *GooglePrivacyDlpV2DeltaPresenceEstimationHistogramBucket) UnmarshalJSON(data []byte) error {
  2125. type NoMethod GooglePrivacyDlpV2DeltaPresenceEstimationHistogramBucket
  2126. var s1 struct {
  2127. MaxProbability gensupport.JSONFloat64 `json:"maxProbability"`
  2128. MinProbability gensupport.JSONFloat64 `json:"minProbability"`
  2129. *NoMethod
  2130. }
  2131. s1.NoMethod = (*NoMethod)(s)
  2132. if err := json.Unmarshal(data, &s1); err != nil {
  2133. return err
  2134. }
  2135. s.MaxProbability = float64(s1.MaxProbability)
  2136. s.MinProbability = float64(s1.MinProbability)
  2137. return nil
  2138. }
  2139. // GooglePrivacyDlpV2DeltaPresenceEstimationQuasiIdValues: A tuple of
  2140. // values for the quasi-identifier columns.
  2141. type GooglePrivacyDlpV2DeltaPresenceEstimationQuasiIdValues struct {
  2142. // EstimatedProbability: The estimated probability that a given
  2143. // individual sharing these
  2144. // quasi-identifier values is in the dataset. This value, typically
  2145. // called
  2146. // δ, is the ratio between the number of records in the dataset with
  2147. // these
  2148. // quasi-identifier values, and the total number of individuals
  2149. // (inside
  2150. // *and* outside the dataset) with these quasi-identifier values.
  2151. // For example, if there are 15 individuals in the dataset who share
  2152. // the
  2153. // same quasi-identifier values, and an estimated 100 people in the
  2154. // entire
  2155. // population with these values, then δ is 0.15.
  2156. EstimatedProbability float64 `json:"estimatedProbability,omitempty"`
  2157. // QuasiIdsValues: The quasi-identifier values.
  2158. QuasiIdsValues []*GooglePrivacyDlpV2Value `json:"quasiIdsValues,omitempty"`
  2159. // ForceSendFields is a list of field names (e.g.
  2160. // "EstimatedProbability") to unconditionally include in API requests.
  2161. // By default, fields with empty values are omitted from API requests.
  2162. // However, any non-pointer, non-interface field appearing in
  2163. // ForceSendFields will be sent to the server regardless of whether the
  2164. // field is empty or not. This may be used to include empty fields in
  2165. // Patch requests.
  2166. ForceSendFields []string `json:"-"`
  2167. // NullFields is a list of field names (e.g. "EstimatedProbability") to
  2168. // include in API requests with the JSON null value. By default, fields
  2169. // with empty values are omitted from API requests. However, any field
  2170. // with an empty value appearing in NullFields will be sent to the
  2171. // server as null. It is an error if a field in this list has a
  2172. // non-empty value. This may be used to include null fields in Patch
  2173. // requests.
  2174. NullFields []string `json:"-"`
  2175. }
  2176. func (s *GooglePrivacyDlpV2DeltaPresenceEstimationQuasiIdValues) MarshalJSON() ([]byte, error) {
  2177. type NoMethod GooglePrivacyDlpV2DeltaPresenceEstimationQuasiIdValues
  2178. raw := NoMethod(*s)
  2179. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2180. }
  2181. func (s *GooglePrivacyDlpV2DeltaPresenceEstimationQuasiIdValues) UnmarshalJSON(data []byte) error {
  2182. type NoMethod GooglePrivacyDlpV2DeltaPresenceEstimationQuasiIdValues
  2183. var s1 struct {
  2184. EstimatedProbability gensupport.JSONFloat64 `json:"estimatedProbability"`
  2185. *NoMethod
  2186. }
  2187. s1.NoMethod = (*NoMethod)(s)
  2188. if err := json.Unmarshal(data, &s1); err != nil {
  2189. return err
  2190. }
  2191. s.EstimatedProbability = float64(s1.EstimatedProbability)
  2192. return nil
  2193. }
  2194. // GooglePrivacyDlpV2DeltaPresenceEstimationResult: Result of the
  2195. // δ-presence computation. Note that these results are an
  2196. // estimation, not exact values.
  2197. type GooglePrivacyDlpV2DeltaPresenceEstimationResult struct {
  2198. // DeltaPresenceEstimationHistogram: The intervals [min_probability,
  2199. // max_probability) do not overlap. If a
  2200. // value doesn't correspond to any such interval, the associated
  2201. // frequency
  2202. // is zero. For example, the following records:
  2203. // {min_probability: 0, max_probability: 0.1, frequency: 17}
  2204. // {min_probability: 0.2, max_probability: 0.3, frequency: 42}
  2205. // {min_probability: 0.3, max_probability: 0.4, frequency: 99}
  2206. // mean that there are no record with an estimated probability in [0.1,
  2207. // 0.2)
  2208. // nor larger or equal to 0.4.
  2209. DeltaPresenceEstimationHistogram []*GooglePrivacyDlpV2DeltaPresenceEstimationHistogramBucket `json:"deltaPresenceEstimationHistogram,omitempty"`
  2210. // ForceSendFields is a list of field names (e.g.
  2211. // "DeltaPresenceEstimationHistogram") to unconditionally include in API
  2212. // requests. By default, fields with empty values are omitted from API
  2213. // requests. However, any non-pointer, non-interface field appearing in
  2214. // ForceSendFields will be sent to the server regardless of whether the
  2215. // field is empty or not. This may be used to include empty fields in
  2216. // Patch requests.
  2217. ForceSendFields []string `json:"-"`
  2218. // NullFields is a list of field names (e.g.
  2219. // "DeltaPresenceEstimationHistogram") to include in API requests with
  2220. // the JSON null value. By default, fields with empty values are omitted
  2221. // from API requests. However, any field with an empty value appearing
  2222. // in NullFields will be sent to the server as null. It is an error if a
  2223. // field in this list has a non-empty value. This may be used to include
  2224. // null fields in Patch requests.
  2225. NullFields []string `json:"-"`
  2226. }
  2227. func (s *GooglePrivacyDlpV2DeltaPresenceEstimationResult) MarshalJSON() ([]byte, error) {
  2228. type NoMethod GooglePrivacyDlpV2DeltaPresenceEstimationResult
  2229. raw := NoMethod(*s)
  2230. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2231. }
  2232. // GooglePrivacyDlpV2DetectionRule: Rule for modifying a CustomInfoType
  2233. // to alter behavior under certain
  2234. // circumstances, depending on the specific details of the rule. Not
  2235. // supported
  2236. // for the `surrogate_type` custom info type.
  2237. type GooglePrivacyDlpV2DetectionRule struct {
  2238. // HotwordRule: Hotword-based detection rule.
  2239. HotwordRule *GooglePrivacyDlpV2HotwordRule `json:"hotwordRule,omitempty"`
  2240. // ForceSendFields is a list of field names (e.g. "HotwordRule") to
  2241. // unconditionally include in API requests. By default, fields with
  2242. // empty values are omitted from API requests. However, any non-pointer,
  2243. // non-interface field appearing in ForceSendFields will be sent to the
  2244. // server regardless of whether the field is empty or not. This may be
  2245. // used to include empty fields in Patch requests.
  2246. ForceSendFields []string `json:"-"`
  2247. // NullFields is a list of field names (e.g. "HotwordRule") to include
  2248. // in API requests with the JSON null value. By default, fields with
  2249. // empty values are omitted from API requests. However, any field with
  2250. // an empty value appearing in NullFields will be sent to the server as
  2251. // null. It is an error if a field in this list has a non-empty value.
  2252. // This may be used to include null fields in Patch requests.
  2253. NullFields []string `json:"-"`
  2254. }
  2255. func (s *GooglePrivacyDlpV2DetectionRule) MarshalJSON() ([]byte, error) {
  2256. type NoMethod GooglePrivacyDlpV2DetectionRule
  2257. raw := NoMethod(*s)
  2258. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2259. }
  2260. // GooglePrivacyDlpV2Dictionary: Custom information type based on a
  2261. // dictionary of words or phrases. This can
  2262. // be used to match sensitive information specific to the data, such as
  2263. // a list
  2264. // of employee IDs or job titles.
  2265. //
  2266. // Dictionary words are case-insensitive and all characters other than
  2267. // letters
  2268. // and digits in the unicode [Basic
  2269. // Multilingual
  2270. // Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#
  2271. // Basic_Multilingual_Plane)
  2272. // will be replaced with whitespace when scanning for matches, so
  2273. // the
  2274. // dictionary phrase "Sam Johnson" will match all three phrases "sam
  2275. // johnson",
  2276. // "Sam, Johnson", and "Sam (Johnson)". Additionally, the
  2277. // characters
  2278. // surrounding any match must be of a different type than the
  2279. // adjacent
  2280. // characters within the word, so letters must be next to non-letters
  2281. // and
  2282. // digits next to non-digits. For example, the dictionary word "jen"
  2283. // will
  2284. // match the first three letters of the text "jen123" but will return
  2285. // no
  2286. // matches for "jennifer".
  2287. //
  2288. // Dictionary words containing a large number of characters that are
  2289. // not
  2290. // letters or digits may result in unexpected findings because such
  2291. // characters
  2292. // are treated as whitespace.
  2293. // The
  2294. // [limits](https://cloud.google.com/dlp/limits) page contains details
  2295. // about
  2296. // the size limits of dictionaries. For dictionaries that do not fit
  2297. // within
  2298. // these constraints, consider using `LargeCustomDictionaryConfig` in
  2299. // the
  2300. // `StoredInfoType` API.
  2301. type GooglePrivacyDlpV2Dictionary struct {
  2302. // CloudStoragePath: Newline-delimited file of words in Cloud Storage.
  2303. // Only a single file
  2304. // is accepted.
  2305. CloudStoragePath *GooglePrivacyDlpV2CloudStoragePath `json:"cloudStoragePath,omitempty"`
  2306. // WordList: List of words or phrases to search for.
  2307. WordList *GooglePrivacyDlpV2WordList `json:"wordList,omitempty"`
  2308. // ForceSendFields is a list of field names (e.g. "CloudStoragePath") to
  2309. // unconditionally include in API requests. By default, fields with
  2310. // empty values are omitted from API requests. However, any non-pointer,
  2311. // non-interface field appearing in ForceSendFields will be sent to the
  2312. // server regardless of whether the field is empty or not. This may be
  2313. // used to include empty fields in Patch requests.
  2314. ForceSendFields []string `json:"-"`
  2315. // NullFields is a list of field names (e.g. "CloudStoragePath") to
  2316. // include in API requests with the JSON null value. By default, fields
  2317. // with empty values are omitted from API requests. However, any field
  2318. // with an empty value appearing in NullFields will be sent to the
  2319. // server as null. It is an error if a field in this list has a
  2320. // non-empty value. This may be used to include null fields in Patch
  2321. // requests.
  2322. NullFields []string `json:"-"`
  2323. }
  2324. func (s *GooglePrivacyDlpV2Dictionary) MarshalJSON() ([]byte, error) {
  2325. type NoMethod GooglePrivacyDlpV2Dictionary
  2326. raw := NoMethod(*s)
  2327. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2328. }
  2329. // GooglePrivacyDlpV2DlpJob: Combines all of the information about a DLP
  2330. // job.
  2331. type GooglePrivacyDlpV2DlpJob struct {
  2332. // CreateTime: Time when the job was created.
  2333. CreateTime string `json:"createTime,omitempty"`
  2334. // EndTime: Time when the job finished.
  2335. EndTime string `json:"endTime,omitempty"`
  2336. // Errors: A stream of errors encountered running the job.
  2337. Errors []*GooglePrivacyDlpV2Error `json:"errors,omitempty"`
  2338. // InspectDetails: Results from inspecting a data source.
  2339. InspectDetails *GooglePrivacyDlpV2InspectDataSourceDetails `json:"inspectDetails,omitempty"`
  2340. // JobTriggerName: If created by a job trigger, the resource name of the
  2341. // trigger that
  2342. // instantiated the job.
  2343. JobTriggerName string `json:"jobTriggerName,omitempty"`
  2344. // Name: The server-assigned name.
  2345. Name string `json:"name,omitempty"`
  2346. // RiskDetails: Results from analyzing risk of a data source.
  2347. RiskDetails *GooglePrivacyDlpV2AnalyzeDataSourceRiskDetails `json:"riskDetails,omitempty"`
  2348. // StartTime: Time when the job started.
  2349. StartTime string `json:"startTime,omitempty"`
  2350. // State: State of a job.
  2351. //
  2352. // Possible values:
  2353. // "JOB_STATE_UNSPECIFIED"
  2354. // "PENDING" - The job has not yet started.
  2355. // "RUNNING" - The job is currently running.
  2356. // "DONE" - The job is no longer running.
  2357. // "CANCELED" - The job was canceled before it could complete.
  2358. // "FAILED" - The job had an error and did not complete.
  2359. State string `json:"state,omitempty"`
  2360. // Type: The type of job.
  2361. //
  2362. // Possible values:
  2363. // "DLP_JOB_TYPE_UNSPECIFIED"
  2364. // "INSPECT_JOB" - The job inspected Google Cloud for sensitive data.
  2365. // "RISK_ANALYSIS_JOB" - The job executed a Risk Analysis computation.
  2366. Type string `json:"type,omitempty"`
  2367. // ServerResponse contains the HTTP response code and headers from the
  2368. // server.
  2369. googleapi.ServerResponse `json:"-"`
  2370. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  2371. // unconditionally include in API requests. By default, fields with
  2372. // empty values are omitted from API requests. However, any non-pointer,
  2373. // non-interface field appearing in ForceSendFields will be sent to the
  2374. // server regardless of whether the field is empty or not. This may be
  2375. // used to include empty fields in Patch requests.
  2376. ForceSendFields []string `json:"-"`
  2377. // NullFields is a list of field names (e.g. "CreateTime") to include in
  2378. // API requests with the JSON null value. By default, fields with empty
  2379. // values are omitted from API requests. However, any field with an
  2380. // empty value appearing in NullFields will be sent to the server as
  2381. // null. It is an error if a field in this list has a non-empty value.
  2382. // This may be used to include null fields in Patch requests.
  2383. NullFields []string `json:"-"`
  2384. }
  2385. func (s *GooglePrivacyDlpV2DlpJob) MarshalJSON() ([]byte, error) {
  2386. type NoMethod GooglePrivacyDlpV2DlpJob
  2387. raw := NoMethod(*s)
  2388. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2389. }
  2390. // GooglePrivacyDlpV2DocumentLocation: Location of a finding within a
  2391. // document.
  2392. type GooglePrivacyDlpV2DocumentLocation struct {
  2393. // FileOffset: Offset of the line, from the beginning of the file, where
  2394. // the finding
  2395. // is located.
  2396. FileOffset int64 `json:"fileOffset,omitempty,string"`
  2397. // ForceSendFields is a list of field names (e.g. "FileOffset") to
  2398. // unconditionally include in API requests. By default, fields with
  2399. // empty values are omitted from API requests. However, any non-pointer,
  2400. // non-interface field appearing in ForceSendFields will be sent to the
  2401. // server regardless of whether the field is empty or not. This may be
  2402. // used to include empty fields in Patch requests.
  2403. ForceSendFields []string `json:"-"`
  2404. // NullFields is a list of field names (e.g. "FileOffset") to include in
  2405. // API requests with the JSON null value. By default, fields with empty
  2406. // values are omitted from API requests. However, any field with an
  2407. // empty value appearing in NullFields will be sent to the server as
  2408. // null. It is an error if a field in this list has a non-empty value.
  2409. // This may be used to include null fields in Patch requests.
  2410. NullFields []string `json:"-"`
  2411. }
  2412. func (s *GooglePrivacyDlpV2DocumentLocation) MarshalJSON() ([]byte, error) {
  2413. type NoMethod GooglePrivacyDlpV2DocumentLocation
  2414. raw := NoMethod(*s)
  2415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2416. }
  2417. // GooglePrivacyDlpV2EntityId: An entity in a dataset is a field or set
  2418. // of fields that correspond to a
  2419. // single person. For example, in medical records the `EntityId` might
  2420. // be a
  2421. // patient identifier, or for financial records it might be an
  2422. // account
  2423. // identifier. This message is used when generalizations or analysis
  2424. // must take
  2425. // into account that multiple rows correspond to the same entity.
  2426. type GooglePrivacyDlpV2EntityId struct {
  2427. // Field: Composite key indicating which field contains the entity
  2428. // identifier.
  2429. Field *GooglePrivacyDlpV2FieldId `json:"field,omitempty"`
  2430. // ForceSendFields is a list of field names (e.g. "Field") to
  2431. // unconditionally include in API requests. By default, fields with
  2432. // empty values are omitted from API requests. However, any non-pointer,
  2433. // non-interface field appearing in ForceSendFields will be sent to the
  2434. // server regardless of whether the field is empty or not. This may be
  2435. // used to include empty fields in Patch requests.
  2436. ForceSendFields []string `json:"-"`
  2437. // NullFields is a list of field names (e.g. "Field") to include in API
  2438. // requests with the JSON null value. By default, fields with empty
  2439. // values are omitted from API requests. However, any field with an
  2440. // empty value appearing in NullFields will be sent to the server as
  2441. // null. It is an error if a field in this list has a non-empty value.
  2442. // This may be used to include null fields in Patch requests.
  2443. NullFields []string `json:"-"`
  2444. }
  2445. func (s *GooglePrivacyDlpV2EntityId) MarshalJSON() ([]byte, error) {
  2446. type NoMethod GooglePrivacyDlpV2EntityId
  2447. raw := NoMethod(*s)
  2448. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2449. }
  2450. // GooglePrivacyDlpV2Error: Details information about an error
  2451. // encountered during job execution or
  2452. // the results of an unsuccessful activation of the JobTrigger.
  2453. // Output only field.
  2454. type GooglePrivacyDlpV2Error struct {
  2455. Details *GoogleRpcStatus `json:"details,omitempty"`
  2456. // Timestamps: The times the error occurred.
  2457. Timestamps []string `json:"timestamps,omitempty"`
  2458. // ForceSendFields is a list of field names (e.g. "Details") to
  2459. // unconditionally include in API requests. By default, fields with
  2460. // empty values are omitted from API requests. However, any non-pointer,
  2461. // non-interface field appearing in ForceSendFields will be sent to the
  2462. // server regardless of whether the field is empty or not. This may be
  2463. // used to include empty fields in Patch requests.
  2464. ForceSendFields []string `json:"-"`
  2465. // NullFields is a list of field names (e.g. "Details") to include in
  2466. // API requests with the JSON null value. By default, fields with empty
  2467. // values are omitted from API requests. However, any field with an
  2468. // empty value appearing in NullFields will be sent to the server as
  2469. // null. It is an error if a field in this list has a non-empty value.
  2470. // This may be used to include null fields in Patch requests.
  2471. NullFields []string `json:"-"`
  2472. }
  2473. func (s *GooglePrivacyDlpV2Error) MarshalJSON() ([]byte, error) {
  2474. type NoMethod GooglePrivacyDlpV2Error
  2475. raw := NoMethod(*s)
  2476. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2477. }
  2478. // GooglePrivacyDlpV2ExcludeInfoTypes: List of exclude infoTypes.
  2479. type GooglePrivacyDlpV2ExcludeInfoTypes struct {
  2480. // InfoTypes: InfoType list in ExclusionRule rule drops a finding when
  2481. // it overlaps or
  2482. // contained within with a finding of an infoType from this list.
  2483. // For
  2484. // example, for `InspectionRuleSet.info_types` containing
  2485. // "PHONE_NUMBER" and
  2486. // `exclusion_rule` containing `exclude_info_types.info_types`
  2487. // with
  2488. // "EMAIL_ADDRESS" the phone number findings are dropped if they
  2489. // overlap
  2490. // with EMAIL_ADDRESS finding.
  2491. // That leads to "555-222-2222@example.org" to generate only a
  2492. // single
  2493. // finding, namely email address.
  2494. InfoTypes []*GooglePrivacyDlpV2InfoType `json:"infoTypes,omitempty"`
  2495. // ForceSendFields is a list of field names (e.g. "InfoTypes") to
  2496. // unconditionally include in API requests. By default, fields with
  2497. // empty values are omitted from API requests. However, any non-pointer,
  2498. // non-interface field appearing in ForceSendFields will be sent to the
  2499. // server regardless of whether the field is empty or not. This may be
  2500. // used to include empty fields in Patch requests.
  2501. ForceSendFields []string `json:"-"`
  2502. // NullFields is a list of field names (e.g. "InfoTypes") to include in
  2503. // API requests with the JSON null value. By default, fields with empty
  2504. // values are omitted from API requests. However, any field with an
  2505. // empty value appearing in NullFields will be sent to the server as
  2506. // null. It is an error if a field in this list has a non-empty value.
  2507. // This may be used to include null fields in Patch requests.
  2508. NullFields []string `json:"-"`
  2509. }
  2510. func (s *GooglePrivacyDlpV2ExcludeInfoTypes) MarshalJSON() ([]byte, error) {
  2511. type NoMethod GooglePrivacyDlpV2ExcludeInfoTypes
  2512. raw := NoMethod(*s)
  2513. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2514. }
  2515. // GooglePrivacyDlpV2ExclusionRule: The rule that specifies conditions
  2516. // when findings of infoTypes specified in
  2517. // `InspectionRuleSet` are removed from results.
  2518. type GooglePrivacyDlpV2ExclusionRule struct {
  2519. // Dictionary: Dictionary which defines the rule.
  2520. Dictionary *GooglePrivacyDlpV2Dictionary `json:"dictionary,omitempty"`
  2521. // ExcludeInfoTypes: Set of infoTypes for which findings would affect
  2522. // this rule.
  2523. ExcludeInfoTypes *GooglePrivacyDlpV2ExcludeInfoTypes `json:"excludeInfoTypes,omitempty"`
  2524. // MatchingType: How the rule is applied, see MatchingType documentation
  2525. // for details.
  2526. //
  2527. // Possible values:
  2528. // "MATCHING_TYPE_UNSPECIFIED" - Invalid.
  2529. // "MATCHING_TYPE_FULL_MATCH" - Full match.
  2530. //
  2531. // - Dictionary: join of Dictionary results matched complete finding
  2532. // quote
  2533. // - Regex: all regex matches fill a finding quote start to end
  2534. // - Exclude info type: completely inside affecting info types findings
  2535. // "MATCHING_TYPE_PARTIAL_MATCH" - Partial match.
  2536. //
  2537. // - Dictionary: at least one of the tokens in the finding matches
  2538. // - Regex: substring of the finding matches
  2539. // - Exclude info type: intersects with affecting info types findings
  2540. // "MATCHING_TYPE_INVERSE_MATCH" - Inverse match.
  2541. //
  2542. // - Dictionary: no tokens in the finding match the dictionary
  2543. // - Regex: finding doesn't match the regex
  2544. // - Exclude info type: no intersection with affecting info types
  2545. // findings
  2546. MatchingType string `json:"matchingType,omitempty"`
  2547. // Regex: Regular expression which defines the rule.
  2548. Regex *GooglePrivacyDlpV2Regex `json:"regex,omitempty"`
  2549. // ForceSendFields is a list of field names (e.g. "Dictionary") to
  2550. // unconditionally include in API requests. By default, fields with
  2551. // empty values are omitted from API requests. However, any non-pointer,
  2552. // non-interface field appearing in ForceSendFields will be sent to the
  2553. // server regardless of whether the field is empty or not. This may be
  2554. // used to include empty fields in Patch requests.
  2555. ForceSendFields []string `json:"-"`
  2556. // NullFields is a list of field names (e.g. "Dictionary") to include in
  2557. // API requests with the JSON null value. By default, fields with empty
  2558. // values are omitted from API requests. However, any field with an
  2559. // empty value appearing in NullFields will be sent to the server as
  2560. // null. It is an error if a field in this list has a non-empty value.
  2561. // This may be used to include null fields in Patch requests.
  2562. NullFields []string `json:"-"`
  2563. }
  2564. func (s *GooglePrivacyDlpV2ExclusionRule) MarshalJSON() ([]byte, error) {
  2565. type NoMethod GooglePrivacyDlpV2ExclusionRule
  2566. raw := NoMethod(*s)
  2567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2568. }
  2569. // GooglePrivacyDlpV2Expressions: An expression, consisting or an
  2570. // operator and conditions.
  2571. type GooglePrivacyDlpV2Expressions struct {
  2572. Conditions *GooglePrivacyDlpV2Conditions `json:"conditions,omitempty"`
  2573. // LogicalOperator: The operator to apply to the result of conditions.
  2574. // Default and currently
  2575. // only supported value is `AND`.
  2576. //
  2577. // Possible values:
  2578. // "LOGICAL_OPERATOR_UNSPECIFIED"
  2579. // "AND"
  2580. LogicalOperator string `json:"logicalOperator,omitempty"`
  2581. // ForceSendFields is a list of field names (e.g. "Conditions") to
  2582. // unconditionally include in API requests. By default, fields with
  2583. // empty values are omitted from API requests. However, any non-pointer,
  2584. // non-interface field appearing in ForceSendFields will be sent to the
  2585. // server regardless of whether the field is empty or not. This may be
  2586. // used to include empty fields in Patch requests.
  2587. ForceSendFields []string `json:"-"`
  2588. // NullFields is a list of field names (e.g. "Conditions") to include in
  2589. // API requests with the JSON null value. By default, fields with empty
  2590. // values are omitted from API requests. However, any field with an
  2591. // empty value appearing in NullFields will be sent to the server as
  2592. // null. It is an error if a field in this list has a non-empty value.
  2593. // This may be used to include null fields in Patch requests.
  2594. NullFields []string `json:"-"`
  2595. }
  2596. func (s *GooglePrivacyDlpV2Expressions) MarshalJSON() ([]byte, error) {
  2597. type NoMethod GooglePrivacyDlpV2Expressions
  2598. raw := NoMethod(*s)
  2599. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2600. }
  2601. // GooglePrivacyDlpV2FieldId: General identifier of a data field in a
  2602. // storage service.
  2603. type GooglePrivacyDlpV2FieldId struct {
  2604. // Name: Name describing the field.
  2605. Name string `json:"name,omitempty"`
  2606. // ForceSendFields is a list of field names (e.g. "Name") to
  2607. // unconditionally include in API requests. By default, fields with
  2608. // empty values are omitted from API requests. However, any non-pointer,
  2609. // non-interface field appearing in ForceSendFields will be sent to the
  2610. // server regardless of whether the field is empty or not. This may be
  2611. // used to include empty fields in Patch requests.
  2612. ForceSendFields []string `json:"-"`
  2613. // NullFields is a list of field names (e.g. "Name") to include in API
  2614. // requests with the JSON null value. By default, fields with empty
  2615. // values are omitted from API requests. However, any field with an
  2616. // empty value appearing in NullFields will be sent to the server as
  2617. // null. It is an error if a field in this list has a non-empty value.
  2618. // This may be used to include null fields in Patch requests.
  2619. NullFields []string `json:"-"`
  2620. }
  2621. func (s *GooglePrivacyDlpV2FieldId) MarshalJSON() ([]byte, error) {
  2622. type NoMethod GooglePrivacyDlpV2FieldId
  2623. raw := NoMethod(*s)
  2624. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2625. }
  2626. // GooglePrivacyDlpV2FieldTransformation: The transformation to apply to
  2627. // the field.
  2628. type GooglePrivacyDlpV2FieldTransformation struct {
  2629. // Condition: Only apply the transformation if the condition evaluates
  2630. // to true for the
  2631. // given `RecordCondition`. The conditions are allowed to reference
  2632. // fields
  2633. // that are not used in the actual transformation. [optional]
  2634. //
  2635. // Example Use Cases:
  2636. //
  2637. // - Apply a different bucket transformation to an age column if the zip
  2638. // code
  2639. // column for the same record is within a specific range.
  2640. // - Redact a field if the date of birth field is greater than 85.
  2641. Condition *GooglePrivacyDlpV2RecordCondition `json:"condition,omitempty"`
  2642. // Fields: Input field(s) to apply the transformation to. [required]
  2643. Fields []*GooglePrivacyDlpV2FieldId `json:"fields,omitempty"`
  2644. // InfoTypeTransformations: Treat the contents of the field as free
  2645. // text, and selectively
  2646. // transform content that matches an `InfoType`.
  2647. InfoTypeTransformations *GooglePrivacyDlpV2InfoTypeTransformations `json:"infoTypeTransformations,omitempty"`
  2648. // PrimitiveTransformation: Apply the transformation to the entire
  2649. // field.
  2650. PrimitiveTransformation *GooglePrivacyDlpV2PrimitiveTransformation `json:"primitiveTransformation,omitempty"`
  2651. // ForceSendFields is a list of field names (e.g. "Condition") to
  2652. // unconditionally include in API requests. By default, fields with
  2653. // empty values are omitted from API requests. However, any non-pointer,
  2654. // non-interface field appearing in ForceSendFields will be sent to the
  2655. // server regardless of whether the field is empty or not. This may be
  2656. // used to include empty fields in Patch requests.
  2657. ForceSendFields []string `json:"-"`
  2658. // NullFields is a list of field names (e.g. "Condition") to include in
  2659. // API requests with the JSON null value. By default, fields with empty
  2660. // values are omitted from API requests. However, any field with an
  2661. // empty value appearing in NullFields will be sent to the server as
  2662. // null. It is an error if a field in this list has a non-empty value.
  2663. // This may be used to include null fields in Patch requests.
  2664. NullFields []string `json:"-"`
  2665. }
  2666. func (s *GooglePrivacyDlpV2FieldTransformation) MarshalJSON() ([]byte, error) {
  2667. type NoMethod GooglePrivacyDlpV2FieldTransformation
  2668. raw := NoMethod(*s)
  2669. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2670. }
  2671. // GooglePrivacyDlpV2FileSet: Set of files to scan.
  2672. type GooglePrivacyDlpV2FileSet struct {
  2673. // RegexFileSet: The regex-filtered set of files to scan. Exactly one of
  2674. // `url` or
  2675. // `regex_file_set` must be set.
  2676. RegexFileSet *GooglePrivacyDlpV2CloudStorageRegexFileSet `json:"regexFileSet,omitempty"`
  2677. // Url: The Cloud Storage url of the file(s) to scan, in the
  2678. // format
  2679. // `gs://<bucket>/<path>`. Trailing wildcard in the path is allowed.
  2680. //
  2681. // If the url ends in a trailing slash, the bucket or directory
  2682. // represented
  2683. // by the url will be scanned non-recursively (content in
  2684. // sub-directories
  2685. // will not be scanned). This means that `gs://mybucket/` is equivalent
  2686. // to
  2687. // `gs://mybucket/*`, and `gs://mybucket/directory/` is equivalent
  2688. // to
  2689. // `gs://mybucket/directory/*`.
  2690. //
  2691. // Exactly one of `url` or `regex_file_set` must be set.
  2692. Url string `json:"url,omitempty"`
  2693. // ForceSendFields is a list of field names (e.g. "RegexFileSet") to
  2694. // unconditionally include in API requests. By default, fields with
  2695. // empty values are omitted from API requests. However, any non-pointer,
  2696. // non-interface field appearing in ForceSendFields will be sent to the
  2697. // server regardless of whether the field is empty or not. This may be
  2698. // used to include empty fields in Patch requests.
  2699. ForceSendFields []string `json:"-"`
  2700. // NullFields is a list of field names (e.g. "RegexFileSet") to include
  2701. // in API requests with the JSON null value. By default, fields with
  2702. // empty values are omitted from API requests. However, any field with
  2703. // an empty value appearing in NullFields will be sent to the server as
  2704. // null. It is an error if a field in this list has a non-empty value.
  2705. // This may be used to include null fields in Patch requests.
  2706. NullFields []string `json:"-"`
  2707. }
  2708. func (s *GooglePrivacyDlpV2FileSet) MarshalJSON() ([]byte, error) {
  2709. type NoMethod GooglePrivacyDlpV2FileSet
  2710. raw := NoMethod(*s)
  2711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2712. }
  2713. // GooglePrivacyDlpV2Finding: Represents a piece of potentially
  2714. // sensitive content.
  2715. type GooglePrivacyDlpV2Finding struct {
  2716. // CreateTime: Timestamp when finding was detected.
  2717. CreateTime string `json:"createTime,omitempty"`
  2718. // InfoType: The type of content that might have been found.
  2719. // Provided if `excluded_types` is false.
  2720. InfoType *GooglePrivacyDlpV2InfoType `json:"infoType,omitempty"`
  2721. // Likelihood: Confidence of how likely it is that the `info_type` is
  2722. // correct.
  2723. //
  2724. // Possible values:
  2725. // "LIKELIHOOD_UNSPECIFIED" - Default value; same as POSSIBLE.
  2726. // "VERY_UNLIKELY" - Few matching elements.
  2727. // "UNLIKELY"
  2728. // "POSSIBLE" - Some matching elements.
  2729. // "LIKELY"
  2730. // "VERY_LIKELY" - Many matching elements.
  2731. Likelihood string `json:"likelihood,omitempty"`
  2732. // Location: Where the content was found.
  2733. Location *GooglePrivacyDlpV2Location `json:"location,omitempty"`
  2734. // Quote: The content that was found. Even if the content is not
  2735. // textual, it
  2736. // may be converted to a textual representation here.
  2737. // Provided if `include_quote` is true and the finding is
  2738. // less than or equal to 4096 bytes long. If the finding exceeds 4096
  2739. // bytes
  2740. // in length, the quote may be omitted.
  2741. Quote string `json:"quote,omitempty"`
  2742. // QuoteInfo: Contains data parsed from quotes. Only populated if
  2743. // include_quote was set
  2744. // to true and a supported infoType was requested. Currently
  2745. // supported
  2746. // infoTypes: DATE, DATE_OF_BIRTH and TIME.
  2747. QuoteInfo *GooglePrivacyDlpV2QuoteInfo `json:"quoteInfo,omitempty"`
  2748. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  2749. // unconditionally include in API requests. By default, fields with
  2750. // empty values are omitted from API requests. However, any non-pointer,
  2751. // non-interface field appearing in ForceSendFields will be sent to the
  2752. // server regardless of whether the field is empty or not. This may be
  2753. // used to include empty fields in Patch requests.
  2754. ForceSendFields []string `json:"-"`
  2755. // NullFields is a list of field names (e.g. "CreateTime") to include in
  2756. // API requests with the JSON null value. By default, fields with empty
  2757. // values are omitted from API requests. However, any field with an
  2758. // empty value appearing in NullFields will be sent to the server as
  2759. // null. It is an error if a field in this list has a non-empty value.
  2760. // This may be used to include null fields in Patch requests.
  2761. NullFields []string `json:"-"`
  2762. }
  2763. func (s *GooglePrivacyDlpV2Finding) MarshalJSON() ([]byte, error) {
  2764. type NoMethod GooglePrivacyDlpV2Finding
  2765. raw := NoMethod(*s)
  2766. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2767. }
  2768. type GooglePrivacyDlpV2FindingLimits struct {
  2769. // MaxFindingsPerInfoType: Configuration of findings limit given for
  2770. // specified infoTypes.
  2771. MaxFindingsPerInfoType []*GooglePrivacyDlpV2InfoTypeLimit `json:"maxFindingsPerInfoType,omitempty"`
  2772. // MaxFindingsPerItem: Max number of findings that will be returned for
  2773. // each item scanned.
  2774. // When set within `InspectDataSourceRequest`,
  2775. // the maximum returned is 2000 regardless if this is set higher.
  2776. // When set within `InspectContentRequest`, this field is ignored.
  2777. MaxFindingsPerItem int64 `json:"maxFindingsPerItem,omitempty"`
  2778. // MaxFindingsPerRequest: Max number of findings that will be returned
  2779. // per request/job.
  2780. // When set within `InspectContentRequest`, the maximum returned is
  2781. // 2000
  2782. // regardless if this is set higher.
  2783. MaxFindingsPerRequest int64 `json:"maxFindingsPerRequest,omitempty"`
  2784. // ForceSendFields is a list of field names (e.g.
  2785. // "MaxFindingsPerInfoType") to unconditionally include in API requests.
  2786. // By default, fields with empty values are omitted from API requests.
  2787. // However, any non-pointer, non-interface field appearing in
  2788. // ForceSendFields will be sent to the server regardless of whether the
  2789. // field is empty or not. This may be used to include empty fields in
  2790. // Patch requests.
  2791. ForceSendFields []string `json:"-"`
  2792. // NullFields is a list of field names (e.g. "MaxFindingsPerInfoType")
  2793. // to include in API requests with the JSON null value. By default,
  2794. // fields with empty values are omitted from API requests. However, any
  2795. // field with an empty value appearing in NullFields will be sent to the
  2796. // server as null. It is an error if a field in this list has a
  2797. // non-empty value. This may be used to include null fields in Patch
  2798. // requests.
  2799. NullFields []string `json:"-"`
  2800. }
  2801. func (s *GooglePrivacyDlpV2FindingLimits) MarshalJSON() ([]byte, error) {
  2802. type NoMethod GooglePrivacyDlpV2FindingLimits
  2803. raw := NoMethod(*s)
  2804. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2805. }
  2806. // GooglePrivacyDlpV2FixedSizeBucketingConfig: Buckets values based on
  2807. // fixed size ranges. The
  2808. // Bucketing transformation can provide all of this functionality,
  2809. // but requires more configuration. This message is provided as a
  2810. // convenience to
  2811. // the user for simple bucketing strategies.
  2812. //
  2813. // The transformed value will be a hyphenated string
  2814. // of
  2815. // <lower_bound>-<upper_bound>, i.e if lower_bound = 10 and upper_bound
  2816. // = 20
  2817. // all values that are within this bucket will be replaced with
  2818. // "10-20".
  2819. //
  2820. // This can be used on data of type: double, long.
  2821. //
  2822. // If the bound Value type differs from the type of data
  2823. // being transformed, we will first attempt converting the type of the
  2824. // data to
  2825. // be transformed to match the type of the bound before comparing.
  2826. //
  2827. // See https://cloud.google.com/dlp/docs/concepts-bucketing to learn
  2828. // more.
  2829. type GooglePrivacyDlpV2FixedSizeBucketingConfig struct {
  2830. // BucketSize: Size of each bucket (except for minimum and maximum
  2831. // buckets). So if
  2832. // `lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then
  2833. // the
  2834. // following buckets would be used: -10, 10-20, 20-30, 30-40, 40-50,
  2835. // 50-60,
  2836. // 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works.
  2837. // [Required].
  2838. BucketSize float64 `json:"bucketSize,omitempty"`
  2839. // LowerBound: Lower bound value of buckets. All values less than
  2840. // `lower_bound` are
  2841. // grouped together into a single bucket; for example if `lower_bound` =
  2842. // 10,
  2843. // then all values less than 10 are replaced with the value “-10”.
  2844. // [Required].
  2845. LowerBound *GooglePrivacyDlpV2Value `json:"lowerBound,omitempty"`
  2846. // UpperBound: Upper bound value of buckets. All values greater than
  2847. // upper_bound are
  2848. // grouped together into a single bucket; for example if `upper_bound` =
  2849. // 89,
  2850. // then all values greater than 89 are replaced with the value
  2851. // “89+”.
  2852. // [Required].
  2853. UpperBound *GooglePrivacyDlpV2Value `json:"upperBound,omitempty"`
  2854. // ForceSendFields is a list of field names (e.g. "BucketSize") to
  2855. // unconditionally include in API requests. By default, fields with
  2856. // empty values are omitted from API requests. However, any non-pointer,
  2857. // non-interface field appearing in ForceSendFields will be sent to the
  2858. // server regardless of whether the field is empty or not. This may be
  2859. // used to include empty fields in Patch requests.
  2860. ForceSendFields []string `json:"-"`
  2861. // NullFields is a list of field names (e.g. "BucketSize") to include in
  2862. // API requests with the JSON null value. By default, fields with empty
  2863. // values are omitted from API requests. However, any field with an
  2864. // empty value appearing in NullFields will be sent to the server as
  2865. // null. It is an error if a field in this list has a non-empty value.
  2866. // This may be used to include null fields in Patch requests.
  2867. NullFields []string `json:"-"`
  2868. }
  2869. func (s *GooglePrivacyDlpV2FixedSizeBucketingConfig) MarshalJSON() ([]byte, error) {
  2870. type NoMethod GooglePrivacyDlpV2FixedSizeBucketingConfig
  2871. raw := NoMethod(*s)
  2872. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2873. }
  2874. func (s *GooglePrivacyDlpV2FixedSizeBucketingConfig) UnmarshalJSON(data []byte) error {
  2875. type NoMethod GooglePrivacyDlpV2FixedSizeBucketingConfig
  2876. var s1 struct {
  2877. BucketSize gensupport.JSONFloat64 `json:"bucketSize"`
  2878. *NoMethod
  2879. }
  2880. s1.NoMethod = (*NoMethod)(s)
  2881. if err := json.Unmarshal(data, &s1); err != nil {
  2882. return err
  2883. }
  2884. s.BucketSize = float64(s1.BucketSize)
  2885. return nil
  2886. }
  2887. // GooglePrivacyDlpV2HotwordRule: The rule that adjusts the likelihood
  2888. // of findings within a certain
  2889. // proximity of hotwords.
  2890. type GooglePrivacyDlpV2HotwordRule struct {
  2891. // HotwordRegex: Regular expression pattern defining what qualifies as a
  2892. // hotword.
  2893. HotwordRegex *GooglePrivacyDlpV2Regex `json:"hotwordRegex,omitempty"`
  2894. // LikelihoodAdjustment: Likelihood adjustment to apply to all matching
  2895. // findings.
  2896. LikelihoodAdjustment *GooglePrivacyDlpV2LikelihoodAdjustment `json:"likelihoodAdjustment,omitempty"`
  2897. // Proximity: Proximity of the finding within which the entire hotword
  2898. // must reside.
  2899. // The total length of the window cannot exceed 1000 characters. Note
  2900. // that
  2901. // the finding itself will be included in the window, so that hotwords
  2902. // may
  2903. // be used to match substrings of the finding itself. For example,
  2904. // the
  2905. // certainty of a phone number regex "\(\d{3}\) \d{3}-\d{4}" could
  2906. // be
  2907. // adjusted upwards if the area code is known to be the local area code
  2908. // of
  2909. // a company office using the hotword regex "\(xxx\)", where "xxx"
  2910. // is the area code in question.
  2911. Proximity *GooglePrivacyDlpV2Proximity `json:"proximity,omitempty"`
  2912. // ForceSendFields is a list of field names (e.g. "HotwordRegex") to
  2913. // unconditionally include in API requests. By default, fields with
  2914. // empty values are omitted from API requests. However, any non-pointer,
  2915. // non-interface field appearing in ForceSendFields will be sent to the
  2916. // server regardless of whether the field is empty or not. This may be
  2917. // used to include empty fields in Patch requests.
  2918. ForceSendFields []string `json:"-"`
  2919. // NullFields is a list of field names (e.g. "HotwordRegex") to include
  2920. // in API requests with the JSON null value. By default, fields with
  2921. // empty values are omitted from API requests. However, any field with
  2922. // an empty value appearing in NullFields will be sent to the server as
  2923. // null. It is an error if a field in this list has a non-empty value.
  2924. // This may be used to include null fields in Patch requests.
  2925. NullFields []string `json:"-"`
  2926. }
  2927. func (s *GooglePrivacyDlpV2HotwordRule) MarshalJSON() ([]byte, error) {
  2928. type NoMethod GooglePrivacyDlpV2HotwordRule
  2929. raw := NoMethod(*s)
  2930. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2931. }
  2932. // GooglePrivacyDlpV2ImageLocation: Location of the finding within an
  2933. // image.
  2934. type GooglePrivacyDlpV2ImageLocation struct {
  2935. // BoundingBoxes: Bounding boxes locating the pixels within the image
  2936. // containing the finding.
  2937. BoundingBoxes []*GooglePrivacyDlpV2BoundingBox `json:"boundingBoxes,omitempty"`
  2938. // ForceSendFields is a list of field names (e.g. "BoundingBoxes") to
  2939. // unconditionally include in API requests. By default, fields with
  2940. // empty values are omitted from API requests. However, any non-pointer,
  2941. // non-interface field appearing in ForceSendFields will be sent to the
  2942. // server regardless of whether the field is empty or not. This may be
  2943. // used to include empty fields in Patch requests.
  2944. ForceSendFields []string `json:"-"`
  2945. // NullFields is a list of field names (e.g. "BoundingBoxes") to include
  2946. // in API requests with the JSON null value. By default, fields with
  2947. // empty values are omitted from API requests. However, any field with
  2948. // an empty value appearing in NullFields will be sent to the server as
  2949. // null. It is an error if a field in this list has a non-empty value.
  2950. // This may be used to include null fields in Patch requests.
  2951. NullFields []string `json:"-"`
  2952. }
  2953. func (s *GooglePrivacyDlpV2ImageLocation) MarshalJSON() ([]byte, error) {
  2954. type NoMethod GooglePrivacyDlpV2ImageLocation
  2955. raw := NoMethod(*s)
  2956. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2957. }
  2958. // GooglePrivacyDlpV2ImageRedactionConfig: Configuration for determining
  2959. // how redaction of images should occur.
  2960. type GooglePrivacyDlpV2ImageRedactionConfig struct {
  2961. // InfoType: Only one per info_type should be provided per request. If
  2962. // not
  2963. // specified, and redact_all_text is false, the DLP API will redact
  2964. // all
  2965. // text that it matches against all info_types that are found, but
  2966. // not
  2967. // specified in another ImageRedactionConfig.
  2968. InfoType *GooglePrivacyDlpV2InfoType `json:"infoType,omitempty"`
  2969. // RedactAllText: If true, all text found in the image, regardless
  2970. // whether it matches an
  2971. // info_type, is redacted. Only one should be provided.
  2972. RedactAllText bool `json:"redactAllText,omitempty"`
  2973. // RedactionColor: The color to use when redacting content from an
  2974. // image. If not specified,
  2975. // the default is black.
  2976. RedactionColor *GooglePrivacyDlpV2Color `json:"redactionColor,omitempty"`
  2977. // ForceSendFields is a list of field names (e.g. "InfoType") to
  2978. // unconditionally include in API requests. By default, fields with
  2979. // empty values are omitted from API requests. However, any non-pointer,
  2980. // non-interface field appearing in ForceSendFields will be sent to the
  2981. // server regardless of whether the field is empty or not. This may be
  2982. // used to include empty fields in Patch requests.
  2983. ForceSendFields []string `json:"-"`
  2984. // NullFields is a list of field names (e.g. "InfoType") to include in
  2985. // API requests with the JSON null value. By default, fields with empty
  2986. // values are omitted from API requests. However, any field with an
  2987. // empty value appearing in NullFields will be sent to the server as
  2988. // null. It is an error if a field in this list has a non-empty value.
  2989. // This may be used to include null fields in Patch requests.
  2990. NullFields []string `json:"-"`
  2991. }
  2992. func (s *GooglePrivacyDlpV2ImageRedactionConfig) MarshalJSON() ([]byte, error) {
  2993. type NoMethod GooglePrivacyDlpV2ImageRedactionConfig
  2994. raw := NoMethod(*s)
  2995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2996. }
  2997. // GooglePrivacyDlpV2InfoType: Type of information detected by the API.
  2998. type GooglePrivacyDlpV2InfoType struct {
  2999. // Name: Name of the information type. Either a name of your choosing
  3000. // when
  3001. // creating a CustomInfoType, or one of the names listed
  3002. // at https://cloud.google.com/dlp/docs/infotypes-reference when
  3003. // specifying
  3004. // a built-in type. InfoType names should conform to the
  3005. // pattern
  3006. // [a-zA-Z0-9_]{1,64}.
  3007. Name string `json:"name,omitempty"`
  3008. // ForceSendFields is a list of field names (e.g. "Name") to
  3009. // unconditionally include in API requests. By default, fields with
  3010. // empty values are omitted from API requests. However, any non-pointer,
  3011. // non-interface field appearing in ForceSendFields will be sent to the
  3012. // server regardless of whether the field is empty or not. This may be
  3013. // used to include empty fields in Patch requests.
  3014. ForceSendFields []string `json:"-"`
  3015. // NullFields is a list of field names (e.g. "Name") to include in API
  3016. // requests with the JSON null value. By default, fields with empty
  3017. // values are omitted from API requests. However, any field with an
  3018. // empty value appearing in NullFields will be sent to the server as
  3019. // null. It is an error if a field in this list has a non-empty value.
  3020. // This may be used to include null fields in Patch requests.
  3021. NullFields []string `json:"-"`
  3022. }
  3023. func (s *GooglePrivacyDlpV2InfoType) MarshalJSON() ([]byte, error) {
  3024. type NoMethod GooglePrivacyDlpV2InfoType
  3025. raw := NoMethod(*s)
  3026. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3027. }
  3028. // GooglePrivacyDlpV2InfoTypeDescription: InfoType description.
  3029. type GooglePrivacyDlpV2InfoTypeDescription struct {
  3030. // Description: Description of the infotype. Translated when language is
  3031. // provided in the
  3032. // request.
  3033. Description string `json:"description,omitempty"`
  3034. // DisplayName: Human readable form of the infoType name.
  3035. DisplayName string `json:"displayName,omitempty"`
  3036. // Name: Internal name of the infoType.
  3037. Name string `json:"name,omitempty"`
  3038. // SupportedBy: Which parts of the API supports this InfoType.
  3039. //
  3040. // Possible values:
  3041. // "ENUM_TYPE_UNSPECIFIED"
  3042. // "INSPECT" - Supported by the inspect operations.
  3043. // "RISK_ANALYSIS" - Supported by the risk analysis operations.
  3044. SupportedBy []string `json:"supportedBy,omitempty"`
  3045. // ForceSendFields is a list of field names (e.g. "Description") to
  3046. // unconditionally include in API requests. By default, fields with
  3047. // empty values are omitted from API requests. However, any non-pointer,
  3048. // non-interface field appearing in ForceSendFields will be sent to the
  3049. // server regardless of whether the field is empty or not. This may be
  3050. // used to include empty fields in Patch requests.
  3051. ForceSendFields []string `json:"-"`
  3052. // NullFields is a list of field names (e.g. "Description") to include
  3053. // in API requests with the JSON null value. By default, fields with
  3054. // empty values are omitted from API requests. However, any field with
  3055. // an empty value appearing in NullFields will be sent to the server as
  3056. // null. It is an error if a field in this list has a non-empty value.
  3057. // This may be used to include null fields in Patch requests.
  3058. NullFields []string `json:"-"`
  3059. }
  3060. func (s *GooglePrivacyDlpV2InfoTypeDescription) MarshalJSON() ([]byte, error) {
  3061. type NoMethod GooglePrivacyDlpV2InfoTypeDescription
  3062. raw := NoMethod(*s)
  3063. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3064. }
  3065. // GooglePrivacyDlpV2InfoTypeLimit: Max findings configuration per
  3066. // infoType, per content item or long
  3067. // running DlpJob.
  3068. type GooglePrivacyDlpV2InfoTypeLimit struct {
  3069. // InfoType: Type of information the findings limit applies to. Only one
  3070. // limit per
  3071. // info_type should be provided. If InfoTypeLimit does not have
  3072. // an
  3073. // info_type, the DLP API applies the limit against all info_types
  3074. // that
  3075. // are found but not specified in another InfoTypeLimit.
  3076. InfoType *GooglePrivacyDlpV2InfoType `json:"infoType,omitempty"`
  3077. // MaxFindings: Max findings limit for the given infoType.
  3078. MaxFindings int64 `json:"maxFindings,omitempty"`
  3079. // ForceSendFields is a list of field names (e.g. "InfoType") to
  3080. // unconditionally include in API requests. By default, fields with
  3081. // empty values are omitted from API requests. However, any non-pointer,
  3082. // non-interface field appearing in ForceSendFields will be sent to the
  3083. // server regardless of whether the field is empty or not. This may be
  3084. // used to include empty fields in Patch requests.
  3085. ForceSendFields []string `json:"-"`
  3086. // NullFields is a list of field names (e.g. "InfoType") to include in
  3087. // API requests with the JSON null value. By default, fields with empty
  3088. // values are omitted from API requests. However, any field with an
  3089. // empty value appearing in NullFields will be sent to the server as
  3090. // null. It is an error if a field in this list has a non-empty value.
  3091. // This may be used to include null fields in Patch requests.
  3092. NullFields []string `json:"-"`
  3093. }
  3094. func (s *GooglePrivacyDlpV2InfoTypeLimit) MarshalJSON() ([]byte, error) {
  3095. type NoMethod GooglePrivacyDlpV2InfoTypeLimit
  3096. raw := NoMethod(*s)
  3097. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3098. }
  3099. // GooglePrivacyDlpV2InfoTypeStats: Statistics regarding a specific
  3100. // InfoType.
  3101. type GooglePrivacyDlpV2InfoTypeStats struct {
  3102. // Count: Number of findings for this infoType.
  3103. Count int64 `json:"count,omitempty,string"`
  3104. // InfoType: The type of finding this stat is for.
  3105. InfoType *GooglePrivacyDlpV2InfoType `json:"infoType,omitempty"`
  3106. // ForceSendFields is a list of field names (e.g. "Count") to
  3107. // unconditionally include in API requests. By default, fields with
  3108. // empty values are omitted from API requests. However, any non-pointer,
  3109. // non-interface field appearing in ForceSendFields will be sent to the
  3110. // server regardless of whether the field is empty or not. This may be
  3111. // used to include empty fields in Patch requests.
  3112. ForceSendFields []string `json:"-"`
  3113. // NullFields is a list of field names (e.g. "Count") to include in API
  3114. // requests with the JSON null value. By default, fields with empty
  3115. // values are omitted from API requests. However, any field with an
  3116. // empty value appearing in NullFields will be sent to the server as
  3117. // null. It is an error if a field in this list has a non-empty value.
  3118. // This may be used to include null fields in Patch requests.
  3119. NullFields []string `json:"-"`
  3120. }
  3121. func (s *GooglePrivacyDlpV2InfoTypeStats) MarshalJSON() ([]byte, error) {
  3122. type NoMethod GooglePrivacyDlpV2InfoTypeStats
  3123. raw := NoMethod(*s)
  3124. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3125. }
  3126. // GooglePrivacyDlpV2InfoTypeTransformation: A transformation to apply
  3127. // to text that is identified as a specific
  3128. // info_type.
  3129. type GooglePrivacyDlpV2InfoTypeTransformation struct {
  3130. // InfoTypes: InfoTypes to apply the transformation to. An empty list
  3131. // will cause
  3132. // this transformation to apply to all findings that correspond
  3133. // to
  3134. // infoTypes that were requested in `InspectConfig`.
  3135. InfoTypes []*GooglePrivacyDlpV2InfoType `json:"infoTypes,omitempty"`
  3136. // PrimitiveTransformation: Primitive transformation to apply to the
  3137. // infoType. [required]
  3138. PrimitiveTransformation *GooglePrivacyDlpV2PrimitiveTransformation `json:"primitiveTransformation,omitempty"`
  3139. // ForceSendFields is a list of field names (e.g. "InfoTypes") to
  3140. // unconditionally include in API requests. By default, fields with
  3141. // empty values are omitted from API requests. However, any non-pointer,
  3142. // non-interface field appearing in ForceSendFields will be sent to the
  3143. // server regardless of whether the field is empty or not. This may be
  3144. // used to include empty fields in Patch requests.
  3145. ForceSendFields []string `json:"-"`
  3146. // NullFields is a list of field names (e.g. "InfoTypes") to include in
  3147. // API requests with the JSON null value. By default, fields with empty
  3148. // values are omitted from API requests. However, any field with an
  3149. // empty value appearing in NullFields will be sent to the server as
  3150. // null. It is an error if a field in this list has a non-empty value.
  3151. // This may be used to include null fields in Patch requests.
  3152. NullFields []string `json:"-"`
  3153. }
  3154. func (s *GooglePrivacyDlpV2InfoTypeTransformation) MarshalJSON() ([]byte, error) {
  3155. type NoMethod GooglePrivacyDlpV2InfoTypeTransformation
  3156. raw := NoMethod(*s)
  3157. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3158. }
  3159. // GooglePrivacyDlpV2InfoTypeTransformations: A type of transformation
  3160. // that will scan unstructured text and
  3161. // apply various `PrimitiveTransformation`s to each finding, where
  3162. // the
  3163. // transformation is applied to only values that were identified as a
  3164. // specific
  3165. // info_type.
  3166. type GooglePrivacyDlpV2InfoTypeTransformations struct {
  3167. // Transformations: Transformation for each infoType. Cannot specify
  3168. // more than one
  3169. // for a given infoType. [required]
  3170. Transformations []*GooglePrivacyDlpV2InfoTypeTransformation `json:"transformations,omitempty"`
  3171. // ForceSendFields is a list of field names (e.g. "Transformations") to
  3172. // unconditionally include in API requests. By default, fields with
  3173. // empty values are omitted from API requests. However, any non-pointer,
  3174. // non-interface field appearing in ForceSendFields will be sent to the
  3175. // server regardless of whether the field is empty or not. This may be
  3176. // used to include empty fields in Patch requests.
  3177. ForceSendFields []string `json:"-"`
  3178. // NullFields is a list of field names (e.g. "Transformations") to
  3179. // include in API requests with the JSON null value. By default, fields
  3180. // with empty values are omitted from API requests. However, any field
  3181. // with an empty value appearing in NullFields will be sent to the
  3182. // server as null. It is an error if a field in this list has a
  3183. // non-empty value. This may be used to include null fields in Patch
  3184. // requests.
  3185. NullFields []string `json:"-"`
  3186. }
  3187. func (s *GooglePrivacyDlpV2InfoTypeTransformations) MarshalJSON() ([]byte, error) {
  3188. type NoMethod GooglePrivacyDlpV2InfoTypeTransformations
  3189. raw := NoMethod(*s)
  3190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3191. }
  3192. // GooglePrivacyDlpV2InspectConfig: Configuration description of the
  3193. // scanning process.
  3194. // When used with redactContent only info_types and min_likelihood are
  3195. // currently
  3196. // used.
  3197. type GooglePrivacyDlpV2InspectConfig struct {
  3198. // ContentOptions: List of options defining data content to scan.
  3199. // If empty, text, images, and other content will be included.
  3200. //
  3201. // Possible values:
  3202. // "CONTENT_UNSPECIFIED" - Includes entire content of a file or a data
  3203. // stream.
  3204. // "CONTENT_TEXT" - Text content within the data, excluding any
  3205. // metadata.
  3206. // "CONTENT_IMAGE" - Images found in the data.
  3207. ContentOptions []string `json:"contentOptions,omitempty"`
  3208. // CustomInfoTypes: CustomInfoTypes provided by the user.
  3209. // See
  3210. // https://cloud.google.com/dlp/docs/creating-custom-infotypes to learn
  3211. // more.
  3212. CustomInfoTypes []*GooglePrivacyDlpV2CustomInfoType `json:"customInfoTypes,omitempty"`
  3213. // ExcludeInfoTypes: When true, excludes type information of the
  3214. // findings.
  3215. ExcludeInfoTypes bool `json:"excludeInfoTypes,omitempty"`
  3216. // IncludeQuote: When true, a contextual quote from the data that
  3217. // triggered a finding is
  3218. // included in the response; see Finding.quote.
  3219. IncludeQuote bool `json:"includeQuote,omitempty"`
  3220. // InfoTypes: Restricts what info_types to look for. The values must
  3221. // correspond to
  3222. // InfoType values returned by ListInfoTypes or listed
  3223. // at
  3224. // https://cloud.google.com/dlp/docs/infotypes-reference.
  3225. //
  3226. // When no InfoTypes or CustomInfoTypes are specified in a request,
  3227. // the
  3228. // system may automatically choose what detectors to run. By default
  3229. // this may
  3230. // be all types, but may change over time as detectors are updated.
  3231. //
  3232. // The special InfoType name "ALL_BASIC" can be used to trigger all
  3233. // detectors,
  3234. // but may change over time as new InfoTypes are added. If you need
  3235. // precise
  3236. // control and predictability as to what detectors are run you should
  3237. // specify
  3238. // specific InfoTypes listed in the reference.
  3239. InfoTypes []*GooglePrivacyDlpV2InfoType `json:"infoTypes,omitempty"`
  3240. Limits *GooglePrivacyDlpV2FindingLimits `json:"limits,omitempty"`
  3241. // MinLikelihood: Only returns findings equal or above this threshold.
  3242. // The default is
  3243. // POSSIBLE.
  3244. // See https://cloud.google.com/dlp/docs/likelihood to learn more.
  3245. //
  3246. // Possible values:
  3247. // "LIKELIHOOD_UNSPECIFIED" - Default value; same as POSSIBLE.
  3248. // "VERY_UNLIKELY" - Few matching elements.
  3249. // "UNLIKELY"
  3250. // "POSSIBLE" - Some matching elements.
  3251. // "LIKELY"
  3252. // "VERY_LIKELY" - Many matching elements.
  3253. MinLikelihood string `json:"minLikelihood,omitempty"`
  3254. // RuleSet: Set of rules to apply to the findings for this
  3255. // InspectConfig.
  3256. // Exclusion rules, contained in the set are executed in the end,
  3257. // other
  3258. // rules are executed in the order they are specified for each info
  3259. // type.
  3260. RuleSet []*GooglePrivacyDlpV2InspectionRuleSet `json:"ruleSet,omitempty"`
  3261. // ForceSendFields is a list of field names (e.g. "ContentOptions") to
  3262. // unconditionally include in API requests. By default, fields with
  3263. // empty values are omitted from API requests. However, any non-pointer,
  3264. // non-interface field appearing in ForceSendFields will be sent to the
  3265. // server regardless of whether the field is empty or not. This may be
  3266. // used to include empty fields in Patch requests.
  3267. ForceSendFields []string `json:"-"`
  3268. // NullFields is a list of field names (e.g. "ContentOptions") to
  3269. // include in API requests with the JSON null value. By default, fields
  3270. // with empty values are omitted from API requests. However, any field
  3271. // with an empty value appearing in NullFields will be sent to the
  3272. // server as null. It is an error if a field in this list has a
  3273. // non-empty value. This may be used to include null fields in Patch
  3274. // requests.
  3275. NullFields []string `json:"-"`
  3276. }
  3277. func (s *GooglePrivacyDlpV2InspectConfig) MarshalJSON() ([]byte, error) {
  3278. type NoMethod GooglePrivacyDlpV2InspectConfig
  3279. raw := NoMethod(*s)
  3280. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3281. }
  3282. // GooglePrivacyDlpV2InspectContentRequest: Request to search for
  3283. // potentially sensitive info in a ContentItem.
  3284. type GooglePrivacyDlpV2InspectContentRequest struct {
  3285. // InspectConfig: Configuration for the inspector. What specified here
  3286. // will override
  3287. // the template referenced by the inspect_template_name argument.
  3288. InspectConfig *GooglePrivacyDlpV2InspectConfig `json:"inspectConfig,omitempty"`
  3289. // InspectTemplateName: Optional template to use. Any configuration
  3290. // directly specified in
  3291. // inspect_config will override those set in the template. Singular
  3292. // fields
  3293. // that are set in this request will replace their corresponding fields
  3294. // in the
  3295. // template. Repeated fields are appended. Singular sub-messages and
  3296. // groups
  3297. // are recursively merged.
  3298. InspectTemplateName string `json:"inspectTemplateName,omitempty"`
  3299. // Item: The item to inspect.
  3300. Item *GooglePrivacyDlpV2ContentItem `json:"item,omitempty"`
  3301. // ForceSendFields is a list of field names (e.g. "InspectConfig") to
  3302. // unconditionally include in API requests. By default, fields with
  3303. // empty values are omitted from API requests. However, any non-pointer,
  3304. // non-interface field appearing in ForceSendFields will be sent to the
  3305. // server regardless of whether the field is empty or not. This may be
  3306. // used to include empty fields in Patch requests.
  3307. ForceSendFields []string `json:"-"`
  3308. // NullFields is a list of field names (e.g. "InspectConfig") to include
  3309. // in API requests with the JSON null value. By default, fields with
  3310. // empty values are omitted from API requests. However, any field with
  3311. // an empty value appearing in NullFields will be sent to the server as
  3312. // null. It is an error if a field in this list has a non-empty value.
  3313. // This may be used to include null fields in Patch requests.
  3314. NullFields []string `json:"-"`
  3315. }
  3316. func (s *GooglePrivacyDlpV2InspectContentRequest) MarshalJSON() ([]byte, error) {
  3317. type NoMethod GooglePrivacyDlpV2InspectContentRequest
  3318. raw := NoMethod(*s)
  3319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3320. }
  3321. // GooglePrivacyDlpV2InspectContentResponse: Results of inspecting an
  3322. // item.
  3323. type GooglePrivacyDlpV2InspectContentResponse struct {
  3324. // Result: The findings.
  3325. Result *GooglePrivacyDlpV2InspectResult `json:"result,omitempty"`
  3326. // ServerResponse contains the HTTP response code and headers from the
  3327. // server.
  3328. googleapi.ServerResponse `json:"-"`
  3329. // ForceSendFields is a list of field names (e.g. "Result") to
  3330. // unconditionally include in API requests. By default, fields with
  3331. // empty values are omitted from API requests. However, any non-pointer,
  3332. // non-interface field appearing in ForceSendFields will be sent to the
  3333. // server regardless of whether the field is empty or not. This may be
  3334. // used to include empty fields in Patch requests.
  3335. ForceSendFields []string `json:"-"`
  3336. // NullFields is a list of field names (e.g. "Result") to include in API
  3337. // requests with the JSON null value. By default, fields with empty
  3338. // values are omitted from API requests. However, any field with an
  3339. // empty value appearing in NullFields will be sent to the server as
  3340. // null. It is an error if a field in this list has a non-empty value.
  3341. // This may be used to include null fields in Patch requests.
  3342. NullFields []string `json:"-"`
  3343. }
  3344. func (s *GooglePrivacyDlpV2InspectContentResponse) MarshalJSON() ([]byte, error) {
  3345. type NoMethod GooglePrivacyDlpV2InspectContentResponse
  3346. raw := NoMethod(*s)
  3347. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3348. }
  3349. // GooglePrivacyDlpV2InspectDataSourceDetails: The results of an inspect
  3350. // DataSource job.
  3351. type GooglePrivacyDlpV2InspectDataSourceDetails struct {
  3352. // RequestedOptions: The configuration used for this job.
  3353. RequestedOptions *GooglePrivacyDlpV2RequestedOptions `json:"requestedOptions,omitempty"`
  3354. // Result: A summary of the outcome of this inspect job.
  3355. Result *GooglePrivacyDlpV2Result `json:"result,omitempty"`
  3356. // ForceSendFields is a list of field names (e.g. "RequestedOptions") to
  3357. // unconditionally include in API requests. By default, fields with
  3358. // empty values are omitted from API requests. However, any non-pointer,
  3359. // non-interface field appearing in ForceSendFields will be sent to the
  3360. // server regardless of whether the field is empty or not. This may be
  3361. // used to include empty fields in Patch requests.
  3362. ForceSendFields []string `json:"-"`
  3363. // NullFields is a list of field names (e.g. "RequestedOptions") to
  3364. // include in API requests with the JSON null value. By default, fields
  3365. // with empty values are omitted from API requests. However, any field
  3366. // with an empty value appearing in NullFields will be sent to the
  3367. // server as null. It is an error if a field in this list has a
  3368. // non-empty value. This may be used to include null fields in Patch
  3369. // requests.
  3370. NullFields []string `json:"-"`
  3371. }
  3372. func (s *GooglePrivacyDlpV2InspectDataSourceDetails) MarshalJSON() ([]byte, error) {
  3373. type NoMethod GooglePrivacyDlpV2InspectDataSourceDetails
  3374. raw := NoMethod(*s)
  3375. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3376. }
  3377. type GooglePrivacyDlpV2InspectJobConfig struct {
  3378. // Actions: Actions to execute at the completion of the job. Are
  3379. // executed in the order
  3380. // provided.
  3381. Actions []*GooglePrivacyDlpV2Action `json:"actions,omitempty"`
  3382. // InspectConfig: How and what to scan for.
  3383. InspectConfig *GooglePrivacyDlpV2InspectConfig `json:"inspectConfig,omitempty"`
  3384. // InspectTemplateName: If provided, will be used as the default for all
  3385. // values in InspectConfig.
  3386. // `inspect_config` will be merged into the values persisted as part of
  3387. // the
  3388. // template.
  3389. InspectTemplateName string `json:"inspectTemplateName,omitempty"`
  3390. // StorageConfig: The data to scan.
  3391. StorageConfig *GooglePrivacyDlpV2StorageConfig `json:"storageConfig,omitempty"`
  3392. // ForceSendFields is a list of field names (e.g. "Actions") to
  3393. // unconditionally include in API requests. By default, fields with
  3394. // empty values are omitted from API requests. However, any non-pointer,
  3395. // non-interface field appearing in ForceSendFields will be sent to the
  3396. // server regardless of whether the field is empty or not. This may be
  3397. // used to include empty fields in Patch requests.
  3398. ForceSendFields []string `json:"-"`
  3399. // NullFields is a list of field names (e.g. "Actions") to include in
  3400. // API requests with the JSON null value. By default, fields with empty
  3401. // values are omitted from API requests. However, any field with an
  3402. // empty value appearing in NullFields will be sent to the server as
  3403. // null. It is an error if a field in this list has a non-empty value.
  3404. // This may be used to include null fields in Patch requests.
  3405. NullFields []string `json:"-"`
  3406. }
  3407. func (s *GooglePrivacyDlpV2InspectJobConfig) MarshalJSON() ([]byte, error) {
  3408. type NoMethod GooglePrivacyDlpV2InspectJobConfig
  3409. raw := NoMethod(*s)
  3410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3411. }
  3412. // GooglePrivacyDlpV2InspectResult: All the findings for a single
  3413. // scanned item.
  3414. type GooglePrivacyDlpV2InspectResult struct {
  3415. // Findings: List of findings for an item.
  3416. Findings []*GooglePrivacyDlpV2Finding `json:"findings,omitempty"`
  3417. // FindingsTruncated: If true, then this item might have more findings
  3418. // than were returned,
  3419. // and the findings returned are an arbitrary subset of all
  3420. // findings.
  3421. // The findings list might be truncated because the input items were
  3422. // too
  3423. // large, or because the server reached the maximum amount of
  3424. // resources
  3425. // allowed for a single API call. For best results, divide the input
  3426. // into
  3427. // smaller batches.
  3428. FindingsTruncated bool `json:"findingsTruncated,omitempty"`
  3429. // ForceSendFields is a list of field names (e.g. "Findings") to
  3430. // unconditionally include in API requests. By default, fields with
  3431. // empty values are omitted from API requests. However, any non-pointer,
  3432. // non-interface field appearing in ForceSendFields will be sent to the
  3433. // server regardless of whether the field is empty or not. This may be
  3434. // used to include empty fields in Patch requests.
  3435. ForceSendFields []string `json:"-"`
  3436. // NullFields is a list of field names (e.g. "Findings") to include in
  3437. // API requests with the JSON null value. By default, fields with empty
  3438. // values are omitted from API requests. However, any field with an
  3439. // empty value appearing in NullFields will be sent to the server as
  3440. // null. It is an error if a field in this list has a non-empty value.
  3441. // This may be used to include null fields in Patch requests.
  3442. NullFields []string `json:"-"`
  3443. }
  3444. func (s *GooglePrivacyDlpV2InspectResult) MarshalJSON() ([]byte, error) {
  3445. type NoMethod GooglePrivacyDlpV2InspectResult
  3446. raw := NoMethod(*s)
  3447. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3448. }
  3449. // GooglePrivacyDlpV2InspectTemplate: The inspectTemplate contains a
  3450. // configuration (set of types of sensitive data
  3451. // to be detected) to be used anywhere you otherwise would normally
  3452. // specify
  3453. // InspectConfig. See
  3454. // https://cloud.google.com/dlp/docs/concepts-templates
  3455. // to learn more.
  3456. type GooglePrivacyDlpV2InspectTemplate struct {
  3457. // CreateTime: The creation timestamp of a inspectTemplate, output only
  3458. // field.
  3459. CreateTime string `json:"createTime,omitempty"`
  3460. // Description: Short description (max 256 chars).
  3461. Description string `json:"description,omitempty"`
  3462. // DisplayName: Display name (max 256 chars).
  3463. DisplayName string `json:"displayName,omitempty"`
  3464. // InspectConfig: The core content of the template. Configuration of the
  3465. // scanning process.
  3466. InspectConfig *GooglePrivacyDlpV2InspectConfig `json:"inspectConfig,omitempty"`
  3467. // Name: The template name. Output only.
  3468. //
  3469. // The template will have one of the following
  3470. // formats:
  3471. // `projects/PROJECT_ID/inspectTemplates/TEMPLATE_ID`
  3472. // OR
  3473. // `organizations/ORGANIZATION_ID/inspectTemplates/TEMPLATE_ID`
  3474. Name string `json:"name,omitempty"`
  3475. // UpdateTime: The last update timestamp of a inspectTemplate, output
  3476. // only field.
  3477. UpdateTime string `json:"updateTime,omitempty"`
  3478. // ServerResponse contains the HTTP response code and headers from the
  3479. // server.
  3480. googleapi.ServerResponse `json:"-"`
  3481. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  3482. // unconditionally include in API requests. By default, fields with
  3483. // empty values are omitted from API requests. However, any non-pointer,
  3484. // non-interface field appearing in ForceSendFields will be sent to the
  3485. // server regardless of whether the field is empty or not. This may be
  3486. // used to include empty fields in Patch requests.
  3487. ForceSendFields []string `json:"-"`
  3488. // NullFields is a list of field names (e.g. "CreateTime") to include in
  3489. // API requests with the JSON null value. By default, fields with empty
  3490. // values are omitted from API requests. However, any field with an
  3491. // empty value appearing in NullFields will be sent to the server as
  3492. // null. It is an error if a field in this list has a non-empty value.
  3493. // This may be used to include null fields in Patch requests.
  3494. NullFields []string `json:"-"`
  3495. }
  3496. func (s *GooglePrivacyDlpV2InspectTemplate) MarshalJSON() ([]byte, error) {
  3497. type NoMethod GooglePrivacyDlpV2InspectTemplate
  3498. raw := NoMethod(*s)
  3499. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3500. }
  3501. // GooglePrivacyDlpV2InspectionRule: A single inspection rule to be
  3502. // applied to infoTypes, specified in
  3503. // `InspectionRuleSet`.
  3504. type GooglePrivacyDlpV2InspectionRule struct {
  3505. // ExclusionRule: Exclusion rule.
  3506. ExclusionRule *GooglePrivacyDlpV2ExclusionRule `json:"exclusionRule,omitempty"`
  3507. // HotwordRule: Hotword-based detection rule.
  3508. HotwordRule *GooglePrivacyDlpV2HotwordRule `json:"hotwordRule,omitempty"`
  3509. // ForceSendFields is a list of field names (e.g. "ExclusionRule") to
  3510. // unconditionally include in API requests. By default, fields with
  3511. // empty values are omitted from API requests. However, any non-pointer,
  3512. // non-interface field appearing in ForceSendFields will be sent to the
  3513. // server regardless of whether the field is empty or not. This may be
  3514. // used to include empty fields in Patch requests.
  3515. ForceSendFields []string `json:"-"`
  3516. // NullFields is a list of field names (e.g. "ExclusionRule") to include
  3517. // in API requests with the JSON null value. By default, fields with
  3518. // empty values are omitted from API requests. However, any field with
  3519. // an empty value appearing in NullFields will be sent to the server as
  3520. // null. It is an error if a field in this list has a non-empty value.
  3521. // This may be used to include null fields in Patch requests.
  3522. NullFields []string `json:"-"`
  3523. }
  3524. func (s *GooglePrivacyDlpV2InspectionRule) MarshalJSON() ([]byte, error) {
  3525. type NoMethod GooglePrivacyDlpV2InspectionRule
  3526. raw := NoMethod(*s)
  3527. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3528. }
  3529. // GooglePrivacyDlpV2InspectionRuleSet: Rule set for modifying a set of
  3530. // infoTypes to alter behavior under certain
  3531. // circumstances, depending on the specific details of the rules within
  3532. // the set.
  3533. type GooglePrivacyDlpV2InspectionRuleSet struct {
  3534. // InfoTypes: List of infoTypes this rule set is applied to.
  3535. InfoTypes []*GooglePrivacyDlpV2InfoType `json:"infoTypes,omitempty"`
  3536. // Rules: Set of rules to be applied to infoTypes. The rules are applied
  3537. // in order.
  3538. Rules []*GooglePrivacyDlpV2InspectionRule `json:"rules,omitempty"`
  3539. // ForceSendFields is a list of field names (e.g. "InfoTypes") to
  3540. // unconditionally include in API requests. By default, fields with
  3541. // empty values are omitted from API requests. However, any non-pointer,
  3542. // non-interface field appearing in ForceSendFields will be sent to the
  3543. // server regardless of whether the field is empty or not. This may be
  3544. // used to include empty fields in Patch requests.
  3545. ForceSendFields []string `json:"-"`
  3546. // NullFields is a list of field names (e.g. "InfoTypes") to include in
  3547. // API requests with the JSON null value. By default, fields with empty
  3548. // values are omitted from API requests. However, any field with an
  3549. // empty value appearing in NullFields will be sent to the server as
  3550. // null. It is an error if a field in this list has a non-empty value.
  3551. // This may be used to include null fields in Patch requests.
  3552. NullFields []string `json:"-"`
  3553. }
  3554. func (s *GooglePrivacyDlpV2InspectionRuleSet) MarshalJSON() ([]byte, error) {
  3555. type NoMethod GooglePrivacyDlpV2InspectionRuleSet
  3556. raw := NoMethod(*s)
  3557. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3558. }
  3559. // GooglePrivacyDlpV2JobNotificationEmails: Enable email notification to
  3560. // project owners and editors on jobs's
  3561. // completion/failure.
  3562. type GooglePrivacyDlpV2JobNotificationEmails struct {
  3563. }
  3564. // GooglePrivacyDlpV2JobTrigger: Contains a configuration to make dlp
  3565. // api calls on a repeating basis.
  3566. // See https://cloud.google.com/dlp/docs/concepts-job-triggers to learn
  3567. // more.
  3568. type GooglePrivacyDlpV2JobTrigger struct {
  3569. // CreateTime: The creation timestamp of a triggeredJob, output only
  3570. // field.
  3571. CreateTime string `json:"createTime,omitempty"`
  3572. // Description: User provided description (max 256 chars)
  3573. Description string `json:"description,omitempty"`
  3574. // DisplayName: Display name (max 100 chars)
  3575. DisplayName string `json:"displayName,omitempty"`
  3576. // Errors: A stream of errors encountered when the trigger was
  3577. // activated. Repeated
  3578. // errors may result in the JobTrigger automatically being paused.
  3579. // Will return the last 100 errors. Whenever the JobTrigger is
  3580. // modified
  3581. // this list will be cleared. Output only field.
  3582. Errors []*GooglePrivacyDlpV2Error `json:"errors,omitempty"`
  3583. InspectJob *GooglePrivacyDlpV2InspectJobConfig `json:"inspectJob,omitempty"`
  3584. // LastRunTime: The timestamp of the last time this trigger executed,
  3585. // output only field.
  3586. LastRunTime string `json:"lastRunTime,omitempty"`
  3587. // Name: Unique resource name for the triggeredJob, assigned by the
  3588. // service when the
  3589. // triggeredJob is created, for
  3590. // example
  3591. // `projects/dlp-test-project/triggeredJobs/53234423`.
  3592. Name string `json:"name,omitempty"`
  3593. // Status: A status for this trigger. [required]
  3594. //
  3595. // Possible values:
  3596. // "STATUS_UNSPECIFIED"
  3597. // "HEALTHY" - Trigger is healthy.
  3598. // "PAUSED" - Trigger is temporarily paused.
  3599. // "CANCELLED" - Trigger is cancelled and can not be resumed.
  3600. Status string `json:"status,omitempty"`
  3601. // Triggers: A list of triggers which will be OR'ed together. Only one
  3602. // in the list
  3603. // needs to trigger for a job to be started. The list may contain only
  3604. // a single Schedule trigger and must have at least one object.
  3605. Triggers []*GooglePrivacyDlpV2Trigger `json:"triggers,omitempty"`
  3606. // UpdateTime: The last update timestamp of a triggeredJob, output only
  3607. // field.
  3608. UpdateTime string `json:"updateTime,omitempty"`
  3609. // ServerResponse contains the HTTP response code and headers from the
  3610. // server.
  3611. googleapi.ServerResponse `json:"-"`
  3612. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  3613. // unconditionally include in API requests. By default, fields with
  3614. // empty values are omitted from API requests. However, any non-pointer,
  3615. // non-interface field appearing in ForceSendFields will be sent to the
  3616. // server regardless of whether the field is empty or not. This may be
  3617. // used to include empty fields in Patch requests.
  3618. ForceSendFields []string `json:"-"`
  3619. // NullFields is a list of field names (e.g. "CreateTime") to include in
  3620. // API requests with the JSON null value. By default, fields with empty
  3621. // values are omitted from API requests. However, any field with an
  3622. // empty value appearing in NullFields will be sent to the server as
  3623. // null. It is an error if a field in this list has a non-empty value.
  3624. // This may be used to include null fields in Patch requests.
  3625. NullFields []string `json:"-"`
  3626. }
  3627. func (s *GooglePrivacyDlpV2JobTrigger) MarshalJSON() ([]byte, error) {
  3628. type NoMethod GooglePrivacyDlpV2JobTrigger
  3629. raw := NoMethod(*s)
  3630. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3631. }
  3632. // GooglePrivacyDlpV2KAnonymityConfig: k-anonymity metric, used for
  3633. // analysis of reidentification risk.
  3634. type GooglePrivacyDlpV2KAnonymityConfig struct {
  3635. // EntityId: Optional message indicating that multiple rows might be
  3636. // associated to a
  3637. // single individual. If the same entity_id is associated to
  3638. // multiple
  3639. // quasi-identifier tuples over distinct rows, we consider the
  3640. // entire
  3641. // collection of tuples as the composite quasi-identifier. This
  3642. // collection
  3643. // is a multiset: the order in which the different tuples appear in
  3644. // the
  3645. // dataset is ignored, but their frequency is taken into
  3646. // account.
  3647. //
  3648. // Important note: a maximum of 1000 rows can be associated to a
  3649. // single
  3650. // entity ID. If more rows are associated with the same entity ID,
  3651. // some
  3652. // might be ignored.
  3653. EntityId *GooglePrivacyDlpV2EntityId `json:"entityId,omitempty"`
  3654. // QuasiIds: Set of fields to compute k-anonymity over. When multiple
  3655. // fields are
  3656. // specified, they are considered a single composite key. Structs
  3657. // and
  3658. // repeated data types are not supported; however, nested fields
  3659. // are
  3660. // supported so long as they are not structs themselves or nested
  3661. // within
  3662. // a repeated field.
  3663. QuasiIds []*GooglePrivacyDlpV2FieldId `json:"quasiIds,omitempty"`
  3664. // ForceSendFields is a list of field names (e.g. "EntityId") to
  3665. // unconditionally include in API requests. By default, fields with
  3666. // empty values are omitted from API requests. However, any non-pointer,
  3667. // non-interface field appearing in ForceSendFields will be sent to the
  3668. // server regardless of whether the field is empty or not. This may be
  3669. // used to include empty fields in Patch requests.
  3670. ForceSendFields []string `json:"-"`
  3671. // NullFields is a list of field names (e.g. "EntityId") to include in
  3672. // API requests with the JSON null value. By default, fields with empty
  3673. // values are omitted from API requests. However, any field with an
  3674. // empty value appearing in NullFields will be sent to the server as
  3675. // null. It is an error if a field in this list has a non-empty value.
  3676. // This may be used to include null fields in Patch requests.
  3677. NullFields []string `json:"-"`
  3678. }
  3679. func (s *GooglePrivacyDlpV2KAnonymityConfig) MarshalJSON() ([]byte, error) {
  3680. type NoMethod GooglePrivacyDlpV2KAnonymityConfig
  3681. raw := NoMethod(*s)
  3682. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3683. }
  3684. // GooglePrivacyDlpV2KAnonymityEquivalenceClass: The set of columns'
  3685. // values that share the same ldiversity value
  3686. type GooglePrivacyDlpV2KAnonymityEquivalenceClass struct {
  3687. // EquivalenceClassSize: Size of the equivalence class, for example
  3688. // number of rows with the
  3689. // above set of values.
  3690. EquivalenceClassSize int64 `json:"equivalenceClassSize,omitempty,string"`
  3691. // QuasiIdsValues: Set of values defining the equivalence class. One
  3692. // value per
  3693. // quasi-identifier column in the original KAnonymity metric
  3694. // message.
  3695. // The order is always the same as the original request.
  3696. QuasiIdsValues []*GooglePrivacyDlpV2Value `json:"quasiIdsValues,omitempty"`
  3697. // ForceSendFields is a list of field names (e.g.
  3698. // "EquivalenceClassSize") to unconditionally include in API requests.
  3699. // By default, fields with empty values are omitted from API requests.
  3700. // However, any non-pointer, non-interface field appearing in
  3701. // ForceSendFields will be sent to the server regardless of whether the
  3702. // field is empty or not. This may be used to include empty fields in
  3703. // Patch requests.
  3704. ForceSendFields []string `json:"-"`
  3705. // NullFields is a list of field names (e.g. "EquivalenceClassSize") to
  3706. // include in API requests with the JSON null value. By default, fields
  3707. // with empty values are omitted from API requests. However, any field
  3708. // with an empty value appearing in NullFields will be sent to the
  3709. // server as null. It is an error if a field in this list has a
  3710. // non-empty value. This may be used to include null fields in Patch
  3711. // requests.
  3712. NullFields []string `json:"-"`
  3713. }
  3714. func (s *GooglePrivacyDlpV2KAnonymityEquivalenceClass) MarshalJSON() ([]byte, error) {
  3715. type NoMethod GooglePrivacyDlpV2KAnonymityEquivalenceClass
  3716. raw := NoMethod(*s)
  3717. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3718. }
  3719. type GooglePrivacyDlpV2KAnonymityHistogramBucket struct {
  3720. // BucketSize: Total number of equivalence classes in this bucket.
  3721. BucketSize int64 `json:"bucketSize,omitempty,string"`
  3722. // BucketValueCount: Total number of distinct equivalence classes in
  3723. // this bucket.
  3724. BucketValueCount int64 `json:"bucketValueCount,omitempty,string"`
  3725. // BucketValues: Sample of equivalence classes in this bucket. The total
  3726. // number of
  3727. // classes returned per bucket is capped at 20.
  3728. BucketValues []*GooglePrivacyDlpV2KAnonymityEquivalenceClass `json:"bucketValues,omitempty"`
  3729. // EquivalenceClassSizeLowerBound: Lower bound on the size of the
  3730. // equivalence classes in this bucket.
  3731. EquivalenceClassSizeLowerBound int64 `json:"equivalenceClassSizeLowerBound,omitempty,string"`
  3732. // EquivalenceClassSizeUpperBound: Upper bound on the size of the
  3733. // equivalence classes in this bucket.
  3734. EquivalenceClassSizeUpperBound int64 `json:"equivalenceClassSizeUpperBound,omitempty,string"`
  3735. // ForceSendFields is a list of field names (e.g. "BucketSize") to
  3736. // unconditionally include in API requests. By default, fields with
  3737. // empty values are omitted from API requests. However, any non-pointer,
  3738. // non-interface field appearing in ForceSendFields will be sent to the
  3739. // server regardless of whether the field is empty or not. This may be
  3740. // used to include empty fields in Patch requests.
  3741. ForceSendFields []string `json:"-"`
  3742. // NullFields is a list of field names (e.g. "BucketSize") to include in
  3743. // API requests with the JSON null value. By default, fields with empty
  3744. // values are omitted from API requests. However, any field with an
  3745. // empty value appearing in NullFields will be sent to the server as
  3746. // null. It is an error if a field in this list has a non-empty value.
  3747. // This may be used to include null fields in Patch requests.
  3748. NullFields []string `json:"-"`
  3749. }
  3750. func (s *GooglePrivacyDlpV2KAnonymityHistogramBucket) MarshalJSON() ([]byte, error) {
  3751. type NoMethod GooglePrivacyDlpV2KAnonymityHistogramBucket
  3752. raw := NoMethod(*s)
  3753. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3754. }
  3755. // GooglePrivacyDlpV2KAnonymityResult: Result of the k-anonymity
  3756. // computation.
  3757. type GooglePrivacyDlpV2KAnonymityResult struct {
  3758. // EquivalenceClassHistogramBuckets: Histogram of k-anonymity
  3759. // equivalence classes.
  3760. EquivalenceClassHistogramBuckets []*GooglePrivacyDlpV2KAnonymityHistogramBucket `json:"equivalenceClassHistogramBuckets,omitempty"`
  3761. // ForceSendFields is a list of field names (e.g.
  3762. // "EquivalenceClassHistogramBuckets") to unconditionally include in API
  3763. // requests. By default, fields with empty values are omitted from API
  3764. // requests. However, any non-pointer, non-interface field appearing in
  3765. // ForceSendFields will be sent to the server regardless of whether the
  3766. // field is empty or not. This may be used to include empty fields in
  3767. // Patch requests.
  3768. ForceSendFields []string `json:"-"`
  3769. // NullFields is a list of field names (e.g.
  3770. // "EquivalenceClassHistogramBuckets") to include in API requests with
  3771. // the JSON null value. By default, fields with empty values are omitted
  3772. // from API requests. However, any field with an empty value appearing
  3773. // in NullFields will be sent to the server as null. It is an error if a
  3774. // field in this list has a non-empty value. This may be used to include
  3775. // null fields in Patch requests.
  3776. NullFields []string `json:"-"`
  3777. }
  3778. func (s *GooglePrivacyDlpV2KAnonymityResult) MarshalJSON() ([]byte, error) {
  3779. type NoMethod GooglePrivacyDlpV2KAnonymityResult
  3780. raw := NoMethod(*s)
  3781. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3782. }
  3783. // GooglePrivacyDlpV2KMapEstimationConfig: Reidentifiability metric.
  3784. // This corresponds to a risk model similar to what
  3785. // is called "journalist risk" in the literature, except the attack
  3786. // dataset is
  3787. // statistically modeled instead of being perfectly known. This can be
  3788. // done
  3789. // using publicly available data (like the US Census), or using a
  3790. // custom
  3791. // statistical model (indicated as one or several BigQuery tables), or
  3792. // by
  3793. // extrapolating from the distribution of values in the input dataset.
  3794. // A column with a semantic tag attached.
  3795. type GooglePrivacyDlpV2KMapEstimationConfig struct {
  3796. // AuxiliaryTables: Several auxiliary tables can be used in the
  3797. // analysis. Each custom_tag
  3798. // used to tag a quasi-identifiers column must appear in exactly one
  3799. // column
  3800. // of one auxiliary table.
  3801. AuxiliaryTables []*GooglePrivacyDlpV2AuxiliaryTable `json:"auxiliaryTables,omitempty"`
  3802. // QuasiIds: Fields considered to be quasi-identifiers. No two columns
  3803. // can have the
  3804. // same tag. [required]
  3805. QuasiIds []*GooglePrivacyDlpV2TaggedField `json:"quasiIds,omitempty"`
  3806. // RegionCode: ISO 3166-1 alpha-2 region code to use in the statistical
  3807. // modeling.
  3808. // Required if no column is tagged with a region-specific InfoType
  3809. // (like
  3810. // US_ZIP_5) or a region code.
  3811. RegionCode string `json:"regionCode,omitempty"`
  3812. // ForceSendFields is a list of field names (e.g. "AuxiliaryTables") to
  3813. // unconditionally include in API requests. By default, fields with
  3814. // empty values are omitted from API requests. However, any non-pointer,
  3815. // non-interface field appearing in ForceSendFields will be sent to the
  3816. // server regardless of whether the field is empty or not. This may be
  3817. // used to include empty fields in Patch requests.
  3818. ForceSendFields []string `json:"-"`
  3819. // NullFields is a list of field names (e.g. "AuxiliaryTables") to
  3820. // include in API requests with the JSON null value. By default, fields
  3821. // with empty values are omitted from API requests. However, any field
  3822. // with an empty value appearing in NullFields will be sent to the
  3823. // server as null. It is an error if a field in this list has a
  3824. // non-empty value. This may be used to include null fields in Patch
  3825. // requests.
  3826. NullFields []string `json:"-"`
  3827. }
  3828. func (s *GooglePrivacyDlpV2KMapEstimationConfig) MarshalJSON() ([]byte, error) {
  3829. type NoMethod GooglePrivacyDlpV2KMapEstimationConfig
  3830. raw := NoMethod(*s)
  3831. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3832. }
  3833. // GooglePrivacyDlpV2KMapEstimationHistogramBucket: A
  3834. // KMapEstimationHistogramBucket message with the following values:
  3835. // min_anonymity: 3
  3836. // max_anonymity: 5
  3837. // frequency: 42
  3838. // means that there are 42 records whose quasi-identifier values
  3839. // correspond
  3840. // to 3, 4 or 5 people in the overlying population. An important
  3841. // particular
  3842. // case is when min_anonymity = max_anonymity = 1: the frequency field
  3843. // then
  3844. // corresponds to the number of uniquely identifiable records.
  3845. type GooglePrivacyDlpV2KMapEstimationHistogramBucket struct {
  3846. // BucketSize: Number of records within these anonymity bounds.
  3847. BucketSize int64 `json:"bucketSize,omitempty,string"`
  3848. // BucketValueCount: Total number of distinct quasi-identifier tuple
  3849. // values in this bucket.
  3850. BucketValueCount int64 `json:"bucketValueCount,omitempty,string"`
  3851. // BucketValues: Sample of quasi-identifier tuple values in this bucket.
  3852. // The total
  3853. // number of classes returned per bucket is capped at 20.
  3854. BucketValues []*GooglePrivacyDlpV2KMapEstimationQuasiIdValues `json:"bucketValues,omitempty"`
  3855. // MaxAnonymity: Always greater than or equal to min_anonymity.
  3856. MaxAnonymity int64 `json:"maxAnonymity,omitempty,string"`
  3857. // MinAnonymity: Always positive.
  3858. MinAnonymity int64 `json:"minAnonymity,omitempty,string"`
  3859. // ForceSendFields is a list of field names (e.g. "BucketSize") to
  3860. // unconditionally include in API requests. By default, fields with
  3861. // empty values are omitted from API requests. However, any non-pointer,
  3862. // non-interface field appearing in ForceSendFields will be sent to the
  3863. // server regardless of whether the field is empty or not. This may be
  3864. // used to include empty fields in Patch requests.
  3865. ForceSendFields []string `json:"-"`
  3866. // NullFields is a list of field names (e.g. "BucketSize") to include in
  3867. // API requests with the JSON null value. By default, fields with empty
  3868. // values are omitted from API requests. However, any field with an
  3869. // empty value appearing in NullFields will be sent to the server as
  3870. // null. It is an error if a field in this list has a non-empty value.
  3871. // This may be used to include null fields in Patch requests.
  3872. NullFields []string `json:"-"`
  3873. }
  3874. func (s *GooglePrivacyDlpV2KMapEstimationHistogramBucket) MarshalJSON() ([]byte, error) {
  3875. type NoMethod GooglePrivacyDlpV2KMapEstimationHistogramBucket
  3876. raw := NoMethod(*s)
  3877. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3878. }
  3879. // GooglePrivacyDlpV2KMapEstimationQuasiIdValues: A tuple of values for
  3880. // the quasi-identifier columns.
  3881. type GooglePrivacyDlpV2KMapEstimationQuasiIdValues struct {
  3882. // EstimatedAnonymity: The estimated anonymity for these
  3883. // quasi-identifier values.
  3884. EstimatedAnonymity int64 `json:"estimatedAnonymity,omitempty,string"`
  3885. // QuasiIdsValues: The quasi-identifier values.
  3886. QuasiIdsValues []*GooglePrivacyDlpV2Value `json:"quasiIdsValues,omitempty"`
  3887. // ForceSendFields is a list of field names (e.g. "EstimatedAnonymity")
  3888. // to unconditionally include in API requests. By default, fields with
  3889. // empty values are omitted from API requests. However, any non-pointer,
  3890. // non-interface field appearing in ForceSendFields will be sent to the
  3891. // server regardless of whether the field is empty or not. This may be
  3892. // used to include empty fields in Patch requests.
  3893. ForceSendFields []string `json:"-"`
  3894. // NullFields is a list of field names (e.g. "EstimatedAnonymity") to
  3895. // include in API requests with the JSON null value. By default, fields
  3896. // with empty values are omitted from API requests. However, any field
  3897. // with an empty value appearing in NullFields will be sent to the
  3898. // server as null. It is an error if a field in this list has a
  3899. // non-empty value. This may be used to include null fields in Patch
  3900. // requests.
  3901. NullFields []string `json:"-"`
  3902. }
  3903. func (s *GooglePrivacyDlpV2KMapEstimationQuasiIdValues) MarshalJSON() ([]byte, error) {
  3904. type NoMethod GooglePrivacyDlpV2KMapEstimationQuasiIdValues
  3905. raw := NoMethod(*s)
  3906. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3907. }
  3908. // GooglePrivacyDlpV2KMapEstimationResult: Result of the
  3909. // reidentifiability analysis. Note that these results are
  3910. // an
  3911. // estimation, not exact values.
  3912. type GooglePrivacyDlpV2KMapEstimationResult struct {
  3913. // KMapEstimationHistogram: The intervals [min_anonymity, max_anonymity]
  3914. // do not overlap. If a value
  3915. // doesn't correspond to any such interval, the associated frequency
  3916. // is
  3917. // zero. For example, the following records:
  3918. // {min_anonymity: 1, max_anonymity: 1, frequency: 17}
  3919. // {min_anonymity: 2, max_anonymity: 3, frequency: 42}
  3920. // {min_anonymity: 5, max_anonymity: 10, frequency: 99}
  3921. // mean that there are no record with an estimated anonymity of 4, 5,
  3922. // or
  3923. // larger than 10.
  3924. KMapEstimationHistogram []*GooglePrivacyDlpV2KMapEstimationHistogramBucket `json:"kMapEstimationHistogram,omitempty"`
  3925. // ForceSendFields is a list of field names (e.g.
  3926. // "KMapEstimationHistogram") to unconditionally include in API
  3927. // requests. By default, fields with empty values are omitted from API
  3928. // requests. However, any non-pointer, non-interface field appearing in
  3929. // ForceSendFields will be sent to the server regardless of whether the
  3930. // field is empty or not. This may be used to include empty fields in
  3931. // Patch requests.
  3932. ForceSendFields []string `json:"-"`
  3933. // NullFields is a list of field names (e.g. "KMapEstimationHistogram")
  3934. // to include in API requests with the JSON null value. By default,
  3935. // fields with empty values are omitted from API requests. However, any
  3936. // field with an empty value appearing in NullFields will be sent to the
  3937. // server as null. It is an error if a field in this list has a
  3938. // non-empty value. This may be used to include null fields in Patch
  3939. // requests.
  3940. NullFields []string `json:"-"`
  3941. }
  3942. func (s *GooglePrivacyDlpV2KMapEstimationResult) MarshalJSON() ([]byte, error) {
  3943. type NoMethod GooglePrivacyDlpV2KMapEstimationResult
  3944. raw := NoMethod(*s)
  3945. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3946. }
  3947. // GooglePrivacyDlpV2Key: A unique identifier for a Datastore entity.
  3948. // If a key's partition ID or any of its path kinds or names
  3949. // are
  3950. // reserved/read-only, the key is reserved/read-only.
  3951. // A reserved/read-only key is forbidden in certain documented contexts.
  3952. type GooglePrivacyDlpV2Key struct {
  3953. // PartitionId: Entities are partitioned into subsets, currently
  3954. // identified by a project
  3955. // ID and namespace ID.
  3956. // Queries are scoped to a single partition.
  3957. PartitionId *GooglePrivacyDlpV2PartitionId `json:"partitionId,omitempty"`
  3958. // Path: The entity path.
  3959. // An entity path consists of one or more elements composed of a kind
  3960. // and a
  3961. // string or numerical identifier, which identify entities. The
  3962. // first
  3963. // element identifies a _root entity_, the second element identifies
  3964. // a _child_ of the root entity, the third element identifies a child of
  3965. // the
  3966. // second entity, and so forth. The entities identified by all prefixes
  3967. // of
  3968. // the path are called the element's _ancestors_.
  3969. //
  3970. // A path can never be empty, and a path can have at most 100 elements.
  3971. Path []*GooglePrivacyDlpV2PathElement `json:"path,omitempty"`
  3972. // ForceSendFields is a list of field names (e.g. "PartitionId") to
  3973. // unconditionally include in API requests. By default, fields with
  3974. // empty values are omitted from API requests. However, any non-pointer,
  3975. // non-interface field appearing in ForceSendFields will be sent to the
  3976. // server regardless of whether the field is empty or not. This may be
  3977. // used to include empty fields in Patch requests.
  3978. ForceSendFields []string `json:"-"`
  3979. // NullFields is a list of field names (e.g. "PartitionId") to include
  3980. // in API requests with the JSON null value. By default, fields with
  3981. // empty values are omitted from API requests. However, any field with
  3982. // an empty value appearing in NullFields will be sent to the server as
  3983. // null. It is an error if a field in this list has a non-empty value.
  3984. // This may be used to include null fields in Patch requests.
  3985. NullFields []string `json:"-"`
  3986. }
  3987. func (s *GooglePrivacyDlpV2Key) MarshalJSON() ([]byte, error) {
  3988. type NoMethod GooglePrivacyDlpV2Key
  3989. raw := NoMethod(*s)
  3990. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3991. }
  3992. // GooglePrivacyDlpV2KindExpression: A representation of a Datastore
  3993. // kind.
  3994. type GooglePrivacyDlpV2KindExpression struct {
  3995. // Name: The name of the kind.
  3996. Name string `json:"name,omitempty"`
  3997. // ForceSendFields is a list of field names (e.g. "Name") to
  3998. // unconditionally include in API requests. By default, fields with
  3999. // empty values are omitted from API requests. However, any non-pointer,
  4000. // non-interface field appearing in ForceSendFields will be sent to the
  4001. // server regardless of whether the field is empty or not. This may be
  4002. // used to include empty fields in Patch requests.
  4003. ForceSendFields []string `json:"-"`
  4004. // NullFields is a list of field names (e.g. "Name") to include in API
  4005. // requests with the JSON null value. By default, fields with empty
  4006. // values are omitted from API requests. However, any field with an
  4007. // empty value appearing in NullFields will be sent to the server as
  4008. // null. It is an error if a field in this list has a non-empty value.
  4009. // This may be used to include null fields in Patch requests.
  4010. NullFields []string `json:"-"`
  4011. }
  4012. func (s *GooglePrivacyDlpV2KindExpression) MarshalJSON() ([]byte, error) {
  4013. type NoMethod GooglePrivacyDlpV2KindExpression
  4014. raw := NoMethod(*s)
  4015. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4016. }
  4017. // GooglePrivacyDlpV2KmsWrappedCryptoKey: Include to use an existing
  4018. // data crypto key wrapped by KMS.
  4019. // The wrapped key must be a 128/192/256 bit key.
  4020. // Authorization requires the following IAM permissions when sending a
  4021. // request
  4022. // to perform a crypto transformation using a kms-wrapped crypto
  4023. // key:
  4024. // dlp.kms.encrypt
  4025. type GooglePrivacyDlpV2KmsWrappedCryptoKey struct {
  4026. // CryptoKeyName: The resource name of the KMS CryptoKey to use for
  4027. // unwrapping. [required]
  4028. CryptoKeyName string `json:"cryptoKeyName,omitempty"`
  4029. // WrappedKey: The wrapped data crypto key. [required]
  4030. WrappedKey string `json:"wrappedKey,omitempty"`
  4031. // ForceSendFields is a list of field names (e.g. "CryptoKeyName") to
  4032. // unconditionally include in API requests. By default, fields with
  4033. // empty values are omitted from API requests. However, any non-pointer,
  4034. // non-interface field appearing in ForceSendFields will be sent to the
  4035. // server regardless of whether the field is empty or not. This may be
  4036. // used to include empty fields in Patch requests.
  4037. ForceSendFields []string `json:"-"`
  4038. // NullFields is a list of field names (e.g. "CryptoKeyName") to include
  4039. // in API requests with the JSON null value. By default, fields with
  4040. // empty values are omitted from API requests. However, any field with
  4041. // an empty value appearing in NullFields will be sent to the server as
  4042. // null. It is an error if a field in this list has a non-empty value.
  4043. // This may be used to include null fields in Patch requests.
  4044. NullFields []string `json:"-"`
  4045. }
  4046. func (s *GooglePrivacyDlpV2KmsWrappedCryptoKey) MarshalJSON() ([]byte, error) {
  4047. type NoMethod GooglePrivacyDlpV2KmsWrappedCryptoKey
  4048. raw := NoMethod(*s)
  4049. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4050. }
  4051. // GooglePrivacyDlpV2LDiversityConfig: l-diversity metric, used for
  4052. // analysis of reidentification risk.
  4053. type GooglePrivacyDlpV2LDiversityConfig struct {
  4054. // QuasiIds: Set of quasi-identifiers indicating how equivalence classes
  4055. // are
  4056. // defined for the l-diversity computation. When multiple fields
  4057. // are
  4058. // specified, they are considered a single composite key.
  4059. QuasiIds []*GooglePrivacyDlpV2FieldId `json:"quasiIds,omitempty"`
  4060. // SensitiveAttribute: Sensitive field for computing the l-value.
  4061. SensitiveAttribute *GooglePrivacyDlpV2FieldId `json:"sensitiveAttribute,omitempty"`
  4062. // ForceSendFields is a list of field names (e.g. "QuasiIds") to
  4063. // unconditionally include in API requests. By default, fields with
  4064. // empty values are omitted from API requests. However, any non-pointer,
  4065. // non-interface field appearing in ForceSendFields will be sent to the
  4066. // server regardless of whether the field is empty or not. This may be
  4067. // used to include empty fields in Patch requests.
  4068. ForceSendFields []string `json:"-"`
  4069. // NullFields is a list of field names (e.g. "QuasiIds") to include in
  4070. // API requests with the JSON null value. By default, fields with empty
  4071. // values are omitted from API requests. However, any field with an
  4072. // empty value appearing in NullFields will be sent to the server as
  4073. // null. It is an error if a field in this list has a non-empty value.
  4074. // This may be used to include null fields in Patch requests.
  4075. NullFields []string `json:"-"`
  4076. }
  4077. func (s *GooglePrivacyDlpV2LDiversityConfig) MarshalJSON() ([]byte, error) {
  4078. type NoMethod GooglePrivacyDlpV2LDiversityConfig
  4079. raw := NoMethod(*s)
  4080. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4081. }
  4082. // GooglePrivacyDlpV2LDiversityEquivalenceClass: The set of columns'
  4083. // values that share the same ldiversity value.
  4084. type GooglePrivacyDlpV2LDiversityEquivalenceClass struct {
  4085. // EquivalenceClassSize: Size of the k-anonymity equivalence class.
  4086. EquivalenceClassSize int64 `json:"equivalenceClassSize,omitempty,string"`
  4087. // NumDistinctSensitiveValues: Number of distinct sensitive values in
  4088. // this equivalence class.
  4089. NumDistinctSensitiveValues int64 `json:"numDistinctSensitiveValues,omitempty,string"`
  4090. // QuasiIdsValues: Quasi-identifier values defining the k-anonymity
  4091. // equivalence
  4092. // class. The order is always the same as the original request.
  4093. QuasiIdsValues []*GooglePrivacyDlpV2Value `json:"quasiIdsValues,omitempty"`
  4094. // TopSensitiveValues: Estimated frequencies of top sensitive values.
  4095. TopSensitiveValues []*GooglePrivacyDlpV2ValueFrequency `json:"topSensitiveValues,omitempty"`
  4096. // ForceSendFields is a list of field names (e.g.
  4097. // "EquivalenceClassSize") to unconditionally include in API requests.
  4098. // By default, fields with empty values are omitted from API requests.
  4099. // However, any non-pointer, non-interface field appearing in
  4100. // ForceSendFields will be sent to the server regardless of whether the
  4101. // field is empty or not. This may be used to include empty fields in
  4102. // Patch requests.
  4103. ForceSendFields []string `json:"-"`
  4104. // NullFields is a list of field names (e.g. "EquivalenceClassSize") to
  4105. // include in API requests with the JSON null value. By default, fields
  4106. // with empty values are omitted from API requests. However, any field
  4107. // with an empty value appearing in NullFields will be sent to the
  4108. // server as null. It is an error if a field in this list has a
  4109. // non-empty value. This may be used to include null fields in Patch
  4110. // requests.
  4111. NullFields []string `json:"-"`
  4112. }
  4113. func (s *GooglePrivacyDlpV2LDiversityEquivalenceClass) MarshalJSON() ([]byte, error) {
  4114. type NoMethod GooglePrivacyDlpV2LDiversityEquivalenceClass
  4115. raw := NoMethod(*s)
  4116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4117. }
  4118. type GooglePrivacyDlpV2LDiversityHistogramBucket struct {
  4119. // BucketSize: Total number of equivalence classes in this bucket.
  4120. BucketSize int64 `json:"bucketSize,omitempty,string"`
  4121. // BucketValueCount: Total number of distinct equivalence classes in
  4122. // this bucket.
  4123. BucketValueCount int64 `json:"bucketValueCount,omitempty,string"`
  4124. // BucketValues: Sample of equivalence classes in this bucket. The total
  4125. // number of
  4126. // classes returned per bucket is capped at 20.
  4127. BucketValues []*GooglePrivacyDlpV2LDiversityEquivalenceClass `json:"bucketValues,omitempty"`
  4128. // SensitiveValueFrequencyLowerBound: Lower bound on the sensitive value
  4129. // frequencies of the equivalence
  4130. // classes in this bucket.
  4131. SensitiveValueFrequencyLowerBound int64 `json:"sensitiveValueFrequencyLowerBound,omitempty,string"`
  4132. // SensitiveValueFrequencyUpperBound: Upper bound on the sensitive value
  4133. // frequencies of the equivalence
  4134. // classes in this bucket.
  4135. SensitiveValueFrequencyUpperBound int64 `json:"sensitiveValueFrequencyUpperBound,omitempty,string"`
  4136. // ForceSendFields is a list of field names (e.g. "BucketSize") to
  4137. // unconditionally include in API requests. By default, fields with
  4138. // empty values are omitted from API requests. However, any non-pointer,
  4139. // non-interface field appearing in ForceSendFields will be sent to the
  4140. // server regardless of whether the field is empty or not. This may be
  4141. // used to include empty fields in Patch requests.
  4142. ForceSendFields []string `json:"-"`
  4143. // NullFields is a list of field names (e.g. "BucketSize") to include in
  4144. // API requests with the JSON null value. By default, fields with empty
  4145. // values are omitted from API requests. However, any field with an
  4146. // empty value appearing in NullFields will be sent to the server as
  4147. // null. It is an error if a field in this list has a non-empty value.
  4148. // This may be used to include null fields in Patch requests.
  4149. NullFields []string `json:"-"`
  4150. }
  4151. func (s *GooglePrivacyDlpV2LDiversityHistogramBucket) MarshalJSON() ([]byte, error) {
  4152. type NoMethod GooglePrivacyDlpV2LDiversityHistogramBucket
  4153. raw := NoMethod(*s)
  4154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4155. }
  4156. // GooglePrivacyDlpV2LDiversityResult: Result of the l-diversity
  4157. // computation.
  4158. type GooglePrivacyDlpV2LDiversityResult struct {
  4159. // SensitiveValueFrequencyHistogramBuckets: Histogram of l-diversity
  4160. // equivalence class sensitive value frequencies.
  4161. SensitiveValueFrequencyHistogramBuckets []*GooglePrivacyDlpV2LDiversityHistogramBucket `json:"sensitiveValueFrequencyHistogramBuckets,omitempty"`
  4162. // ForceSendFields is a list of field names (e.g.
  4163. // "SensitiveValueFrequencyHistogramBuckets") to unconditionally include
  4164. // in API requests. By default, fields with empty values are omitted
  4165. // from API requests. However, any non-pointer, non-interface field
  4166. // appearing in ForceSendFields will be sent to the server regardless of
  4167. // whether the field is empty or not. This may be used to include empty
  4168. // fields in Patch requests.
  4169. ForceSendFields []string `json:"-"`
  4170. // NullFields is a list of field names (e.g.
  4171. // "SensitiveValueFrequencyHistogramBuckets") to include in API requests
  4172. // with the JSON null value. By default, fields with empty values are
  4173. // omitted from API requests. However, any field with an empty value
  4174. // appearing in NullFields will be sent to the server as null. It is an
  4175. // error if a field in this list has a non-empty value. This may be used
  4176. // to include null fields in Patch requests.
  4177. NullFields []string `json:"-"`
  4178. }
  4179. func (s *GooglePrivacyDlpV2LDiversityResult) MarshalJSON() ([]byte, error) {
  4180. type NoMethod GooglePrivacyDlpV2LDiversityResult
  4181. raw := NoMethod(*s)
  4182. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4183. }
  4184. // GooglePrivacyDlpV2LargeCustomDictionaryConfig: Configuration for a
  4185. // custom dictionary created from a data source of any size
  4186. // up to the maximum size defined in
  4187. // the
  4188. // [limits](https://cloud.google.com/dlp/limits) page. The artifacts
  4189. // of
  4190. // dictionary creation are stored in the specified Google Cloud
  4191. // Storage
  4192. // location. Consider using `CustomInfoType.Dictionary` for smaller
  4193. // dictionaries
  4194. // that satisfy the size requirements.
  4195. type GooglePrivacyDlpV2LargeCustomDictionaryConfig struct {
  4196. // BigQueryField: Field in a BigQuery table where each cell represents a
  4197. // dictionary phrase.
  4198. BigQueryField *GooglePrivacyDlpV2BigQueryField `json:"bigQueryField,omitempty"`
  4199. // CloudStorageFileSet: Set of files containing newline-delimited lists
  4200. // of dictionary phrases.
  4201. CloudStorageFileSet *GooglePrivacyDlpV2CloudStorageFileSet `json:"cloudStorageFileSet,omitempty"`
  4202. // OutputPath: Location to store dictionary artifacts in Google Cloud
  4203. // Storage. These files
  4204. // will only be accessible by project owners and the DLP API. If any of
  4205. // these
  4206. // artifacts are modified, the dictionary is considered invalid and can
  4207. // no
  4208. // longer be used.
  4209. OutputPath *GooglePrivacyDlpV2CloudStoragePath `json:"outputPath,omitempty"`
  4210. // ForceSendFields is a list of field names (e.g. "BigQueryField") to
  4211. // unconditionally include in API requests. By default, fields with
  4212. // empty values are omitted from API requests. However, any non-pointer,
  4213. // non-interface field appearing in ForceSendFields will be sent to the
  4214. // server regardless of whether the field is empty or not. This may be
  4215. // used to include empty fields in Patch requests.
  4216. ForceSendFields []string `json:"-"`
  4217. // NullFields is a list of field names (e.g. "BigQueryField") to include
  4218. // in API requests with the JSON null value. By default, fields with
  4219. // empty values are omitted from API requests. However, any field with
  4220. // an empty value appearing in NullFields will be sent to the server as
  4221. // null. It is an error if a field in this list has a non-empty value.
  4222. // This may be used to include null fields in Patch requests.
  4223. NullFields []string `json:"-"`
  4224. }
  4225. func (s *GooglePrivacyDlpV2LargeCustomDictionaryConfig) MarshalJSON() ([]byte, error) {
  4226. type NoMethod GooglePrivacyDlpV2LargeCustomDictionaryConfig
  4227. raw := NoMethod(*s)
  4228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4229. }
  4230. // GooglePrivacyDlpV2LikelihoodAdjustment: Message for specifying an
  4231. // adjustment to the likelihood of a finding as
  4232. // part of a detection rule.
  4233. type GooglePrivacyDlpV2LikelihoodAdjustment struct {
  4234. // FixedLikelihood: Set the likelihood of a finding to a fixed value.
  4235. //
  4236. // Possible values:
  4237. // "LIKELIHOOD_UNSPECIFIED" - Default value; same as POSSIBLE.
  4238. // "VERY_UNLIKELY" - Few matching elements.
  4239. // "UNLIKELY"
  4240. // "POSSIBLE" - Some matching elements.
  4241. // "LIKELY"
  4242. // "VERY_LIKELY" - Many matching elements.
  4243. FixedLikelihood string `json:"fixedLikelihood,omitempty"`
  4244. // RelativeLikelihood: Increase or decrease the likelihood by the
  4245. // specified number of
  4246. // levels. For example, if a finding would be `POSSIBLE` without
  4247. // the
  4248. // detection rule and `relative_likelihood` is 1, then it is upgraded
  4249. // to
  4250. // `LIKELY`, while a value of -1 would downgrade it to
  4251. // `UNLIKELY`.
  4252. // Likelihood may never drop below `VERY_UNLIKELY` or
  4253. // exceed
  4254. // `VERY_LIKELY`, so applying an adjustment of 1 followed by
  4255. // an
  4256. // adjustment of -1 when base likelihood is `VERY_LIKELY` will result
  4257. // in
  4258. // a final likelihood of `LIKELY`.
  4259. RelativeLikelihood int64 `json:"relativeLikelihood,omitempty"`
  4260. // ForceSendFields is a list of field names (e.g. "FixedLikelihood") to
  4261. // unconditionally include in API requests. By default, fields with
  4262. // empty values are omitted from API requests. However, any non-pointer,
  4263. // non-interface field appearing in ForceSendFields will be sent to the
  4264. // server regardless of whether the field is empty or not. This may be
  4265. // used to include empty fields in Patch requests.
  4266. ForceSendFields []string `json:"-"`
  4267. // NullFields is a list of field names (e.g. "FixedLikelihood") to
  4268. // include in API requests with the JSON null value. By default, fields
  4269. // with empty values are omitted from API requests. However, any field
  4270. // with an empty value appearing in NullFields will be sent to the
  4271. // server as null. It is an error if a field in this list has a
  4272. // non-empty value. This may be used to include null fields in Patch
  4273. // requests.
  4274. NullFields []string `json:"-"`
  4275. }
  4276. func (s *GooglePrivacyDlpV2LikelihoodAdjustment) MarshalJSON() ([]byte, error) {
  4277. type NoMethod GooglePrivacyDlpV2LikelihoodAdjustment
  4278. raw := NoMethod(*s)
  4279. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4280. }
  4281. // GooglePrivacyDlpV2ListDeidentifyTemplatesResponse: Response message
  4282. // for ListDeidentifyTemplates.
  4283. type GooglePrivacyDlpV2ListDeidentifyTemplatesResponse struct {
  4284. // DeidentifyTemplates: List of deidentify templates, up to page_size
  4285. // in
  4286. // ListDeidentifyTemplatesRequest.
  4287. DeidentifyTemplates []*GooglePrivacyDlpV2DeidentifyTemplate `json:"deidentifyTemplates,omitempty"`
  4288. // NextPageToken: If the next page is available then the next page token
  4289. // to be used
  4290. // in following ListDeidentifyTemplates request.
  4291. NextPageToken string `json:"nextPageToken,omitempty"`
  4292. // ServerResponse contains the HTTP response code and headers from the
  4293. // server.
  4294. googleapi.ServerResponse `json:"-"`
  4295. // ForceSendFields is a list of field names (e.g. "DeidentifyTemplates")
  4296. // to unconditionally include in API requests. By default, fields with
  4297. // empty values are omitted from API requests. However, any non-pointer,
  4298. // non-interface field appearing in ForceSendFields will be sent to the
  4299. // server regardless of whether the field is empty or not. This may be
  4300. // used to include empty fields in Patch requests.
  4301. ForceSendFields []string `json:"-"`
  4302. // NullFields is a list of field names (e.g. "DeidentifyTemplates") to
  4303. // include in API requests with the JSON null value. By default, fields
  4304. // with empty values are omitted from API requests. However, any field
  4305. // with an empty value appearing in NullFields will be sent to the
  4306. // server as null. It is an error if a field in this list has a
  4307. // non-empty value. This may be used to include null fields in Patch
  4308. // requests.
  4309. NullFields []string `json:"-"`
  4310. }
  4311. func (s *GooglePrivacyDlpV2ListDeidentifyTemplatesResponse) MarshalJSON() ([]byte, error) {
  4312. type NoMethod GooglePrivacyDlpV2ListDeidentifyTemplatesResponse
  4313. raw := NoMethod(*s)
  4314. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4315. }
  4316. // GooglePrivacyDlpV2ListDlpJobsResponse: The response message for
  4317. // listing DLP jobs.
  4318. type GooglePrivacyDlpV2ListDlpJobsResponse struct {
  4319. // Jobs: A list of DlpJobs that matches the specified filter in the
  4320. // request.
  4321. Jobs []*GooglePrivacyDlpV2DlpJob `json:"jobs,omitempty"`
  4322. // NextPageToken: The standard List next-page token.
  4323. NextPageToken string `json:"nextPageToken,omitempty"`
  4324. // ServerResponse contains the HTTP response code and headers from the
  4325. // server.
  4326. googleapi.ServerResponse `json:"-"`
  4327. // ForceSendFields is a list of field names (e.g. "Jobs") to
  4328. // unconditionally include in API requests. By default, fields with
  4329. // empty values are omitted from API requests. However, any non-pointer,
  4330. // non-interface field appearing in ForceSendFields will be sent to the
  4331. // server regardless of whether the field is empty or not. This may be
  4332. // used to include empty fields in Patch requests.
  4333. ForceSendFields []string `json:"-"`
  4334. // NullFields is a list of field names (e.g. "Jobs") to include in API
  4335. // requests with the JSON null value. By default, fields with empty
  4336. // values are omitted from API requests. However, any field with an
  4337. // empty value appearing in NullFields will be sent to the server as
  4338. // null. It is an error if a field in this list has a non-empty value.
  4339. // This may be used to include null fields in Patch requests.
  4340. NullFields []string `json:"-"`
  4341. }
  4342. func (s *GooglePrivacyDlpV2ListDlpJobsResponse) MarshalJSON() ([]byte, error) {
  4343. type NoMethod GooglePrivacyDlpV2ListDlpJobsResponse
  4344. raw := NoMethod(*s)
  4345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4346. }
  4347. // GooglePrivacyDlpV2ListInfoTypesResponse: Response to the
  4348. // ListInfoTypes request.
  4349. type GooglePrivacyDlpV2ListInfoTypesResponse struct {
  4350. // InfoTypes: Set of sensitive infoTypes.
  4351. InfoTypes []*GooglePrivacyDlpV2InfoTypeDescription `json:"infoTypes,omitempty"`
  4352. // ServerResponse contains the HTTP response code and headers from the
  4353. // server.
  4354. googleapi.ServerResponse `json:"-"`
  4355. // ForceSendFields is a list of field names (e.g. "InfoTypes") to
  4356. // unconditionally include in API requests. By default, fields with
  4357. // empty values are omitted from API requests. However, any non-pointer,
  4358. // non-interface field appearing in ForceSendFields will be sent to the
  4359. // server regardless of whether the field is empty or not. This may be
  4360. // used to include empty fields in Patch requests.
  4361. ForceSendFields []string `json:"-"`
  4362. // NullFields is a list of field names (e.g. "InfoTypes") to include in
  4363. // API requests with the JSON null value. By default, fields with empty
  4364. // values are omitted from API requests. However, any field with an
  4365. // empty value appearing in NullFields will be sent to the server as
  4366. // null. It is an error if a field in this list has a non-empty value.
  4367. // This may be used to include null fields in Patch requests.
  4368. NullFields []string `json:"-"`
  4369. }
  4370. func (s *GooglePrivacyDlpV2ListInfoTypesResponse) MarshalJSON() ([]byte, error) {
  4371. type NoMethod GooglePrivacyDlpV2ListInfoTypesResponse
  4372. raw := NoMethod(*s)
  4373. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4374. }
  4375. // GooglePrivacyDlpV2ListInspectTemplatesResponse: Response message for
  4376. // ListInspectTemplates.
  4377. type GooglePrivacyDlpV2ListInspectTemplatesResponse struct {
  4378. // InspectTemplates: List of inspectTemplates, up to page_size in
  4379. // ListInspectTemplatesRequest.
  4380. InspectTemplates []*GooglePrivacyDlpV2InspectTemplate `json:"inspectTemplates,omitempty"`
  4381. // NextPageToken: If the next page is available then the next page token
  4382. // to be used
  4383. // in following ListInspectTemplates request.
  4384. NextPageToken string `json:"nextPageToken,omitempty"`
  4385. // ServerResponse contains the HTTP response code and headers from the
  4386. // server.
  4387. googleapi.ServerResponse `json:"-"`
  4388. // ForceSendFields is a list of field names (e.g. "InspectTemplates") to
  4389. // unconditionally include in API requests. By default, fields with
  4390. // empty values are omitted from API requests. However, any non-pointer,
  4391. // non-interface field appearing in ForceSendFields will be sent to the
  4392. // server regardless of whether the field is empty or not. This may be
  4393. // used to include empty fields in Patch requests.
  4394. ForceSendFields []string `json:"-"`
  4395. // NullFields is a list of field names (e.g. "InspectTemplates") to
  4396. // include in API requests with the JSON null value. By default, fields
  4397. // with empty values are omitted from API requests. However, any field
  4398. // with an empty value appearing in NullFields will be sent to the
  4399. // server as null. It is an error if a field in this list has a
  4400. // non-empty value. This may be used to include null fields in Patch
  4401. // requests.
  4402. NullFields []string `json:"-"`
  4403. }
  4404. func (s *GooglePrivacyDlpV2ListInspectTemplatesResponse) MarshalJSON() ([]byte, error) {
  4405. type NoMethod GooglePrivacyDlpV2ListInspectTemplatesResponse
  4406. raw := NoMethod(*s)
  4407. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4408. }
  4409. // GooglePrivacyDlpV2ListJobTriggersResponse: Response message for
  4410. // ListJobTriggers.
  4411. type GooglePrivacyDlpV2ListJobTriggersResponse struct {
  4412. // JobTriggers: List of triggeredJobs, up to page_size in
  4413. // ListJobTriggersRequest.
  4414. JobTriggers []*GooglePrivacyDlpV2JobTrigger `json:"jobTriggers,omitempty"`
  4415. // NextPageToken: If the next page is available then the next page token
  4416. // to be used
  4417. // in following ListJobTriggers request.
  4418. NextPageToken string `json:"nextPageToken,omitempty"`
  4419. // ServerResponse contains the HTTP response code and headers from the
  4420. // server.
  4421. googleapi.ServerResponse `json:"-"`
  4422. // ForceSendFields is a list of field names (e.g. "JobTriggers") to
  4423. // unconditionally include in API requests. By default, fields with
  4424. // empty values are omitted from API requests. However, any non-pointer,
  4425. // non-interface field appearing in ForceSendFields will be sent to the
  4426. // server regardless of whether the field is empty or not. This may be
  4427. // used to include empty fields in Patch requests.
  4428. ForceSendFields []string `json:"-"`
  4429. // NullFields is a list of field names (e.g. "JobTriggers") to include
  4430. // in API requests with the JSON null value. By default, fields with
  4431. // empty values are omitted from API requests. However, any field with
  4432. // an empty value appearing in NullFields will be sent to the server as
  4433. // null. It is an error if a field in this list has a non-empty value.
  4434. // This may be used to include null fields in Patch requests.
  4435. NullFields []string `json:"-"`
  4436. }
  4437. func (s *GooglePrivacyDlpV2ListJobTriggersResponse) MarshalJSON() ([]byte, error) {
  4438. type NoMethod GooglePrivacyDlpV2ListJobTriggersResponse
  4439. raw := NoMethod(*s)
  4440. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4441. }
  4442. // GooglePrivacyDlpV2ListStoredInfoTypesResponse: Response message for
  4443. // ListStoredInfoTypes.
  4444. type GooglePrivacyDlpV2ListStoredInfoTypesResponse struct {
  4445. // NextPageToken: If the next page is available then the next page token
  4446. // to be used
  4447. // in following ListStoredInfoTypes request.
  4448. NextPageToken string `json:"nextPageToken,omitempty"`
  4449. // StoredInfoTypes: List of storedInfoTypes, up to page_size in
  4450. // ListStoredInfoTypesRequest.
  4451. StoredInfoTypes []*GooglePrivacyDlpV2StoredInfoType `json:"storedInfoTypes,omitempty"`
  4452. // ServerResponse contains the HTTP response code and headers from the
  4453. // server.
  4454. googleapi.ServerResponse `json:"-"`
  4455. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  4456. // unconditionally include in API requests. By default, fields with
  4457. // empty values are omitted from API requests. However, any non-pointer,
  4458. // non-interface field appearing in ForceSendFields will be sent to the
  4459. // server regardless of whether the field is empty or not. This may be
  4460. // used to include empty fields in Patch requests.
  4461. ForceSendFields []string `json:"-"`
  4462. // NullFields is a list of field names (e.g. "NextPageToken") to include
  4463. // in API requests with the JSON null value. By default, fields with
  4464. // empty values are omitted from API requests. However, any field with
  4465. // an empty value appearing in NullFields will be sent to the server as
  4466. // null. It is an error if a field in this list has a non-empty value.
  4467. // This may be used to include null fields in Patch requests.
  4468. NullFields []string `json:"-"`
  4469. }
  4470. func (s *GooglePrivacyDlpV2ListStoredInfoTypesResponse) MarshalJSON() ([]byte, error) {
  4471. type NoMethod GooglePrivacyDlpV2ListStoredInfoTypesResponse
  4472. raw := NoMethod(*s)
  4473. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4474. }
  4475. // GooglePrivacyDlpV2Location: Specifies the location of the finding.
  4476. type GooglePrivacyDlpV2Location struct {
  4477. // ByteRange: Zero-based byte offsets delimiting the finding.
  4478. // These are relative to the finding's containing element.
  4479. // Note that when the content is not textual, this references
  4480. // the UTF-8 encoded textual representation of the content.
  4481. // Omitted if content is an image.
  4482. ByteRange *GooglePrivacyDlpV2Range `json:"byteRange,omitempty"`
  4483. // CodepointRange: Unicode character offsets delimiting the
  4484. // finding.
  4485. // These are relative to the finding's containing element.
  4486. // Provided when the content is text.
  4487. CodepointRange *GooglePrivacyDlpV2Range `json:"codepointRange,omitempty"`
  4488. // ContentLocations: List of nested objects pointing to the precise
  4489. // location of the finding
  4490. // within the file or record.
  4491. ContentLocations []*GooglePrivacyDlpV2ContentLocation `json:"contentLocations,omitempty"`
  4492. // ForceSendFields is a list of field names (e.g. "ByteRange") to
  4493. // unconditionally include in API requests. By default, fields with
  4494. // empty values are omitted from API requests. However, any non-pointer,
  4495. // non-interface field appearing in ForceSendFields will be sent to the
  4496. // server regardless of whether the field is empty or not. This may be
  4497. // used to include empty fields in Patch requests.
  4498. ForceSendFields []string `json:"-"`
  4499. // NullFields is a list of field names (e.g. "ByteRange") to include in
  4500. // API requests with the JSON null value. By default, fields with empty
  4501. // values are omitted from API requests. However, any field with an
  4502. // empty value appearing in NullFields will be sent to the server as
  4503. // null. It is an error if a field in this list has a non-empty value.
  4504. // This may be used to include null fields in Patch requests.
  4505. NullFields []string `json:"-"`
  4506. }
  4507. func (s *GooglePrivacyDlpV2Location) MarshalJSON() ([]byte, error) {
  4508. type NoMethod GooglePrivacyDlpV2Location
  4509. raw := NoMethod(*s)
  4510. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4511. }
  4512. // GooglePrivacyDlpV2NumericalStatsConfig: Compute numerical stats over
  4513. // an individual column, including
  4514. // min, max, and quantiles.
  4515. type GooglePrivacyDlpV2NumericalStatsConfig struct {
  4516. // Field: Field to compute numerical stats on. Supported types
  4517. // are
  4518. // integer, float, date, datetime, timestamp, time.
  4519. Field *GooglePrivacyDlpV2FieldId `json:"field,omitempty"`
  4520. // ForceSendFields is a list of field names (e.g. "Field") to
  4521. // unconditionally include in API requests. By default, fields with
  4522. // empty values are omitted from API requests. However, any non-pointer,
  4523. // non-interface field appearing in ForceSendFields will be sent to the
  4524. // server regardless of whether the field is empty or not. This may be
  4525. // used to include empty fields in Patch requests.
  4526. ForceSendFields []string `json:"-"`
  4527. // NullFields is a list of field names (e.g. "Field") to include in API
  4528. // requests with the JSON null value. By default, fields with empty
  4529. // values are omitted from API requests. However, any field with an
  4530. // empty value appearing in NullFields will be sent to the server as
  4531. // null. It is an error if a field in this list has a non-empty value.
  4532. // This may be used to include null fields in Patch requests.
  4533. NullFields []string `json:"-"`
  4534. }
  4535. func (s *GooglePrivacyDlpV2NumericalStatsConfig) MarshalJSON() ([]byte, error) {
  4536. type NoMethod GooglePrivacyDlpV2NumericalStatsConfig
  4537. raw := NoMethod(*s)
  4538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4539. }
  4540. // GooglePrivacyDlpV2NumericalStatsResult: Result of the numerical stats
  4541. // computation.
  4542. type GooglePrivacyDlpV2NumericalStatsResult struct {
  4543. // MaxValue: Maximum value appearing in the column.
  4544. MaxValue *GooglePrivacyDlpV2Value `json:"maxValue,omitempty"`
  4545. // MinValue: Minimum value appearing in the column.
  4546. MinValue *GooglePrivacyDlpV2Value `json:"minValue,omitempty"`
  4547. // QuantileValues: List of 99 values that partition the set of field
  4548. // values into 100 equal
  4549. // sized buckets.
  4550. QuantileValues []*GooglePrivacyDlpV2Value `json:"quantileValues,omitempty"`
  4551. // ForceSendFields is a list of field names (e.g. "MaxValue") to
  4552. // unconditionally include in API requests. By default, fields with
  4553. // empty values are omitted from API requests. However, any non-pointer,
  4554. // non-interface field appearing in ForceSendFields will be sent to the
  4555. // server regardless of whether the field is empty or not. This may be
  4556. // used to include empty fields in Patch requests.
  4557. ForceSendFields []string `json:"-"`
  4558. // NullFields is a list of field names (e.g. "MaxValue") to include in
  4559. // API requests with the JSON null value. By default, fields with empty
  4560. // values are omitted from API requests. However, any field with an
  4561. // empty value appearing in NullFields will be sent to the server as
  4562. // null. It is an error if a field in this list has a non-empty value.
  4563. // This may be used to include null fields in Patch requests.
  4564. NullFields []string `json:"-"`
  4565. }
  4566. func (s *GooglePrivacyDlpV2NumericalStatsResult) MarshalJSON() ([]byte, error) {
  4567. type NoMethod GooglePrivacyDlpV2NumericalStatsResult
  4568. raw := NoMethod(*s)
  4569. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4570. }
  4571. // GooglePrivacyDlpV2OutputStorageConfig: Cloud repository for storing
  4572. // output.
  4573. type GooglePrivacyDlpV2OutputStorageConfig struct {
  4574. // OutputSchema: Schema used for writing the findings for Inspect jobs.
  4575. // This field is only
  4576. // used for Inspect and must be unspecified for Risk jobs. Columns are
  4577. // derived
  4578. // from the `Finding` object. If appending to an existing table, any
  4579. // columns
  4580. // from the predefined schema that are missing will be added. No columns
  4581. // in
  4582. // the existing table will be deleted.
  4583. //
  4584. // If unspecified, then all available columns will be used for a new
  4585. // table or
  4586. // an (existing) table with no schema, and no changes will be made to
  4587. // an
  4588. // existing table that has a schema.
  4589. //
  4590. // Possible values:
  4591. // "OUTPUT_SCHEMA_UNSPECIFIED"
  4592. // "BASIC_COLUMNS" - Basic schema including only `info_type`, `quote`,
  4593. // `certainty`, and
  4594. // `timestamp`.
  4595. // "GCS_COLUMNS" - Schema tailored to findings from scanning Google
  4596. // Cloud Storage.
  4597. // "DATASTORE_COLUMNS" - Schema tailored to findings from scanning
  4598. // Google Datastore.
  4599. // "BIG_QUERY_COLUMNS" - Schema tailored to findings from scanning
  4600. // Google BigQuery.
  4601. // "ALL_COLUMNS" - Schema containing all columns.
  4602. OutputSchema string `json:"outputSchema,omitempty"`
  4603. // Table: Store findings in an existing table or a new table in an
  4604. // existing
  4605. // dataset. If table_id is not set a new one will be generated
  4606. // for you with the following
  4607. // format:
  4608. // dlp_googleapis_yyyy_mm_dd_[dlp_job_id]. Pacific timezone will be used
  4609. // for
  4610. // generating the date details.
  4611. //
  4612. // For Inspect, each column in an existing output table must have the
  4613. // same
  4614. // name, type, and mode of a field in the `Finding` object.
  4615. //
  4616. // For Risk, an existing output table should be the output of a
  4617. // previous
  4618. // Risk analysis job run on the same source table, with the same
  4619. // privacy
  4620. // metric and quasi-identifiers. Risk jobs that analyze the same table
  4621. // but
  4622. // compute a different privacy metric, or use different sets
  4623. // of
  4624. // quasi-identifiers, cannot store their results in the same table.
  4625. Table *GooglePrivacyDlpV2BigQueryTable `json:"table,omitempty"`
  4626. // ForceSendFields is a list of field names (e.g. "OutputSchema") to
  4627. // unconditionally include in API requests. By default, fields with
  4628. // empty values are omitted from API requests. However, any non-pointer,
  4629. // non-interface field appearing in ForceSendFields will be sent to the
  4630. // server regardless of whether the field is empty or not. This may be
  4631. // used to include empty fields in Patch requests.
  4632. ForceSendFields []string `json:"-"`
  4633. // NullFields is a list of field names (e.g. "OutputSchema") to include
  4634. // in API requests with the JSON null value. By default, fields with
  4635. // empty values are omitted from API requests. However, any field with
  4636. // an empty value appearing in NullFields will be sent to the server as
  4637. // null. It is an error if a field in this list has a non-empty value.
  4638. // This may be used to include null fields in Patch requests.
  4639. NullFields []string `json:"-"`
  4640. }
  4641. func (s *GooglePrivacyDlpV2OutputStorageConfig) MarshalJSON() ([]byte, error) {
  4642. type NoMethod GooglePrivacyDlpV2OutputStorageConfig
  4643. raw := NoMethod(*s)
  4644. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4645. }
  4646. // GooglePrivacyDlpV2PartitionId: Datastore partition ID.
  4647. // A partition ID identifies a grouping of entities. The grouping is
  4648. // always
  4649. // by project and namespace, however the namespace ID may be empty.
  4650. //
  4651. // A partition ID contains several dimensions:
  4652. // project ID and namespace ID.
  4653. type GooglePrivacyDlpV2PartitionId struct {
  4654. // NamespaceId: If not empty, the ID of the namespace to which the
  4655. // entities belong.
  4656. NamespaceId string `json:"namespaceId,omitempty"`
  4657. // ProjectId: The ID of the project to which the entities belong.
  4658. ProjectId string `json:"projectId,omitempty"`
  4659. // ForceSendFields is a list of field names (e.g. "NamespaceId") to
  4660. // unconditionally include in API requests. By default, fields with
  4661. // empty values are omitted from API requests. However, any non-pointer,
  4662. // non-interface field appearing in ForceSendFields will be sent to the
  4663. // server regardless of whether the field is empty or not. This may be
  4664. // used to include empty fields in Patch requests.
  4665. ForceSendFields []string `json:"-"`
  4666. // NullFields is a list of field names (e.g. "NamespaceId") to include
  4667. // in API requests with the JSON null value. By default, fields with
  4668. // empty values are omitted from API requests. However, any field with
  4669. // an empty value appearing in NullFields will be sent to the server as
  4670. // null. It is an error if a field in this list has a non-empty value.
  4671. // This may be used to include null fields in Patch requests.
  4672. NullFields []string `json:"-"`
  4673. }
  4674. func (s *GooglePrivacyDlpV2PartitionId) MarshalJSON() ([]byte, error) {
  4675. type NoMethod GooglePrivacyDlpV2PartitionId
  4676. raw := NoMethod(*s)
  4677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4678. }
  4679. // GooglePrivacyDlpV2PathElement: A (kind, ID/name) pair used to
  4680. // construct a key path.
  4681. //
  4682. // If either name or ID is set, the element is complete.
  4683. // If neither is set, the element is incomplete.
  4684. type GooglePrivacyDlpV2PathElement struct {
  4685. // Id: The auto-allocated ID of the entity.
  4686. // Never equal to zero. Values less than zero are discouraged and may
  4687. // not
  4688. // be supported in the future.
  4689. Id int64 `json:"id,omitempty,string"`
  4690. // Kind: The kind of the entity.
  4691. // A kind matching regex `__.*__` is reserved/read-only.
  4692. // A kind must not contain more than 1500 bytes when UTF-8
  4693. // encoded.
  4694. // Cannot be "".
  4695. Kind string `json:"kind,omitempty"`
  4696. // Name: The name of the entity.
  4697. // A name matching regex `__.*__` is reserved/read-only.
  4698. // A name must not be more than 1500 bytes when UTF-8 encoded.
  4699. // Cannot be "".
  4700. Name string `json:"name,omitempty"`
  4701. // ForceSendFields is a list of field names (e.g. "Id") to
  4702. // unconditionally include in API requests. By default, fields with
  4703. // empty values are omitted from API requests. However, any non-pointer,
  4704. // non-interface field appearing in ForceSendFields will be sent to the
  4705. // server regardless of whether the field is empty or not. This may be
  4706. // used to include empty fields in Patch requests.
  4707. ForceSendFields []string `json:"-"`
  4708. // NullFields is a list of field names (e.g. "Id") to include in API
  4709. // requests with the JSON null value. By default, fields with empty
  4710. // values are omitted from API requests. However, any field with an
  4711. // empty value appearing in NullFields will be sent to the server as
  4712. // null. It is an error if a field in this list has a non-empty value.
  4713. // This may be used to include null fields in Patch requests.
  4714. NullFields []string `json:"-"`
  4715. }
  4716. func (s *GooglePrivacyDlpV2PathElement) MarshalJSON() ([]byte, error) {
  4717. type NoMethod GooglePrivacyDlpV2PathElement
  4718. raw := NoMethod(*s)
  4719. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4720. }
  4721. // GooglePrivacyDlpV2PrimitiveTransformation: A rule for transforming a
  4722. // value.
  4723. type GooglePrivacyDlpV2PrimitiveTransformation struct {
  4724. BucketingConfig *GooglePrivacyDlpV2BucketingConfig `json:"bucketingConfig,omitempty"`
  4725. CharacterMaskConfig *GooglePrivacyDlpV2CharacterMaskConfig `json:"characterMaskConfig,omitempty"`
  4726. CryptoHashConfig *GooglePrivacyDlpV2CryptoHashConfig `json:"cryptoHashConfig,omitempty"`
  4727. CryptoReplaceFfxFpeConfig *GooglePrivacyDlpV2CryptoReplaceFfxFpeConfig `json:"cryptoReplaceFfxFpeConfig,omitempty"`
  4728. DateShiftConfig *GooglePrivacyDlpV2DateShiftConfig `json:"dateShiftConfig,omitempty"`
  4729. FixedSizeBucketingConfig *GooglePrivacyDlpV2FixedSizeBucketingConfig `json:"fixedSizeBucketingConfig,omitempty"`
  4730. RedactConfig *GooglePrivacyDlpV2RedactConfig `json:"redactConfig,omitempty"`
  4731. ReplaceConfig *GooglePrivacyDlpV2ReplaceValueConfig `json:"replaceConfig,omitempty"`
  4732. ReplaceWithInfoTypeConfig *GooglePrivacyDlpV2ReplaceWithInfoTypeConfig `json:"replaceWithInfoTypeConfig,omitempty"`
  4733. TimePartConfig *GooglePrivacyDlpV2TimePartConfig `json:"timePartConfig,omitempty"`
  4734. // ForceSendFields is a list of field names (e.g. "BucketingConfig") to
  4735. // unconditionally include in API requests. By default, fields with
  4736. // empty values are omitted from API requests. However, any non-pointer,
  4737. // non-interface field appearing in ForceSendFields will be sent to the
  4738. // server regardless of whether the field is empty or not. This may be
  4739. // used to include empty fields in Patch requests.
  4740. ForceSendFields []string `json:"-"`
  4741. // NullFields is a list of field names (e.g. "BucketingConfig") to
  4742. // include in API requests with the JSON null value. By default, fields
  4743. // with empty values are omitted from API requests. However, any field
  4744. // with an empty value appearing in NullFields will be sent to the
  4745. // server as null. It is an error if a field in this list has a
  4746. // non-empty value. This may be used to include null fields in Patch
  4747. // requests.
  4748. NullFields []string `json:"-"`
  4749. }
  4750. func (s *GooglePrivacyDlpV2PrimitiveTransformation) MarshalJSON() ([]byte, error) {
  4751. type NoMethod GooglePrivacyDlpV2PrimitiveTransformation
  4752. raw := NoMethod(*s)
  4753. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4754. }
  4755. // GooglePrivacyDlpV2PrivacyMetric: Privacy metric to compute for
  4756. // reidentification risk analysis.
  4757. type GooglePrivacyDlpV2PrivacyMetric struct {
  4758. CategoricalStatsConfig *GooglePrivacyDlpV2CategoricalStatsConfig `json:"categoricalStatsConfig,omitempty"`
  4759. DeltaPresenceEstimationConfig *GooglePrivacyDlpV2DeltaPresenceEstimationConfig `json:"deltaPresenceEstimationConfig,omitempty"`
  4760. KAnonymityConfig *GooglePrivacyDlpV2KAnonymityConfig `json:"kAnonymityConfig,omitempty"`
  4761. KMapEstimationConfig *GooglePrivacyDlpV2KMapEstimationConfig `json:"kMapEstimationConfig,omitempty"`
  4762. LDiversityConfig *GooglePrivacyDlpV2LDiversityConfig `json:"lDiversityConfig,omitempty"`
  4763. NumericalStatsConfig *GooglePrivacyDlpV2NumericalStatsConfig `json:"numericalStatsConfig,omitempty"`
  4764. // ForceSendFields is a list of field names (e.g.
  4765. // "CategoricalStatsConfig") to unconditionally include in API requests.
  4766. // By default, fields with empty values are omitted from API requests.
  4767. // However, any non-pointer, non-interface field appearing in
  4768. // ForceSendFields will be sent to the server regardless of whether the
  4769. // field is empty or not. This may be used to include empty fields in
  4770. // Patch requests.
  4771. ForceSendFields []string `json:"-"`
  4772. // NullFields is a list of field names (e.g. "CategoricalStatsConfig")
  4773. // to include in API requests with the JSON null value. By default,
  4774. // fields with empty values are omitted from API requests. However, any
  4775. // field with an empty value appearing in NullFields will be sent to the
  4776. // server as null. It is an error if a field in this list has a
  4777. // non-empty value. This may be used to include null fields in Patch
  4778. // requests.
  4779. NullFields []string `json:"-"`
  4780. }
  4781. func (s *GooglePrivacyDlpV2PrivacyMetric) MarshalJSON() ([]byte, error) {
  4782. type NoMethod GooglePrivacyDlpV2PrivacyMetric
  4783. raw := NoMethod(*s)
  4784. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4785. }
  4786. // GooglePrivacyDlpV2Proximity: Message for specifying a window around a
  4787. // finding to apply a detection
  4788. // rule.
  4789. type GooglePrivacyDlpV2Proximity struct {
  4790. // WindowAfter: Number of characters after the finding to consider.
  4791. WindowAfter int64 `json:"windowAfter,omitempty"`
  4792. // WindowBefore: Number of characters before the finding to consider.
  4793. WindowBefore int64 `json:"windowBefore,omitempty"`
  4794. // ForceSendFields is a list of field names (e.g. "WindowAfter") to
  4795. // unconditionally include in API requests. By default, fields with
  4796. // empty values are omitted from API requests. However, any non-pointer,
  4797. // non-interface field appearing in ForceSendFields will be sent to the
  4798. // server regardless of whether the field is empty or not. This may be
  4799. // used to include empty fields in Patch requests.
  4800. ForceSendFields []string `json:"-"`
  4801. // NullFields is a list of field names (e.g. "WindowAfter") to include
  4802. // in API requests with the JSON null value. By default, fields with
  4803. // empty values are omitted from API requests. However, any field with
  4804. // an empty value appearing in NullFields will be sent to the server as
  4805. // null. It is an error if a field in this list has a non-empty value.
  4806. // This may be used to include null fields in Patch requests.
  4807. NullFields []string `json:"-"`
  4808. }
  4809. func (s *GooglePrivacyDlpV2Proximity) MarshalJSON() ([]byte, error) {
  4810. type NoMethod GooglePrivacyDlpV2Proximity
  4811. raw := NoMethod(*s)
  4812. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4813. }
  4814. // GooglePrivacyDlpV2PublishSummaryToCscc: Publish the result summary of
  4815. // a DlpJob to the Cloud Security
  4816. // Command Center (CSCC Alpha).
  4817. // This action is only available for projects which are parts of
  4818. // an organization and whitelisted for the alpha Cloud Security
  4819. // Command
  4820. // Center.
  4821. // The action will publish count of finding instances and their info
  4822. // types.
  4823. // The summary of findings will be persisted in CSCC and are governed by
  4824. // CSCC
  4825. // service-specific policy, see
  4826. // https://cloud.google.com/terms/service-terms
  4827. // Only a single instance of this action can be specified.
  4828. // Compatible with: Inspect
  4829. type GooglePrivacyDlpV2PublishSummaryToCscc struct {
  4830. }
  4831. // GooglePrivacyDlpV2PublishToPubSub: Publish the results of a DlpJob to
  4832. // a pub sub channel.
  4833. // Compatible with: Inspect, Risk
  4834. type GooglePrivacyDlpV2PublishToPubSub struct {
  4835. // Topic: Cloud Pub/Sub topic to send notifications to. The topic must
  4836. // have given
  4837. // publishing access rights to the DLP API service account executing
  4838. // the long running DlpJob sending the notifications.
  4839. // Format is projects/{project}/topics/{topic}.
  4840. Topic string `json:"topic,omitempty"`
  4841. // ForceSendFields is a list of field names (e.g. "Topic") to
  4842. // unconditionally include in API requests. By default, fields with
  4843. // empty values are omitted from API requests. However, any non-pointer,
  4844. // non-interface field appearing in ForceSendFields will be sent to the
  4845. // server regardless of whether the field is empty or not. This may be
  4846. // used to include empty fields in Patch requests.
  4847. ForceSendFields []string `json:"-"`
  4848. // NullFields is a list of field names (e.g. "Topic") to include in API
  4849. // requests with the JSON null value. By default, fields with empty
  4850. // values are omitted from API requests. However, any field with an
  4851. // empty value appearing in NullFields will be sent to the server as
  4852. // null. It is an error if a field in this list has a non-empty value.
  4853. // This may be used to include null fields in Patch requests.
  4854. NullFields []string `json:"-"`
  4855. }
  4856. func (s *GooglePrivacyDlpV2PublishToPubSub) MarshalJSON() ([]byte, error) {
  4857. type NoMethod GooglePrivacyDlpV2PublishToPubSub
  4858. raw := NoMethod(*s)
  4859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4860. }
  4861. // GooglePrivacyDlpV2QuasiId: A column with a semantic tag attached.
  4862. type GooglePrivacyDlpV2QuasiId struct {
  4863. // CustomTag: A column can be tagged with a custom tag. In this case,
  4864. // the user must
  4865. // indicate an auxiliary table that contains statistical information
  4866. // on
  4867. // the possible values of this column (below).
  4868. CustomTag string `json:"customTag,omitempty"`
  4869. // Field: Identifies the column. [required]
  4870. Field *GooglePrivacyDlpV2FieldId `json:"field,omitempty"`
  4871. // Inferred: If no semantic tag is indicated, we infer the statistical
  4872. // model from
  4873. // the distribution of values in the input data
  4874. Inferred *GoogleProtobufEmpty `json:"inferred,omitempty"`
  4875. // InfoType: A column can be tagged with a InfoType to use the relevant
  4876. // public
  4877. // dataset as a statistical model of population, if available.
  4878. // We
  4879. // currently support US ZIP codes, region codes, ages and genders.
  4880. // To programmatically obtain the list of supported InfoTypes,
  4881. // use
  4882. // ListInfoTypes with the supported_by=RISK_ANALYSIS filter.
  4883. InfoType *GooglePrivacyDlpV2InfoType `json:"infoType,omitempty"`
  4884. // ForceSendFields is a list of field names (e.g. "CustomTag") to
  4885. // unconditionally include in API requests. By default, fields with
  4886. // empty values are omitted from API requests. However, any non-pointer,
  4887. // non-interface field appearing in ForceSendFields will be sent to the
  4888. // server regardless of whether the field is empty or not. This may be
  4889. // used to include empty fields in Patch requests.
  4890. ForceSendFields []string `json:"-"`
  4891. // NullFields is a list of field names (e.g. "CustomTag") to include in
  4892. // API requests with the JSON null value. By default, fields with empty
  4893. // values are omitted from API requests. However, any field with an
  4894. // empty value appearing in NullFields will be sent to the server as
  4895. // null. It is an error if a field in this list has a non-empty value.
  4896. // This may be used to include null fields in Patch requests.
  4897. NullFields []string `json:"-"`
  4898. }
  4899. func (s *GooglePrivacyDlpV2QuasiId) MarshalJSON() ([]byte, error) {
  4900. type NoMethod GooglePrivacyDlpV2QuasiId
  4901. raw := NoMethod(*s)
  4902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4903. }
  4904. // GooglePrivacyDlpV2QuasiIdField: A quasi-identifier column has a
  4905. // custom_tag, used to know which column
  4906. // in the data corresponds to which column in the statistical model.
  4907. type GooglePrivacyDlpV2QuasiIdField struct {
  4908. CustomTag string `json:"customTag,omitempty"`
  4909. Field *GooglePrivacyDlpV2FieldId `json:"field,omitempty"`
  4910. // ForceSendFields is a list of field names (e.g. "CustomTag") to
  4911. // unconditionally include in API requests. By default, fields with
  4912. // empty values are omitted from API requests. However, any non-pointer,
  4913. // non-interface field appearing in ForceSendFields will be sent to the
  4914. // server regardless of whether the field is empty or not. This may be
  4915. // used to include empty fields in Patch requests.
  4916. ForceSendFields []string `json:"-"`
  4917. // NullFields is a list of field names (e.g. "CustomTag") to include in
  4918. // API requests with the JSON null value. By default, fields with empty
  4919. // values are omitted from API requests. However, any field with an
  4920. // empty value appearing in NullFields will be sent to the server as
  4921. // null. It is an error if a field in this list has a non-empty value.
  4922. // This may be used to include null fields in Patch requests.
  4923. NullFields []string `json:"-"`
  4924. }
  4925. func (s *GooglePrivacyDlpV2QuasiIdField) MarshalJSON() ([]byte, error) {
  4926. type NoMethod GooglePrivacyDlpV2QuasiIdField
  4927. raw := NoMethod(*s)
  4928. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4929. }
  4930. // GooglePrivacyDlpV2QuasiIdentifierField: A quasi-identifier column has
  4931. // a custom_tag, used to know which column
  4932. // in the data corresponds to which column in the statistical model.
  4933. type GooglePrivacyDlpV2QuasiIdentifierField struct {
  4934. CustomTag string `json:"customTag,omitempty"`
  4935. Field *GooglePrivacyDlpV2FieldId `json:"field,omitempty"`
  4936. // ForceSendFields is a list of field names (e.g. "CustomTag") to
  4937. // unconditionally include in API requests. By default, fields with
  4938. // empty values are omitted from API requests. However, any non-pointer,
  4939. // non-interface field appearing in ForceSendFields will be sent to the
  4940. // server regardless of whether the field is empty or not. This may be
  4941. // used to include empty fields in Patch requests.
  4942. ForceSendFields []string `json:"-"`
  4943. // NullFields is a list of field names (e.g. "CustomTag") to include in
  4944. // API requests with the JSON null value. By default, fields with empty
  4945. // values are omitted from API requests. However, any field with an
  4946. // empty value appearing in NullFields will be sent to the server as
  4947. // null. It is an error if a field in this list has a non-empty value.
  4948. // This may be used to include null fields in Patch requests.
  4949. NullFields []string `json:"-"`
  4950. }
  4951. func (s *GooglePrivacyDlpV2QuasiIdentifierField) MarshalJSON() ([]byte, error) {
  4952. type NoMethod GooglePrivacyDlpV2QuasiIdentifierField
  4953. raw := NoMethod(*s)
  4954. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4955. }
  4956. // GooglePrivacyDlpV2QuoteInfo: Message for infoType-dependent details
  4957. // parsed from quote.
  4958. type GooglePrivacyDlpV2QuoteInfo struct {
  4959. // DateTime: The date time indicated by the quote.
  4960. DateTime *GooglePrivacyDlpV2DateTime `json:"dateTime,omitempty"`
  4961. // ForceSendFields is a list of field names (e.g. "DateTime") to
  4962. // unconditionally include in API requests. By default, fields with
  4963. // empty values are omitted from API requests. However, any non-pointer,
  4964. // non-interface field appearing in ForceSendFields will be sent to the
  4965. // server regardless of whether the field is empty or not. This may be
  4966. // used to include empty fields in Patch requests.
  4967. ForceSendFields []string `json:"-"`
  4968. // NullFields is a list of field names (e.g. "DateTime") to include in
  4969. // API requests with the JSON null value. By default, fields with empty
  4970. // values are omitted from API requests. However, any field with an
  4971. // empty value appearing in NullFields will be sent to the server as
  4972. // null. It is an error if a field in this list has a non-empty value.
  4973. // This may be used to include null fields in Patch requests.
  4974. NullFields []string `json:"-"`
  4975. }
  4976. func (s *GooglePrivacyDlpV2QuoteInfo) MarshalJSON() ([]byte, error) {
  4977. type NoMethod GooglePrivacyDlpV2QuoteInfo
  4978. raw := NoMethod(*s)
  4979. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4980. }
  4981. // GooglePrivacyDlpV2Range: Generic half-open interval [start, end)
  4982. type GooglePrivacyDlpV2Range struct {
  4983. // End: Index of the last character of the range (exclusive).
  4984. End int64 `json:"end,omitempty,string"`
  4985. // Start: Index of the first character of the range (inclusive).
  4986. Start int64 `json:"start,omitempty,string"`
  4987. // ForceSendFields is a list of field names (e.g. "End") to
  4988. // unconditionally include in API requests. By default, fields with
  4989. // empty values are omitted from API requests. However, any non-pointer,
  4990. // non-interface field appearing in ForceSendFields will be sent to the
  4991. // server regardless of whether the field is empty or not. This may be
  4992. // used to include empty fields in Patch requests.
  4993. ForceSendFields []string `json:"-"`
  4994. // NullFields is a list of field names (e.g. "End") to include in API
  4995. // requests with the JSON null value. By default, fields with empty
  4996. // values are omitted from API requests. However, any field with an
  4997. // empty value appearing in NullFields will be sent to the server as
  4998. // null. It is an error if a field in this list has a non-empty value.
  4999. // This may be used to include null fields in Patch requests.
  5000. NullFields []string `json:"-"`
  5001. }
  5002. func (s *GooglePrivacyDlpV2Range) MarshalJSON() ([]byte, error) {
  5003. type NoMethod GooglePrivacyDlpV2Range
  5004. raw := NoMethod(*s)
  5005. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5006. }
  5007. // GooglePrivacyDlpV2RecordCondition: A condition for determining
  5008. // whether a transformation should be applied to
  5009. // a field.
  5010. type GooglePrivacyDlpV2RecordCondition struct {
  5011. // Expressions: An expression.
  5012. Expressions *GooglePrivacyDlpV2Expressions `json:"expressions,omitempty"`
  5013. // ForceSendFields is a list of field names (e.g. "Expressions") to
  5014. // unconditionally include in API requests. By default, fields with
  5015. // empty values are omitted from API requests. However, any non-pointer,
  5016. // non-interface field appearing in ForceSendFields will be sent to the
  5017. // server regardless of whether the field is empty or not. This may be
  5018. // used to include empty fields in Patch requests.
  5019. ForceSendFields []string `json:"-"`
  5020. // NullFields is a list of field names (e.g. "Expressions") to include
  5021. // in API requests with the JSON null value. By default, fields with
  5022. // empty values are omitted from API requests. However, any field with
  5023. // an empty value appearing in NullFields will be sent to the server as
  5024. // null. It is an error if a field in this list has a non-empty value.
  5025. // This may be used to include null fields in Patch requests.
  5026. NullFields []string `json:"-"`
  5027. }
  5028. func (s *GooglePrivacyDlpV2RecordCondition) MarshalJSON() ([]byte, error) {
  5029. type NoMethod GooglePrivacyDlpV2RecordCondition
  5030. raw := NoMethod(*s)
  5031. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5032. }
  5033. // GooglePrivacyDlpV2RecordKey: Message for a unique key indicating a
  5034. // record that contains a finding.
  5035. type GooglePrivacyDlpV2RecordKey struct {
  5036. BigQueryKey *GooglePrivacyDlpV2BigQueryKey `json:"bigQueryKey,omitempty"`
  5037. DatastoreKey *GooglePrivacyDlpV2DatastoreKey `json:"datastoreKey,omitempty"`
  5038. // IdValues: Values of identifying columns in the given row. Order of
  5039. // values matches
  5040. // the order of field identifiers specified in the scanning request.
  5041. IdValues []string `json:"idValues,omitempty"`
  5042. // ForceSendFields is a list of field names (e.g. "BigQueryKey") to
  5043. // unconditionally include in API requests. By default, fields with
  5044. // empty values are omitted from API requests. However, any non-pointer,
  5045. // non-interface field appearing in ForceSendFields will be sent to the
  5046. // server regardless of whether the field is empty or not. This may be
  5047. // used to include empty fields in Patch requests.
  5048. ForceSendFields []string `json:"-"`
  5049. // NullFields is a list of field names (e.g. "BigQueryKey") to include
  5050. // in API requests with the JSON null value. By default, fields with
  5051. // empty values are omitted from API requests. However, any field with
  5052. // an empty value appearing in NullFields will be sent to the server as
  5053. // null. It is an error if a field in this list has a non-empty value.
  5054. // This may be used to include null fields in Patch requests.
  5055. NullFields []string `json:"-"`
  5056. }
  5057. func (s *GooglePrivacyDlpV2RecordKey) MarshalJSON() ([]byte, error) {
  5058. type NoMethod GooglePrivacyDlpV2RecordKey
  5059. raw := NoMethod(*s)
  5060. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5061. }
  5062. // GooglePrivacyDlpV2RecordLocation: Location of a finding within a row
  5063. // or record.
  5064. type GooglePrivacyDlpV2RecordLocation struct {
  5065. // FieldId: Field id of the field containing the finding.
  5066. FieldId *GooglePrivacyDlpV2FieldId `json:"fieldId,omitempty"`
  5067. // RecordKey: Key of the finding.
  5068. RecordKey *GooglePrivacyDlpV2RecordKey `json:"recordKey,omitempty"`
  5069. // TableLocation: Location within a `ContentItem.Table`.
  5070. TableLocation *GooglePrivacyDlpV2TableLocation `json:"tableLocation,omitempty"`
  5071. // ForceSendFields is a list of field names (e.g. "FieldId") to
  5072. // unconditionally include in API requests. By default, fields with
  5073. // empty values are omitted from API requests. However, any non-pointer,
  5074. // non-interface field appearing in ForceSendFields will be sent to the
  5075. // server regardless of whether the field is empty or not. This may be
  5076. // used to include empty fields in Patch requests.
  5077. ForceSendFields []string `json:"-"`
  5078. // NullFields is a list of field names (e.g. "FieldId") to include in
  5079. // API requests with the JSON null value. By default, fields with empty
  5080. // values are omitted from API requests. However, any field with an
  5081. // empty value appearing in NullFields will be sent to the server as
  5082. // null. It is an error if a field in this list has a non-empty value.
  5083. // This may be used to include null fields in Patch requests.
  5084. NullFields []string `json:"-"`
  5085. }
  5086. func (s *GooglePrivacyDlpV2RecordLocation) MarshalJSON() ([]byte, error) {
  5087. type NoMethod GooglePrivacyDlpV2RecordLocation
  5088. raw := NoMethod(*s)
  5089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5090. }
  5091. // GooglePrivacyDlpV2RecordSuppression: Configuration to suppress
  5092. // records whose suppression conditions evaluate to
  5093. // true.
  5094. type GooglePrivacyDlpV2RecordSuppression struct {
  5095. // Condition: A condition that when it evaluates to true will result in
  5096. // the record being
  5097. // evaluated to be suppressed from the transformed content.
  5098. Condition *GooglePrivacyDlpV2RecordCondition `json:"condition,omitempty"`
  5099. // ForceSendFields is a list of field names (e.g. "Condition") to
  5100. // unconditionally include in API requests. By default, fields with
  5101. // empty values are omitted from API requests. However, any non-pointer,
  5102. // non-interface field appearing in ForceSendFields will be sent to the
  5103. // server regardless of whether the field is empty or not. This may be
  5104. // used to include empty fields in Patch requests.
  5105. ForceSendFields []string `json:"-"`
  5106. // NullFields is a list of field names (e.g. "Condition") to include in
  5107. // API requests with the JSON null value. By default, fields with empty
  5108. // values are omitted from API requests. However, any field with an
  5109. // empty value appearing in NullFields will be sent to the server as
  5110. // null. It is an error if a field in this list has a non-empty value.
  5111. // This may be used to include null fields in Patch requests.
  5112. NullFields []string `json:"-"`
  5113. }
  5114. func (s *GooglePrivacyDlpV2RecordSuppression) MarshalJSON() ([]byte, error) {
  5115. type NoMethod GooglePrivacyDlpV2RecordSuppression
  5116. raw := NoMethod(*s)
  5117. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5118. }
  5119. // GooglePrivacyDlpV2RecordTransformations: A type of transformation
  5120. // that is applied over structured data such as a
  5121. // table.
  5122. type GooglePrivacyDlpV2RecordTransformations struct {
  5123. // FieldTransformations: Transform the record by applying various field
  5124. // transformations.
  5125. FieldTransformations []*GooglePrivacyDlpV2FieldTransformation `json:"fieldTransformations,omitempty"`
  5126. // RecordSuppressions: Configuration defining which records get
  5127. // suppressed entirely. Records that
  5128. // match any suppression rule are omitted from the output [optional].
  5129. RecordSuppressions []*GooglePrivacyDlpV2RecordSuppression `json:"recordSuppressions,omitempty"`
  5130. // ForceSendFields is a list of field names (e.g.
  5131. // "FieldTransformations") to unconditionally include in API requests.
  5132. // By default, fields with empty values are omitted from API requests.
  5133. // However, any non-pointer, non-interface field appearing in
  5134. // ForceSendFields will be sent to the server regardless of whether the
  5135. // field is empty or not. This may be used to include empty fields in
  5136. // Patch requests.
  5137. ForceSendFields []string `json:"-"`
  5138. // NullFields is a list of field names (e.g. "FieldTransformations") to
  5139. // include in API requests with the JSON null value. By default, fields
  5140. // with empty values are omitted from API requests. However, any field
  5141. // with an empty value appearing in NullFields will be sent to the
  5142. // server as null. It is an error if a field in this list has a
  5143. // non-empty value. This may be used to include null fields in Patch
  5144. // requests.
  5145. NullFields []string `json:"-"`
  5146. }
  5147. func (s *GooglePrivacyDlpV2RecordTransformations) MarshalJSON() ([]byte, error) {
  5148. type NoMethod GooglePrivacyDlpV2RecordTransformations
  5149. raw := NoMethod(*s)
  5150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5151. }
  5152. // GooglePrivacyDlpV2RedactConfig: Redact a given value. For example, if
  5153. // used with an `InfoTypeTransformation`
  5154. // transforming PHONE_NUMBER, and input 'My phone number is
  5155. // 206-555-0123', the
  5156. // output would be 'My phone number is '.
  5157. type GooglePrivacyDlpV2RedactConfig struct {
  5158. }
  5159. // GooglePrivacyDlpV2RedactImageRequest: Request to search for
  5160. // potentially sensitive info in an image and redact it
  5161. // by covering it with a colored rectangle.
  5162. type GooglePrivacyDlpV2RedactImageRequest struct {
  5163. // ByteItem: The content must be PNG, JPEG, SVG or BMP.
  5164. ByteItem *GooglePrivacyDlpV2ByteContentItem `json:"byteItem,omitempty"`
  5165. // ImageRedactionConfigs: The configuration for specifying what content
  5166. // to redact from images.
  5167. ImageRedactionConfigs []*GooglePrivacyDlpV2ImageRedactionConfig `json:"imageRedactionConfigs,omitempty"`
  5168. // IncludeFindings: Whether the response should include findings along
  5169. // with the redacted
  5170. // image.
  5171. IncludeFindings bool `json:"includeFindings,omitempty"`
  5172. // InspectConfig: Configuration for the inspector.
  5173. InspectConfig *GooglePrivacyDlpV2InspectConfig `json:"inspectConfig,omitempty"`
  5174. // ForceSendFields is a list of field names (e.g. "ByteItem") to
  5175. // unconditionally include in API requests. By default, fields with
  5176. // empty values are omitted from API requests. However, any non-pointer,
  5177. // non-interface field appearing in ForceSendFields will be sent to the
  5178. // server regardless of whether the field is empty or not. This may be
  5179. // used to include empty fields in Patch requests.
  5180. ForceSendFields []string `json:"-"`
  5181. // NullFields is a list of field names (e.g. "ByteItem") to include in
  5182. // API requests with the JSON null value. By default, fields with empty
  5183. // values are omitted from API requests. However, any field with an
  5184. // empty value appearing in NullFields will be sent to the server as
  5185. // null. It is an error if a field in this list has a non-empty value.
  5186. // This may be used to include null fields in Patch requests.
  5187. NullFields []string `json:"-"`
  5188. }
  5189. func (s *GooglePrivacyDlpV2RedactImageRequest) MarshalJSON() ([]byte, error) {
  5190. type NoMethod GooglePrivacyDlpV2RedactImageRequest
  5191. raw := NoMethod(*s)
  5192. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5193. }
  5194. // GooglePrivacyDlpV2RedactImageResponse: Results of redacting an image.
  5195. type GooglePrivacyDlpV2RedactImageResponse struct {
  5196. // ExtractedText: If an image was being inspected and the
  5197. // InspectConfig's include_quote was
  5198. // set to true, then this field will include all text, if any, that was
  5199. // found
  5200. // in the image.
  5201. ExtractedText string `json:"extractedText,omitempty"`
  5202. // InspectResult: The findings. Populated when include_findings in the
  5203. // request is true.
  5204. InspectResult *GooglePrivacyDlpV2InspectResult `json:"inspectResult,omitempty"`
  5205. // RedactedImage: The redacted image. The type will be the same as the
  5206. // original image.
  5207. RedactedImage string `json:"redactedImage,omitempty"`
  5208. // ServerResponse contains the HTTP response code and headers from the
  5209. // server.
  5210. googleapi.ServerResponse `json:"-"`
  5211. // ForceSendFields is a list of field names (e.g. "ExtractedText") to
  5212. // unconditionally include in API requests. By default, fields with
  5213. // empty values are omitted from API requests. However, any non-pointer,
  5214. // non-interface field appearing in ForceSendFields will be sent to the
  5215. // server regardless of whether the field is empty or not. This may be
  5216. // used to include empty fields in Patch requests.
  5217. ForceSendFields []string `json:"-"`
  5218. // NullFields is a list of field names (e.g. "ExtractedText") to include
  5219. // in API requests with the JSON null value. By default, fields with
  5220. // empty values are omitted from API requests. However, any field with
  5221. // an empty value appearing in NullFields will be sent to the server as
  5222. // null. It is an error if a field in this list has a non-empty value.
  5223. // This may be used to include null fields in Patch requests.
  5224. NullFields []string `json:"-"`
  5225. }
  5226. func (s *GooglePrivacyDlpV2RedactImageResponse) MarshalJSON() ([]byte, error) {
  5227. type NoMethod GooglePrivacyDlpV2RedactImageResponse
  5228. raw := NoMethod(*s)
  5229. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5230. }
  5231. // GooglePrivacyDlpV2Regex: Message defining a custom regular
  5232. // expression.
  5233. type GooglePrivacyDlpV2Regex struct {
  5234. // GroupIndexes: The index of the submatch to extract as findings. When
  5235. // not
  5236. // specified, the entire match is returned. No more than 3 may be
  5237. // included.
  5238. GroupIndexes []int64 `json:"groupIndexes,omitempty"`
  5239. // Pattern: Pattern defining the regular expression. Its
  5240. // syntax
  5241. // (https://github.com/google/re2/wiki/Syntax) can be found under
  5242. // the
  5243. // google/re2 repository on GitHub.
  5244. Pattern string `json:"pattern,omitempty"`
  5245. // ForceSendFields is a list of field names (e.g. "GroupIndexes") to
  5246. // unconditionally include in API requests. By default, fields with
  5247. // empty values are omitted from API requests. However, any non-pointer,
  5248. // non-interface field appearing in ForceSendFields will be sent to the
  5249. // server regardless of whether the field is empty or not. This may be
  5250. // used to include empty fields in Patch requests.
  5251. ForceSendFields []string `json:"-"`
  5252. // NullFields is a list of field names (e.g. "GroupIndexes") to include
  5253. // in API requests with the JSON null value. By default, fields with
  5254. // empty values are omitted from API requests. However, any field with
  5255. // an empty value appearing in NullFields will be sent to the server as
  5256. // null. It is an error if a field in this list has a non-empty value.
  5257. // This may be used to include null fields in Patch requests.
  5258. NullFields []string `json:"-"`
  5259. }
  5260. func (s *GooglePrivacyDlpV2Regex) MarshalJSON() ([]byte, error) {
  5261. type NoMethod GooglePrivacyDlpV2Regex
  5262. raw := NoMethod(*s)
  5263. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5264. }
  5265. // GooglePrivacyDlpV2ReidentifyContentRequest: Request to re-identify an
  5266. // item.
  5267. type GooglePrivacyDlpV2ReidentifyContentRequest struct {
  5268. // InspectConfig: Configuration for the inspector.
  5269. InspectConfig *GooglePrivacyDlpV2InspectConfig `json:"inspectConfig,omitempty"`
  5270. // InspectTemplateName: Optional template to use. Any configuration
  5271. // directly specified in
  5272. // `inspect_config` will override those set in the template. Singular
  5273. // fields
  5274. // that are set in this request will replace their corresponding fields
  5275. // in the
  5276. // template. Repeated fields are appended. Singular sub-messages and
  5277. // groups
  5278. // are recursively merged.
  5279. InspectTemplateName string `json:"inspectTemplateName,omitempty"`
  5280. // Item: The item to re-identify. Will be treated as text.
  5281. Item *GooglePrivacyDlpV2ContentItem `json:"item,omitempty"`
  5282. // ReidentifyConfig: Configuration for the re-identification of the
  5283. // content item.
  5284. // This field shares the same proto message type that is used
  5285. // for
  5286. // de-identification, however its usage here is for the reversal of
  5287. // the
  5288. // previous de-identification. Re-identification is performed by
  5289. // examining
  5290. // the transformations used to de-identify the items and executing
  5291. // the
  5292. // reverse. This requires that only reversible transformations
  5293. // be provided here. The reversible transformations are:
  5294. //
  5295. // - `CryptoReplaceFfxFpeConfig`
  5296. ReidentifyConfig *GooglePrivacyDlpV2DeidentifyConfig `json:"reidentifyConfig,omitempty"`
  5297. // ReidentifyTemplateName: Optional template to use. References an
  5298. // instance of `DeidentifyTemplate`.
  5299. // Any configuration directly specified in `reidentify_config`
  5300. // or
  5301. // `inspect_config` will override those set in the template. Singular
  5302. // fields
  5303. // that are set in this request will replace their corresponding fields
  5304. // in the
  5305. // template. Repeated fields are appended. Singular sub-messages and
  5306. // groups
  5307. // are recursively merged.
  5308. ReidentifyTemplateName string `json:"reidentifyTemplateName,omitempty"`
  5309. // ForceSendFields is a list of field names (e.g. "InspectConfig") to
  5310. // unconditionally include in API requests. By default, fields with
  5311. // empty values are omitted from API requests. However, any non-pointer,
  5312. // non-interface field appearing in ForceSendFields will be sent to the
  5313. // server regardless of whether the field is empty or not. This may be
  5314. // used to include empty fields in Patch requests.
  5315. ForceSendFields []string `json:"-"`
  5316. // NullFields is a list of field names (e.g. "InspectConfig") to include
  5317. // in API requests with the JSON null value. By default, fields with
  5318. // empty values are omitted from API requests. However, any field with
  5319. // an empty value appearing in NullFields will be sent to the server as
  5320. // null. It is an error if a field in this list has a non-empty value.
  5321. // This may be used to include null fields in Patch requests.
  5322. NullFields []string `json:"-"`
  5323. }
  5324. func (s *GooglePrivacyDlpV2ReidentifyContentRequest) MarshalJSON() ([]byte, error) {
  5325. type NoMethod GooglePrivacyDlpV2ReidentifyContentRequest
  5326. raw := NoMethod(*s)
  5327. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5328. }
  5329. // GooglePrivacyDlpV2ReidentifyContentResponse: Results of
  5330. // re-identifying a item.
  5331. type GooglePrivacyDlpV2ReidentifyContentResponse struct {
  5332. // Item: The re-identified item.
  5333. Item *GooglePrivacyDlpV2ContentItem `json:"item,omitempty"`
  5334. // Overview: An overview of the changes that were made to the `item`.
  5335. Overview *GooglePrivacyDlpV2TransformationOverview `json:"overview,omitempty"`
  5336. // ServerResponse contains the HTTP response code and headers from the
  5337. // server.
  5338. googleapi.ServerResponse `json:"-"`
  5339. // ForceSendFields is a list of field names (e.g. "Item") to
  5340. // unconditionally include in API requests. By default, fields with
  5341. // empty values are omitted from API requests. However, any non-pointer,
  5342. // non-interface field appearing in ForceSendFields will be sent to the
  5343. // server regardless of whether the field is empty or not. This may be
  5344. // used to include empty fields in Patch requests.
  5345. ForceSendFields []string `json:"-"`
  5346. // NullFields is a list of field names (e.g. "Item") to include in API
  5347. // requests with the JSON null value. By default, fields with empty
  5348. // values are omitted from API requests. However, any field with an
  5349. // empty value appearing in NullFields will be sent to the server as
  5350. // null. It is an error if a field in this list has a non-empty value.
  5351. // This may be used to include null fields in Patch requests.
  5352. NullFields []string `json:"-"`
  5353. }
  5354. func (s *GooglePrivacyDlpV2ReidentifyContentResponse) MarshalJSON() ([]byte, error) {
  5355. type NoMethod GooglePrivacyDlpV2ReidentifyContentResponse
  5356. raw := NoMethod(*s)
  5357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5358. }
  5359. // GooglePrivacyDlpV2ReplaceValueConfig: Replace each input value with a
  5360. // given `Value`.
  5361. type GooglePrivacyDlpV2ReplaceValueConfig struct {
  5362. // NewValue: Value to replace it with.
  5363. NewValue *GooglePrivacyDlpV2Value `json:"newValue,omitempty"`
  5364. // ForceSendFields is a list of field names (e.g. "NewValue") to
  5365. // unconditionally include in API requests. By default, fields with
  5366. // empty values are omitted from API requests. However, any non-pointer,
  5367. // non-interface field appearing in ForceSendFields will be sent to the
  5368. // server regardless of whether the field is empty or not. This may be
  5369. // used to include empty fields in Patch requests.
  5370. ForceSendFields []string `json:"-"`
  5371. // NullFields is a list of field names (e.g. "NewValue") to include in
  5372. // API requests with the JSON null value. By default, fields with empty
  5373. // values are omitted from API requests. However, any field with an
  5374. // empty value appearing in NullFields will be sent to the server as
  5375. // null. It is an error if a field in this list has a non-empty value.
  5376. // This may be used to include null fields in Patch requests.
  5377. NullFields []string `json:"-"`
  5378. }
  5379. func (s *GooglePrivacyDlpV2ReplaceValueConfig) MarshalJSON() ([]byte, error) {
  5380. type NoMethod GooglePrivacyDlpV2ReplaceValueConfig
  5381. raw := NoMethod(*s)
  5382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5383. }
  5384. // GooglePrivacyDlpV2ReplaceWithInfoTypeConfig: Replace each matching
  5385. // finding with the name of the info_type.
  5386. type GooglePrivacyDlpV2ReplaceWithInfoTypeConfig struct {
  5387. }
  5388. type GooglePrivacyDlpV2RequestedOptions struct {
  5389. JobConfig *GooglePrivacyDlpV2InspectJobConfig `json:"jobConfig,omitempty"`
  5390. // SnapshotInspectTemplate: If run with an InspectTemplate, a snapshot
  5391. // of its state at the time of
  5392. // this run.
  5393. SnapshotInspectTemplate *GooglePrivacyDlpV2InspectTemplate `json:"snapshotInspectTemplate,omitempty"`
  5394. // ForceSendFields is a list of field names (e.g. "JobConfig") to
  5395. // unconditionally include in API requests. By default, fields with
  5396. // empty values are omitted from API requests. However, any non-pointer,
  5397. // non-interface field appearing in ForceSendFields will be sent to the
  5398. // server regardless of whether the field is empty or not. This may be
  5399. // used to include empty fields in Patch requests.
  5400. ForceSendFields []string `json:"-"`
  5401. // NullFields is a list of field names (e.g. "JobConfig") to include in
  5402. // API requests with the JSON null value. By default, fields with empty
  5403. // values are omitted from API requests. However, any field with an
  5404. // empty value appearing in NullFields will be sent to the server as
  5405. // null. It is an error if a field in this list has a non-empty value.
  5406. // This may be used to include null fields in Patch requests.
  5407. NullFields []string `json:"-"`
  5408. }
  5409. func (s *GooglePrivacyDlpV2RequestedOptions) MarshalJSON() ([]byte, error) {
  5410. type NoMethod GooglePrivacyDlpV2RequestedOptions
  5411. raw := NoMethod(*s)
  5412. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5413. }
  5414. // GooglePrivacyDlpV2Result: All result fields mentioned below are
  5415. // updated while the job is processing.
  5416. type GooglePrivacyDlpV2Result struct {
  5417. // InfoTypeStats: Statistics of how many instances of each info type
  5418. // were found during
  5419. // inspect job.
  5420. InfoTypeStats []*GooglePrivacyDlpV2InfoTypeStats `json:"infoTypeStats,omitempty"`
  5421. // ProcessedBytes: Total size in bytes that were processed.
  5422. ProcessedBytes int64 `json:"processedBytes,omitempty,string"`
  5423. // TotalEstimatedBytes: Estimate of the number of bytes to process.
  5424. TotalEstimatedBytes int64 `json:"totalEstimatedBytes,omitempty,string"`
  5425. // ForceSendFields is a list of field names (e.g. "InfoTypeStats") to
  5426. // unconditionally include in API requests. By default, fields with
  5427. // empty values are omitted from API requests. However, any non-pointer,
  5428. // non-interface field appearing in ForceSendFields will be sent to the
  5429. // server regardless of whether the field is empty or not. This may be
  5430. // used to include empty fields in Patch requests.
  5431. ForceSendFields []string `json:"-"`
  5432. // NullFields is a list of field names (e.g. "InfoTypeStats") to include
  5433. // in API requests with the JSON null value. By default, fields with
  5434. // empty values are omitted from API requests. However, any field with
  5435. // an empty value appearing in NullFields will be sent to the server as
  5436. // null. It is an error if a field in this list has a non-empty value.
  5437. // This may be used to include null fields in Patch requests.
  5438. NullFields []string `json:"-"`
  5439. }
  5440. func (s *GooglePrivacyDlpV2Result) MarshalJSON() ([]byte, error) {
  5441. type NoMethod GooglePrivacyDlpV2Result
  5442. raw := NoMethod(*s)
  5443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5444. }
  5445. // GooglePrivacyDlpV2RiskAnalysisJobConfig: Configuration for a risk
  5446. // analysis job.
  5447. // See
  5448. // https://cloud.google.com/dlp/docs/concepts-risk-analysis to learn
  5449. // more.
  5450. type GooglePrivacyDlpV2RiskAnalysisJobConfig struct {
  5451. // Actions: Actions to execute at the completion of the job. Are
  5452. // executed in the order
  5453. // provided.
  5454. Actions []*GooglePrivacyDlpV2Action `json:"actions,omitempty"`
  5455. // PrivacyMetric: Privacy metric to compute.
  5456. PrivacyMetric *GooglePrivacyDlpV2PrivacyMetric `json:"privacyMetric,omitempty"`
  5457. // SourceTable: Input dataset to compute metrics over.
  5458. SourceTable *GooglePrivacyDlpV2BigQueryTable `json:"sourceTable,omitempty"`
  5459. // ForceSendFields is a list of field names (e.g. "Actions") to
  5460. // unconditionally include in API requests. By default, fields with
  5461. // empty values are omitted from API requests. However, any non-pointer,
  5462. // non-interface field appearing in ForceSendFields will be sent to the
  5463. // server regardless of whether the field is empty or not. This may be
  5464. // used to include empty fields in Patch requests.
  5465. ForceSendFields []string `json:"-"`
  5466. // NullFields is a list of field names (e.g. "Actions") to include in
  5467. // API requests with the JSON null value. By default, fields with empty
  5468. // values are omitted from API requests. However, any field with an
  5469. // empty value appearing in NullFields will be sent to the server as
  5470. // null. It is an error if a field in this list has a non-empty value.
  5471. // This may be used to include null fields in Patch requests.
  5472. NullFields []string `json:"-"`
  5473. }
  5474. func (s *GooglePrivacyDlpV2RiskAnalysisJobConfig) MarshalJSON() ([]byte, error) {
  5475. type NoMethod GooglePrivacyDlpV2RiskAnalysisJobConfig
  5476. raw := NoMethod(*s)
  5477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5478. }
  5479. type GooglePrivacyDlpV2Row struct {
  5480. Values []*GooglePrivacyDlpV2Value `json:"values,omitempty"`
  5481. // ForceSendFields is a list of field names (e.g. "Values") to
  5482. // unconditionally include in API requests. By default, fields with
  5483. // empty values are omitted from API requests. However, any non-pointer,
  5484. // non-interface field appearing in ForceSendFields will be sent to the
  5485. // server regardless of whether the field is empty or not. This may be
  5486. // used to include empty fields in Patch requests.
  5487. ForceSendFields []string `json:"-"`
  5488. // NullFields is a list of field names (e.g. "Values") to include in API
  5489. // requests with the JSON null value. By default, fields with empty
  5490. // values are omitted from API requests. However, any field with an
  5491. // empty value appearing in NullFields will be sent to the server as
  5492. // null. It is an error if a field in this list has a non-empty value.
  5493. // This may be used to include null fields in Patch requests.
  5494. NullFields []string `json:"-"`
  5495. }
  5496. func (s *GooglePrivacyDlpV2Row) MarshalJSON() ([]byte, error) {
  5497. type NoMethod GooglePrivacyDlpV2Row
  5498. raw := NoMethod(*s)
  5499. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5500. }
  5501. // GooglePrivacyDlpV2SaveFindings: If set, the detailed findings will be
  5502. // persisted to the specified
  5503. // OutputStorageConfig. Only a single instance of this action can
  5504. // be
  5505. // specified.
  5506. // Compatible with: Inspect, Risk
  5507. type GooglePrivacyDlpV2SaveFindings struct {
  5508. OutputConfig *GooglePrivacyDlpV2OutputStorageConfig `json:"outputConfig,omitempty"`
  5509. // ForceSendFields is a list of field names (e.g. "OutputConfig") to
  5510. // unconditionally include in API requests. By default, fields with
  5511. // empty values are omitted from API requests. However, any non-pointer,
  5512. // non-interface field appearing in ForceSendFields will be sent to the
  5513. // server regardless of whether the field is empty or not. This may be
  5514. // used to include empty fields in Patch requests.
  5515. ForceSendFields []string `json:"-"`
  5516. // NullFields is a list of field names (e.g. "OutputConfig") to include
  5517. // in API requests with the JSON null value. By default, fields with
  5518. // empty values are omitted from API requests. However, any field with
  5519. // an empty value appearing in NullFields will be sent to the server as
  5520. // null. It is an error if a field in this list has a non-empty value.
  5521. // This may be used to include null fields in Patch requests.
  5522. NullFields []string `json:"-"`
  5523. }
  5524. func (s *GooglePrivacyDlpV2SaveFindings) MarshalJSON() ([]byte, error) {
  5525. type NoMethod GooglePrivacyDlpV2SaveFindings
  5526. raw := NoMethod(*s)
  5527. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5528. }
  5529. // GooglePrivacyDlpV2Schedule: Schedule for triggeredJobs.
  5530. type GooglePrivacyDlpV2Schedule struct {
  5531. // RecurrencePeriodDuration: With this option a job is started a regular
  5532. // periodic basis. For
  5533. // example: every day (86400 seconds).
  5534. //
  5535. // A scheduled start time will be skipped if the previous
  5536. // execution has not ended when its scheduled time occurs.
  5537. //
  5538. // This value must be set to a time duration greater than or equal
  5539. // to 1 day and can be no longer than 60 days.
  5540. RecurrencePeriodDuration string `json:"recurrencePeriodDuration,omitempty"`
  5541. // ForceSendFields is a list of field names (e.g.
  5542. // "RecurrencePeriodDuration") to unconditionally include in API
  5543. // requests. By default, fields with empty values are omitted from API
  5544. // requests. However, any non-pointer, non-interface field appearing in
  5545. // ForceSendFields will be sent to the server regardless of whether the
  5546. // field is empty or not. This may be used to include empty fields in
  5547. // Patch requests.
  5548. ForceSendFields []string `json:"-"`
  5549. // NullFields is a list of field names (e.g. "RecurrencePeriodDuration")
  5550. // to include in API requests with the JSON null value. By default,
  5551. // fields with empty values are omitted from API requests. However, any
  5552. // field with an empty value appearing in NullFields will be sent to the
  5553. // server as null. It is an error if a field in this list has a
  5554. // non-empty value. This may be used to include null fields in Patch
  5555. // requests.
  5556. NullFields []string `json:"-"`
  5557. }
  5558. func (s *GooglePrivacyDlpV2Schedule) MarshalJSON() ([]byte, error) {
  5559. type NoMethod GooglePrivacyDlpV2Schedule
  5560. raw := NoMethod(*s)
  5561. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5562. }
  5563. // GooglePrivacyDlpV2StatisticalTable: An auxiliary table containing
  5564. // statistical information on the relative
  5565. // frequency of different quasi-identifiers values. It has one or
  5566. // several
  5567. // quasi-identifiers columns, and one column that indicates the
  5568. // relative
  5569. // frequency of each quasi-identifier tuple.
  5570. // If a tuple is present in the data but not in the auxiliary table,
  5571. // the
  5572. // corresponding relative frequency is assumed to be zero (and thus,
  5573. // the
  5574. // tuple is highly reidentifiable).
  5575. type GooglePrivacyDlpV2StatisticalTable struct {
  5576. // QuasiIds: Quasi-identifier columns. [required]
  5577. QuasiIds []*GooglePrivacyDlpV2QuasiIdentifierField `json:"quasiIds,omitempty"`
  5578. // RelativeFrequency: The relative frequency column must contain a
  5579. // floating-point number
  5580. // between 0 and 1 (inclusive). Null values are assumed to be
  5581. // zero.
  5582. // [required]
  5583. RelativeFrequency *GooglePrivacyDlpV2FieldId `json:"relativeFrequency,omitempty"`
  5584. // Table: Auxiliary table location. [required]
  5585. Table *GooglePrivacyDlpV2BigQueryTable `json:"table,omitempty"`
  5586. // ForceSendFields is a list of field names (e.g. "QuasiIds") to
  5587. // unconditionally include in API requests. By default, fields with
  5588. // empty values are omitted from API requests. However, any non-pointer,
  5589. // non-interface field appearing in ForceSendFields will be sent to the
  5590. // server regardless of whether the field is empty or not. This may be
  5591. // used to include empty fields in Patch requests.
  5592. ForceSendFields []string `json:"-"`
  5593. // NullFields is a list of field names (e.g. "QuasiIds") to include in
  5594. // API requests with the JSON null value. By default, fields with empty
  5595. // values are omitted from API requests. However, any field with an
  5596. // empty value appearing in NullFields will be sent to the server as
  5597. // null. It is an error if a field in this list has a non-empty value.
  5598. // This may be used to include null fields in Patch requests.
  5599. NullFields []string `json:"-"`
  5600. }
  5601. func (s *GooglePrivacyDlpV2StatisticalTable) MarshalJSON() ([]byte, error) {
  5602. type NoMethod GooglePrivacyDlpV2StatisticalTable
  5603. raw := NoMethod(*s)
  5604. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5605. }
  5606. // GooglePrivacyDlpV2StorageConfig: Shared message indicating Cloud
  5607. // storage type.
  5608. type GooglePrivacyDlpV2StorageConfig struct {
  5609. // BigQueryOptions: BigQuery options specification.
  5610. BigQueryOptions *GooglePrivacyDlpV2BigQueryOptions `json:"bigQueryOptions,omitempty"`
  5611. // CloudStorageOptions: Google Cloud Storage options specification.
  5612. CloudStorageOptions *GooglePrivacyDlpV2CloudStorageOptions `json:"cloudStorageOptions,omitempty"`
  5613. // DatastoreOptions: Google Cloud Datastore options specification.
  5614. DatastoreOptions *GooglePrivacyDlpV2DatastoreOptions `json:"datastoreOptions,omitempty"`
  5615. TimespanConfig *GooglePrivacyDlpV2TimespanConfig `json:"timespanConfig,omitempty"`
  5616. // ForceSendFields is a list of field names (e.g. "BigQueryOptions") to
  5617. // unconditionally include in API requests. By default, fields with
  5618. // empty values are omitted from API requests. However, any non-pointer,
  5619. // non-interface field appearing in ForceSendFields will be sent to the
  5620. // server regardless of whether the field is empty or not. This may be
  5621. // used to include empty fields in Patch requests.
  5622. ForceSendFields []string `json:"-"`
  5623. // NullFields is a list of field names (e.g. "BigQueryOptions") to
  5624. // include in API requests with the JSON null value. By default, fields
  5625. // with empty values are omitted from API requests. However, any field
  5626. // with an empty value appearing in NullFields will be sent to the
  5627. // server as null. It is an error if a field in this list has a
  5628. // non-empty value. This may be used to include null fields in Patch
  5629. // requests.
  5630. NullFields []string `json:"-"`
  5631. }
  5632. func (s *GooglePrivacyDlpV2StorageConfig) MarshalJSON() ([]byte, error) {
  5633. type NoMethod GooglePrivacyDlpV2StorageConfig
  5634. raw := NoMethod(*s)
  5635. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5636. }
  5637. // GooglePrivacyDlpV2StoredInfoType: StoredInfoType resource message
  5638. // that contains information about the current
  5639. // version and any pending updates.
  5640. type GooglePrivacyDlpV2StoredInfoType struct {
  5641. // CurrentVersion: Current version of the stored info type.
  5642. CurrentVersion *GooglePrivacyDlpV2StoredInfoTypeVersion `json:"currentVersion,omitempty"`
  5643. // Name: Resource name.
  5644. Name string `json:"name,omitempty"`
  5645. // PendingVersions: Pending versions of the stored info type. Empty if
  5646. // no versions are
  5647. // pending.
  5648. PendingVersions []*GooglePrivacyDlpV2StoredInfoTypeVersion `json:"pendingVersions,omitempty"`
  5649. // ServerResponse contains the HTTP response code and headers from the
  5650. // server.
  5651. googleapi.ServerResponse `json:"-"`
  5652. // ForceSendFields is a list of field names (e.g. "CurrentVersion") to
  5653. // unconditionally include in API requests. By default, fields with
  5654. // empty values are omitted from API requests. However, any non-pointer,
  5655. // non-interface field appearing in ForceSendFields will be sent to the
  5656. // server regardless of whether the field is empty or not. This may be
  5657. // used to include empty fields in Patch requests.
  5658. ForceSendFields []string `json:"-"`
  5659. // NullFields is a list of field names (e.g. "CurrentVersion") to
  5660. // include in API requests with the JSON null value. By default, fields
  5661. // with empty values are omitted from API requests. However, any field
  5662. // with an empty value appearing in NullFields will be sent to the
  5663. // server as null. It is an error if a field in this list has a
  5664. // non-empty value. This may be used to include null fields in Patch
  5665. // requests.
  5666. NullFields []string `json:"-"`
  5667. }
  5668. func (s *GooglePrivacyDlpV2StoredInfoType) MarshalJSON() ([]byte, error) {
  5669. type NoMethod GooglePrivacyDlpV2StoredInfoType
  5670. raw := NoMethod(*s)
  5671. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5672. }
  5673. // GooglePrivacyDlpV2StoredInfoTypeConfig: Configuration for a
  5674. // StoredInfoType.
  5675. type GooglePrivacyDlpV2StoredInfoTypeConfig struct {
  5676. // Description: Description of the StoredInfoType (max 256 characters).
  5677. Description string `json:"description,omitempty"`
  5678. // DisplayName: Display name of the StoredInfoType (max 256 characters).
  5679. DisplayName string `json:"displayName,omitempty"`
  5680. // LargeCustomDictionary: StoredInfoType where findings are defined by a
  5681. // dictionary of phrases.
  5682. LargeCustomDictionary *GooglePrivacyDlpV2LargeCustomDictionaryConfig `json:"largeCustomDictionary,omitempty"`
  5683. // ForceSendFields is a list of field names (e.g. "Description") to
  5684. // unconditionally include in API requests. By default, fields with
  5685. // empty values are omitted from API requests. However, any non-pointer,
  5686. // non-interface field appearing in ForceSendFields will be sent to the
  5687. // server regardless of whether the field is empty or not. This may be
  5688. // used to include empty fields in Patch requests.
  5689. ForceSendFields []string `json:"-"`
  5690. // NullFields is a list of field names (e.g. "Description") to include
  5691. // in API requests with the JSON null value. By default, fields with
  5692. // empty values are omitted from API requests. However, any field with
  5693. // an empty value appearing in NullFields will be sent to the server as
  5694. // null. It is an error if a field in this list has a non-empty value.
  5695. // This may be used to include null fields in Patch requests.
  5696. NullFields []string `json:"-"`
  5697. }
  5698. func (s *GooglePrivacyDlpV2StoredInfoTypeConfig) MarshalJSON() ([]byte, error) {
  5699. type NoMethod GooglePrivacyDlpV2StoredInfoTypeConfig
  5700. raw := NoMethod(*s)
  5701. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5702. }
  5703. // GooglePrivacyDlpV2StoredInfoTypeVersion: Version of a StoredInfoType,
  5704. // including the configuration used to build it,
  5705. // create timestamp, and current state.
  5706. type GooglePrivacyDlpV2StoredInfoTypeVersion struct {
  5707. // Config: StoredInfoType configuration.
  5708. Config *GooglePrivacyDlpV2StoredInfoTypeConfig `json:"config,omitempty"`
  5709. // CreateTime: Create timestamp of the version. Read-only, determined by
  5710. // the system
  5711. // when the version is created.
  5712. CreateTime string `json:"createTime,omitempty"`
  5713. // Errors: Errors that occurred when creating this storedInfoType
  5714. // version, or
  5715. // anomalies detected in the storedInfoType data that render it
  5716. // unusable. Only
  5717. // the five most recent errors will be displayed, with the most recent
  5718. // error
  5719. // appearing first.
  5720. // <p>For example, some of the data for stored custom dictionaries is
  5721. // put in
  5722. // the user's Google Cloud Storage bucket, and if this data is modified
  5723. // or
  5724. // deleted by the user or another system, the dictionary becomes
  5725. // invalid.
  5726. // <p>If any errors occur, fix the problem indicated by the error
  5727. // message and
  5728. // use the UpdateStoredInfoType API method to create another version of
  5729. // the
  5730. // storedInfoType to continue using it, reusing the same `config` if it
  5731. // was
  5732. // not the source of the error.
  5733. Errors []*GooglePrivacyDlpV2Error `json:"errors,omitempty"`
  5734. // State: Stored info type version state. Read-only, updated by the
  5735. // system
  5736. // during dictionary creation.
  5737. //
  5738. // Possible values:
  5739. // "STORED_INFO_TYPE_STATE_UNSPECIFIED"
  5740. // "PENDING" - StoredInfoType version is being created.
  5741. // "READY" - StoredInfoType version is ready for use.
  5742. // "FAILED" - StoredInfoType creation failed. All relevant error
  5743. // messages are returned in
  5744. // the `StoredInfoTypeVersion` message.
  5745. // "INVALID" - StoredInfoType is no longer valid because artifacts
  5746. // stored in
  5747. // user-controlled storage were modified. To fix an invalid
  5748. // StoredInfoType,
  5749. // use the `UpdateStoredInfoType` method to create a new version.
  5750. State string `json:"state,omitempty"`
  5751. // ForceSendFields is a list of field names (e.g. "Config") to
  5752. // unconditionally include in API requests. By default, fields with
  5753. // empty values are omitted from API requests. However, any non-pointer,
  5754. // non-interface field appearing in ForceSendFields will be sent to the
  5755. // server regardless of whether the field is empty or not. This may be
  5756. // used to include empty fields in Patch requests.
  5757. ForceSendFields []string `json:"-"`
  5758. // NullFields is a list of field names (e.g. "Config") to include in API
  5759. // requests with the JSON null value. By default, fields with empty
  5760. // values are omitted from API requests. However, any field with an
  5761. // empty value appearing in NullFields will be sent to the server as
  5762. // null. It is an error if a field in this list has a non-empty value.
  5763. // This may be used to include null fields in Patch requests.
  5764. NullFields []string `json:"-"`
  5765. }
  5766. func (s *GooglePrivacyDlpV2StoredInfoTypeVersion) MarshalJSON() ([]byte, error) {
  5767. type NoMethod GooglePrivacyDlpV2StoredInfoTypeVersion
  5768. raw := NoMethod(*s)
  5769. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5770. }
  5771. // GooglePrivacyDlpV2StoredType: A reference to a StoredInfoType to use
  5772. // with scanning.
  5773. type GooglePrivacyDlpV2StoredType struct {
  5774. // CreateTime: Timestamp indicating when the version of the
  5775. // `StoredInfoType` used for
  5776. // inspection was created. Output-only field, populated by the system.
  5777. CreateTime string `json:"createTime,omitempty"`
  5778. // Name: Resource name of the requested `StoredInfoType`, for
  5779. // example
  5780. // `organizations/433245324/storedInfoTypes/432452342`
  5781. // or
  5782. // `projects/project-id/storedInfoTypes/432452342`.
  5783. Name string `json:"name,omitempty"`
  5784. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  5785. // unconditionally include in API requests. By default, fields with
  5786. // empty values are omitted from API requests. However, any non-pointer,
  5787. // non-interface field appearing in ForceSendFields will be sent to the
  5788. // server regardless of whether the field is empty or not. This may be
  5789. // used to include empty fields in Patch requests.
  5790. ForceSendFields []string `json:"-"`
  5791. // NullFields is a list of field names (e.g. "CreateTime") to include in
  5792. // API requests with the JSON null value. By default, fields with empty
  5793. // values are omitted from API requests. However, any field with an
  5794. // empty value appearing in NullFields will be sent to the server as
  5795. // null. It is an error if a field in this list has a non-empty value.
  5796. // This may be used to include null fields in Patch requests.
  5797. NullFields []string `json:"-"`
  5798. }
  5799. func (s *GooglePrivacyDlpV2StoredType) MarshalJSON() ([]byte, error) {
  5800. type NoMethod GooglePrivacyDlpV2StoredType
  5801. raw := NoMethod(*s)
  5802. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5803. }
  5804. // GooglePrivacyDlpV2SummaryResult: A collection that informs the user
  5805. // the number of times a particular
  5806. // `TransformationResultCode` and error details occurred.
  5807. type GooglePrivacyDlpV2SummaryResult struct {
  5808. // Possible values:
  5809. // "TRANSFORMATION_RESULT_CODE_UNSPECIFIED"
  5810. // "SUCCESS"
  5811. // "ERROR"
  5812. Code string `json:"code,omitempty"`
  5813. Count int64 `json:"count,omitempty,string"`
  5814. // Details: A place for warnings or errors to show up if a
  5815. // transformation didn't
  5816. // work as expected.
  5817. Details string `json:"details,omitempty"`
  5818. // ForceSendFields is a list of field names (e.g. "Code") to
  5819. // unconditionally include in API requests. By default, fields with
  5820. // empty values are omitted from API requests. However, any non-pointer,
  5821. // non-interface field appearing in ForceSendFields will be sent to the
  5822. // server regardless of whether the field is empty or not. This may be
  5823. // used to include empty fields in Patch requests.
  5824. ForceSendFields []string `json:"-"`
  5825. // NullFields is a list of field names (e.g. "Code") to include in API
  5826. // requests with the JSON null value. By default, fields with empty
  5827. // values are omitted from API requests. However, any field with an
  5828. // empty value appearing in NullFields will be sent to the server as
  5829. // null. It is an error if a field in this list has a non-empty value.
  5830. // This may be used to include null fields in Patch requests.
  5831. NullFields []string `json:"-"`
  5832. }
  5833. func (s *GooglePrivacyDlpV2SummaryResult) MarshalJSON() ([]byte, error) {
  5834. type NoMethod GooglePrivacyDlpV2SummaryResult
  5835. raw := NoMethod(*s)
  5836. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5837. }
  5838. // GooglePrivacyDlpV2SurrogateType: Message for detecting output from
  5839. // deidentification transformations
  5840. // such
  5841. // as
  5842. // [`CryptoReplaceFfxFpeConfig`](/dlp/docs/reference/rest/v2/organizat
  5843. // ions.deidentifyTemplates#cryptoreplaceffxfpeconfig).
  5844. // These types of transformations are
  5845. // those that perform pseudonymization, thereby producing a "surrogate"
  5846. // as
  5847. // output. This should be used in conjunction with a field on
  5848. // the
  5849. // transformation such as `surrogate_info_type`. This CustomInfoType
  5850. // does
  5851. // not support the use of `detection_rules`.
  5852. type GooglePrivacyDlpV2SurrogateType struct {
  5853. }
  5854. // GooglePrivacyDlpV2Table: Structured content to inspect. Up to 50,000
  5855. // `Value`s per request allowed.
  5856. // See
  5857. // https://cloud.google.com/dlp/docs/inspecting-text#inspecting_a_table
  5858. // to
  5859. // learn more.
  5860. type GooglePrivacyDlpV2Table struct {
  5861. Headers []*GooglePrivacyDlpV2FieldId `json:"headers,omitempty"`
  5862. Rows []*GooglePrivacyDlpV2Row `json:"rows,omitempty"`
  5863. // ForceSendFields is a list of field names (e.g. "Headers") to
  5864. // unconditionally include in API requests. By default, fields with
  5865. // empty values are omitted from API requests. However, any non-pointer,
  5866. // non-interface field appearing in ForceSendFields will be sent to the
  5867. // server regardless of whether the field is empty or not. This may be
  5868. // used to include empty fields in Patch requests.
  5869. ForceSendFields []string `json:"-"`
  5870. // NullFields is a list of field names (e.g. "Headers") to include in
  5871. // API requests with the JSON null value. By default, fields with empty
  5872. // values are omitted from API requests. However, any field with an
  5873. // empty value appearing in NullFields will be sent to the server as
  5874. // null. It is an error if a field in this list has a non-empty value.
  5875. // This may be used to include null fields in Patch requests.
  5876. NullFields []string `json:"-"`
  5877. }
  5878. func (s *GooglePrivacyDlpV2Table) MarshalJSON() ([]byte, error) {
  5879. type NoMethod GooglePrivacyDlpV2Table
  5880. raw := NoMethod(*s)
  5881. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5882. }
  5883. // GooglePrivacyDlpV2TableLocation: Location of a finding within a
  5884. // table.
  5885. type GooglePrivacyDlpV2TableLocation struct {
  5886. // RowIndex: The zero-based index of the row where the finding is
  5887. // located.
  5888. RowIndex int64 `json:"rowIndex,omitempty,string"`
  5889. // ForceSendFields is a list of field names (e.g. "RowIndex") to
  5890. // unconditionally include in API requests. By default, fields with
  5891. // empty values are omitted from API requests. However, any non-pointer,
  5892. // non-interface field appearing in ForceSendFields will be sent to the
  5893. // server regardless of whether the field is empty or not. This may be
  5894. // used to include empty fields in Patch requests.
  5895. ForceSendFields []string `json:"-"`
  5896. // NullFields is a list of field names (e.g. "RowIndex") to include in
  5897. // API requests with the JSON null value. By default, fields with empty
  5898. // values are omitted from API requests. However, any field with an
  5899. // empty value appearing in NullFields will be sent to the server as
  5900. // null. It is an error if a field in this list has a non-empty value.
  5901. // This may be used to include null fields in Patch requests.
  5902. NullFields []string `json:"-"`
  5903. }
  5904. func (s *GooglePrivacyDlpV2TableLocation) MarshalJSON() ([]byte, error) {
  5905. type NoMethod GooglePrivacyDlpV2TableLocation
  5906. raw := NoMethod(*s)
  5907. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5908. }
  5909. type GooglePrivacyDlpV2TaggedField struct {
  5910. // CustomTag: A column can be tagged with a custom tag. In this case,
  5911. // the user must
  5912. // indicate an auxiliary table that contains statistical information
  5913. // on
  5914. // the possible values of this column (below).
  5915. CustomTag string `json:"customTag,omitempty"`
  5916. // Field: Identifies the column. [required]
  5917. Field *GooglePrivacyDlpV2FieldId `json:"field,omitempty"`
  5918. // Inferred: If no semantic tag is indicated, we infer the statistical
  5919. // model from
  5920. // the distribution of values in the input data
  5921. Inferred *GoogleProtobufEmpty `json:"inferred,omitempty"`
  5922. // InfoType: A column can be tagged with a InfoType to use the relevant
  5923. // public
  5924. // dataset as a statistical model of population, if available.
  5925. // We
  5926. // currently support US ZIP codes, region codes, ages and genders.
  5927. // To programmatically obtain the list of supported InfoTypes,
  5928. // use
  5929. // ListInfoTypes with the supported_by=RISK_ANALYSIS filter.
  5930. InfoType *GooglePrivacyDlpV2InfoType `json:"infoType,omitempty"`
  5931. // ForceSendFields is a list of field names (e.g. "CustomTag") to
  5932. // unconditionally include in API requests. By default, fields with
  5933. // empty values are omitted from API requests. However, any non-pointer,
  5934. // non-interface field appearing in ForceSendFields will be sent to the
  5935. // server regardless of whether the field is empty or not. This may be
  5936. // used to include empty fields in Patch requests.
  5937. ForceSendFields []string `json:"-"`
  5938. // NullFields is a list of field names (e.g. "CustomTag") to include in
  5939. // API requests with the JSON null value. By default, fields with empty
  5940. // values are omitted from API requests. However, any field with an
  5941. // empty value appearing in NullFields will be sent to the server as
  5942. // null. It is an error if a field in this list has a non-empty value.
  5943. // This may be used to include null fields in Patch requests.
  5944. NullFields []string `json:"-"`
  5945. }
  5946. func (s *GooglePrivacyDlpV2TaggedField) MarshalJSON() ([]byte, error) {
  5947. type NoMethod GooglePrivacyDlpV2TaggedField
  5948. raw := NoMethod(*s)
  5949. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5950. }
  5951. // GooglePrivacyDlpV2TimePartConfig: For use with `Date`, `Timestamp`,
  5952. // and `TimeOfDay`, extract or preserve a
  5953. // portion of the value.
  5954. type GooglePrivacyDlpV2TimePartConfig struct {
  5955. // Possible values:
  5956. // "TIME_PART_UNSPECIFIED"
  5957. // "YEAR" - [0-9999]
  5958. // "MONTH" - [1-12]
  5959. // "DAY_OF_MONTH" - [1-31]
  5960. // "DAY_OF_WEEK" - [1-7]
  5961. // "WEEK_OF_YEAR" - [1-52]
  5962. // "HOUR_OF_DAY" - [0-23]
  5963. PartToExtract string `json:"partToExtract,omitempty"`
  5964. // ForceSendFields is a list of field names (e.g. "PartToExtract") to
  5965. // unconditionally include in API requests. By default, fields with
  5966. // empty values are omitted from API requests. However, any non-pointer,
  5967. // non-interface field appearing in ForceSendFields will be sent to the
  5968. // server regardless of whether the field is empty or not. This may be
  5969. // used to include empty fields in Patch requests.
  5970. ForceSendFields []string `json:"-"`
  5971. // NullFields is a list of field names (e.g. "PartToExtract") to include
  5972. // in API requests with the JSON null value. By default, fields with
  5973. // empty values are omitted from API requests. However, any field with
  5974. // an empty value appearing in NullFields will be sent to the server as
  5975. // null. It is an error if a field in this list has a non-empty value.
  5976. // This may be used to include null fields in Patch requests.
  5977. NullFields []string `json:"-"`
  5978. }
  5979. func (s *GooglePrivacyDlpV2TimePartConfig) MarshalJSON() ([]byte, error) {
  5980. type NoMethod GooglePrivacyDlpV2TimePartConfig
  5981. raw := NoMethod(*s)
  5982. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5983. }
  5984. type GooglePrivacyDlpV2TimeZone struct {
  5985. // OffsetMinutes: Set only if the offset can be determined. Positive for
  5986. // time ahead of UTC.
  5987. // E.g. For "UTC-9", this value is -540.
  5988. OffsetMinutes int64 `json:"offsetMinutes,omitempty"`
  5989. // ForceSendFields is a list of field names (e.g. "OffsetMinutes") to
  5990. // unconditionally include in API requests. By default, fields with
  5991. // empty values are omitted from API requests. However, any non-pointer,
  5992. // non-interface field appearing in ForceSendFields will be sent to the
  5993. // server regardless of whether the field is empty or not. This may be
  5994. // used to include empty fields in Patch requests.
  5995. ForceSendFields []string `json:"-"`
  5996. // NullFields is a list of field names (e.g. "OffsetMinutes") to include
  5997. // in API requests with the JSON null value. By default, fields with
  5998. // empty values are omitted from API requests. However, any field with
  5999. // an empty value appearing in NullFields will be sent to the server as
  6000. // null. It is an error if a field in this list has a non-empty value.
  6001. // This may be used to include null fields in Patch requests.
  6002. NullFields []string `json:"-"`
  6003. }
  6004. func (s *GooglePrivacyDlpV2TimeZone) MarshalJSON() ([]byte, error) {
  6005. type NoMethod GooglePrivacyDlpV2TimeZone
  6006. raw := NoMethod(*s)
  6007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6008. }
  6009. // GooglePrivacyDlpV2TimespanConfig: Configuration of the timespan of
  6010. // the items to include in scanning.
  6011. // Currently only supported when inspecting Google Cloud Storage and
  6012. // BigQuery.
  6013. type GooglePrivacyDlpV2TimespanConfig struct {
  6014. // EnableAutoPopulationOfTimespanConfig: When the job is started by a
  6015. // JobTrigger we will automatically figure out
  6016. // a valid start_time to avoid scanning files that have not been
  6017. // modified
  6018. // since the last time the JobTrigger executed. This will be based on
  6019. // the
  6020. // time of the execution of the last run of the JobTrigger.
  6021. EnableAutoPopulationOfTimespanConfig bool `json:"enableAutoPopulationOfTimespanConfig,omitempty"`
  6022. // EndTime: Exclude files or rows newer than this value.
  6023. // If set to zero, no upper time limit is applied.
  6024. EndTime string `json:"endTime,omitempty"`
  6025. // StartTime: Exclude files or rows older than this value.
  6026. StartTime string `json:"startTime,omitempty"`
  6027. // TimestampField: Specification of the field containing the timestamp
  6028. // of scanned items.
  6029. // Used for data sources like Datastore or BigQuery.
  6030. // If not specified for BigQuery, table last modification timestamp
  6031. // is checked against given time span.
  6032. // The valid data types of the timestamp field are:
  6033. // for BigQuery - timestamp, date, datetime;
  6034. // for Datastore - timestamp.
  6035. // Datastore entity will be scanned if the timestamp property does not
  6036. // exist
  6037. // or its value is empty or invalid.
  6038. TimestampField *GooglePrivacyDlpV2FieldId `json:"timestampField,omitempty"`
  6039. // ForceSendFields is a list of field names (e.g.
  6040. // "EnableAutoPopulationOfTimespanConfig") to unconditionally include in
  6041. // API requests. By default, fields with empty values are omitted from
  6042. // API requests. However, any non-pointer, non-interface field appearing
  6043. // in ForceSendFields will be sent to the server regardless of whether
  6044. // the field is empty or not. This may be used to include empty fields
  6045. // in Patch requests.
  6046. ForceSendFields []string `json:"-"`
  6047. // NullFields is a list of field names (e.g.
  6048. // "EnableAutoPopulationOfTimespanConfig") to include in API requests
  6049. // with the JSON null value. By default, fields with empty values are
  6050. // omitted from API requests. However, any field with an empty value
  6051. // appearing in NullFields will be sent to the server as null. It is an
  6052. // error if a field in this list has a non-empty value. This may be used
  6053. // to include null fields in Patch requests.
  6054. NullFields []string `json:"-"`
  6055. }
  6056. func (s *GooglePrivacyDlpV2TimespanConfig) MarshalJSON() ([]byte, error) {
  6057. type NoMethod GooglePrivacyDlpV2TimespanConfig
  6058. raw := NoMethod(*s)
  6059. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6060. }
  6061. // GooglePrivacyDlpV2TransformationOverview: Overview of the
  6062. // modifications that occurred.
  6063. type GooglePrivacyDlpV2TransformationOverview struct {
  6064. // TransformationSummaries: Transformations applied to the dataset.
  6065. TransformationSummaries []*GooglePrivacyDlpV2TransformationSummary `json:"transformationSummaries,omitempty"`
  6066. // TransformedBytes: Total size in bytes that were transformed in some
  6067. // way.
  6068. TransformedBytes int64 `json:"transformedBytes,omitempty,string"`
  6069. // ForceSendFields is a list of field names (e.g.
  6070. // "TransformationSummaries") to unconditionally include in API
  6071. // requests. By default, fields with empty values are omitted from API
  6072. // requests. However, any non-pointer, non-interface field appearing in
  6073. // ForceSendFields will be sent to the server regardless of whether the
  6074. // field is empty or not. This may be used to include empty fields in
  6075. // Patch requests.
  6076. ForceSendFields []string `json:"-"`
  6077. // NullFields is a list of field names (e.g. "TransformationSummaries")
  6078. // to include in API requests with the JSON null value. By default,
  6079. // fields with empty values are omitted from API requests. However, any
  6080. // field with an empty value appearing in NullFields will be sent to the
  6081. // server as null. It is an error if a field in this list has a
  6082. // non-empty value. This may be used to include null fields in Patch
  6083. // requests.
  6084. NullFields []string `json:"-"`
  6085. }
  6086. func (s *GooglePrivacyDlpV2TransformationOverview) MarshalJSON() ([]byte, error) {
  6087. type NoMethod GooglePrivacyDlpV2TransformationOverview
  6088. raw := NoMethod(*s)
  6089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6090. }
  6091. // GooglePrivacyDlpV2TransformationSummary: Summary of a single
  6092. // transformation.
  6093. // Only one of 'transformation', 'field_transformation', or
  6094. // 'record_suppress'
  6095. // will be set.
  6096. type GooglePrivacyDlpV2TransformationSummary struct {
  6097. // Field: Set if the transformation was limited to a specific FieldId.
  6098. Field *GooglePrivacyDlpV2FieldId `json:"field,omitempty"`
  6099. // FieldTransformations: The field transformation that was applied.
  6100. // If multiple field transformations are requested for a single
  6101. // field,
  6102. // this list will contain all of them; otherwise, only one is supplied.
  6103. FieldTransformations []*GooglePrivacyDlpV2FieldTransformation `json:"fieldTransformations,omitempty"`
  6104. // InfoType: Set if the transformation was limited to a specific
  6105. // InfoType.
  6106. InfoType *GooglePrivacyDlpV2InfoType `json:"infoType,omitempty"`
  6107. // RecordSuppress: The specific suppression option these stats apply to.
  6108. RecordSuppress *GooglePrivacyDlpV2RecordSuppression `json:"recordSuppress,omitempty"`
  6109. Results []*GooglePrivacyDlpV2SummaryResult `json:"results,omitempty"`
  6110. // Transformation: The specific transformation these stats apply to.
  6111. Transformation *GooglePrivacyDlpV2PrimitiveTransformation `json:"transformation,omitempty"`
  6112. // TransformedBytes: Total size in bytes that were transformed in some
  6113. // way.
  6114. TransformedBytes int64 `json:"transformedBytes,omitempty,string"`
  6115. // ForceSendFields is a list of field names (e.g. "Field") to
  6116. // unconditionally include in API requests. By default, fields with
  6117. // empty values are omitted from API requests. However, any non-pointer,
  6118. // non-interface field appearing in ForceSendFields will be sent to the
  6119. // server regardless of whether the field is empty or not. This may be
  6120. // used to include empty fields in Patch requests.
  6121. ForceSendFields []string `json:"-"`
  6122. // NullFields is a list of field names (e.g. "Field") to include in API
  6123. // requests with the JSON null value. By default, fields with empty
  6124. // values are omitted from API requests. However, any field with an
  6125. // empty value appearing in NullFields will be sent to the server as
  6126. // null. It is an error if a field in this list has a non-empty value.
  6127. // This may be used to include null fields in Patch requests.
  6128. NullFields []string `json:"-"`
  6129. }
  6130. func (s *GooglePrivacyDlpV2TransformationSummary) MarshalJSON() ([]byte, error) {
  6131. type NoMethod GooglePrivacyDlpV2TransformationSummary
  6132. raw := NoMethod(*s)
  6133. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6134. }
  6135. // GooglePrivacyDlpV2TransientCryptoKey: Use this to have a random data
  6136. // crypto key generated.
  6137. // It will be discarded after the request finishes.
  6138. type GooglePrivacyDlpV2TransientCryptoKey struct {
  6139. // Name: Name of the key. [required]
  6140. // This is an arbitrary string used to differentiate different keys.
  6141. // A unique key is generated per name: two separate
  6142. // `TransientCryptoKey`
  6143. // protos share the same generated key if their names are the same.
  6144. // When the data crypto key is generated, this name is not used in any
  6145. // way
  6146. // (repeating the api call will result in a different key being
  6147. // generated).
  6148. Name string `json:"name,omitempty"`
  6149. // ForceSendFields is a list of field names (e.g. "Name") to
  6150. // unconditionally include in API requests. By default, fields with
  6151. // empty values are omitted from API requests. However, any non-pointer,
  6152. // non-interface field appearing in ForceSendFields will be sent to the
  6153. // server regardless of whether the field is empty or not. This may be
  6154. // used to include empty fields in Patch requests.
  6155. ForceSendFields []string `json:"-"`
  6156. // NullFields is a list of field names (e.g. "Name") to include in API
  6157. // requests with the JSON null value. By default, fields with empty
  6158. // values are omitted from API requests. However, any field with an
  6159. // empty value appearing in NullFields will be sent to the server as
  6160. // null. It is an error if a field in this list has a non-empty value.
  6161. // This may be used to include null fields in Patch requests.
  6162. NullFields []string `json:"-"`
  6163. }
  6164. func (s *GooglePrivacyDlpV2TransientCryptoKey) MarshalJSON() ([]byte, error) {
  6165. type NoMethod GooglePrivacyDlpV2TransientCryptoKey
  6166. raw := NoMethod(*s)
  6167. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6168. }
  6169. // GooglePrivacyDlpV2Trigger: What event needs to occur for a new job to
  6170. // be started.
  6171. type GooglePrivacyDlpV2Trigger struct {
  6172. // Schedule: Create a job on a repeating basis based on the elapse of
  6173. // time.
  6174. Schedule *GooglePrivacyDlpV2Schedule `json:"schedule,omitempty"`
  6175. // ForceSendFields is a list of field names (e.g. "Schedule") to
  6176. // unconditionally include in API requests. By default, fields with
  6177. // empty values are omitted from API requests. However, any non-pointer,
  6178. // non-interface field appearing in ForceSendFields will be sent to the
  6179. // server regardless of whether the field is empty or not. This may be
  6180. // used to include empty fields in Patch requests.
  6181. ForceSendFields []string `json:"-"`
  6182. // NullFields is a list of field names (e.g. "Schedule") to include in
  6183. // API requests with the JSON null value. By default, fields with empty
  6184. // values are omitted from API requests. However, any field with an
  6185. // empty value appearing in NullFields will be sent to the server as
  6186. // null. It is an error if a field in this list has a non-empty value.
  6187. // This may be used to include null fields in Patch requests.
  6188. NullFields []string `json:"-"`
  6189. }
  6190. func (s *GooglePrivacyDlpV2Trigger) MarshalJSON() ([]byte, error) {
  6191. type NoMethod GooglePrivacyDlpV2Trigger
  6192. raw := NoMethod(*s)
  6193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6194. }
  6195. // GooglePrivacyDlpV2UnwrappedCryptoKey: Using raw keys is prone to
  6196. // security risks due to accidentally
  6197. // leaking the key. Choose another type of key if possible.
  6198. type GooglePrivacyDlpV2UnwrappedCryptoKey struct {
  6199. // Key: A 128/192/256 bit key. [required]
  6200. Key string `json:"key,omitempty"`
  6201. // ForceSendFields is a list of field names (e.g. "Key") to
  6202. // unconditionally include in API requests. By default, fields with
  6203. // empty values are omitted from API requests. However, any non-pointer,
  6204. // non-interface field appearing in ForceSendFields will be sent to the
  6205. // server regardless of whether the field is empty or not. This may be
  6206. // used to include empty fields in Patch requests.
  6207. ForceSendFields []string `json:"-"`
  6208. // NullFields is a list of field names (e.g. "Key") to include in API
  6209. // requests with the JSON null value. By default, fields with empty
  6210. // values are omitted from API requests. However, any field with an
  6211. // empty value appearing in NullFields will be sent to the server as
  6212. // null. It is an error if a field in this list has a non-empty value.
  6213. // This may be used to include null fields in Patch requests.
  6214. NullFields []string `json:"-"`
  6215. }
  6216. func (s *GooglePrivacyDlpV2UnwrappedCryptoKey) MarshalJSON() ([]byte, error) {
  6217. type NoMethod GooglePrivacyDlpV2UnwrappedCryptoKey
  6218. raw := NoMethod(*s)
  6219. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6220. }
  6221. // GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest: Request message
  6222. // for UpdateDeidentifyTemplate.
  6223. type GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest struct {
  6224. // DeidentifyTemplate: New DeidentifyTemplate value.
  6225. DeidentifyTemplate *GooglePrivacyDlpV2DeidentifyTemplate `json:"deidentifyTemplate,omitempty"`
  6226. // UpdateMask: Mask to control which fields get updated.
  6227. UpdateMask string `json:"updateMask,omitempty"`
  6228. // ForceSendFields is a list of field names (e.g. "DeidentifyTemplate")
  6229. // to unconditionally include in API requests. By default, fields with
  6230. // empty values are omitted from API requests. However, any non-pointer,
  6231. // non-interface field appearing in ForceSendFields will be sent to the
  6232. // server regardless of whether the field is empty or not. This may be
  6233. // used to include empty fields in Patch requests.
  6234. ForceSendFields []string `json:"-"`
  6235. // NullFields is a list of field names (e.g. "DeidentifyTemplate") to
  6236. // include in API requests with the JSON null value. By default, fields
  6237. // with empty values are omitted from API requests. However, any field
  6238. // with an empty value appearing in NullFields will be sent to the
  6239. // server as null. It is an error if a field in this list has a
  6240. // non-empty value. This may be used to include null fields in Patch
  6241. // requests.
  6242. NullFields []string `json:"-"`
  6243. }
  6244. func (s *GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest) MarshalJSON() ([]byte, error) {
  6245. type NoMethod GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest
  6246. raw := NoMethod(*s)
  6247. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6248. }
  6249. // GooglePrivacyDlpV2UpdateInspectTemplateRequest: Request message for
  6250. // UpdateInspectTemplate.
  6251. type GooglePrivacyDlpV2UpdateInspectTemplateRequest struct {
  6252. // InspectTemplate: New InspectTemplate value.
  6253. InspectTemplate *GooglePrivacyDlpV2InspectTemplate `json:"inspectTemplate,omitempty"`
  6254. // UpdateMask: Mask to control which fields get updated.
  6255. UpdateMask string `json:"updateMask,omitempty"`
  6256. // ForceSendFields is a list of field names (e.g. "InspectTemplate") to
  6257. // unconditionally include in API requests. By default, fields with
  6258. // empty values are omitted from API requests. However, any non-pointer,
  6259. // non-interface field appearing in ForceSendFields will be sent to the
  6260. // server regardless of whether the field is empty or not. This may be
  6261. // used to include empty fields in Patch requests.
  6262. ForceSendFields []string `json:"-"`
  6263. // NullFields is a list of field names (e.g. "InspectTemplate") to
  6264. // include in API requests with the JSON null value. By default, fields
  6265. // with empty values are omitted from API requests. However, any field
  6266. // with an empty value appearing in NullFields will be sent to the
  6267. // server as null. It is an error if a field in this list has a
  6268. // non-empty value. This may be used to include null fields in Patch
  6269. // requests.
  6270. NullFields []string `json:"-"`
  6271. }
  6272. func (s *GooglePrivacyDlpV2UpdateInspectTemplateRequest) MarshalJSON() ([]byte, error) {
  6273. type NoMethod GooglePrivacyDlpV2UpdateInspectTemplateRequest
  6274. raw := NoMethod(*s)
  6275. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6276. }
  6277. // GooglePrivacyDlpV2UpdateJobTriggerRequest: Request message for
  6278. // UpdateJobTrigger.
  6279. type GooglePrivacyDlpV2UpdateJobTriggerRequest struct {
  6280. // JobTrigger: New JobTrigger value.
  6281. JobTrigger *GooglePrivacyDlpV2JobTrigger `json:"jobTrigger,omitempty"`
  6282. // UpdateMask: Mask to control which fields get updated.
  6283. UpdateMask string `json:"updateMask,omitempty"`
  6284. // ForceSendFields is a list of field names (e.g. "JobTrigger") to
  6285. // unconditionally include in API requests. By default, fields with
  6286. // empty values are omitted from API requests. However, any non-pointer,
  6287. // non-interface field appearing in ForceSendFields will be sent to the
  6288. // server regardless of whether the field is empty or not. This may be
  6289. // used to include empty fields in Patch requests.
  6290. ForceSendFields []string `json:"-"`
  6291. // NullFields is a list of field names (e.g. "JobTrigger") to include in
  6292. // API requests with the JSON null value. By default, fields with empty
  6293. // values are omitted from API requests. However, any field with an
  6294. // empty value appearing in NullFields will be sent to the server as
  6295. // null. It is an error if a field in this list has a non-empty value.
  6296. // This may be used to include null fields in Patch requests.
  6297. NullFields []string `json:"-"`
  6298. }
  6299. func (s *GooglePrivacyDlpV2UpdateJobTriggerRequest) MarshalJSON() ([]byte, error) {
  6300. type NoMethod GooglePrivacyDlpV2UpdateJobTriggerRequest
  6301. raw := NoMethod(*s)
  6302. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6303. }
  6304. // GooglePrivacyDlpV2UpdateStoredInfoTypeRequest: Request message for
  6305. // UpdateStoredInfoType.
  6306. type GooglePrivacyDlpV2UpdateStoredInfoTypeRequest struct {
  6307. // Config: Updated configuration for the storedInfoType. If not
  6308. // provided, a new
  6309. // version of the storedInfoType will be created with the
  6310. // existing
  6311. // configuration.
  6312. Config *GooglePrivacyDlpV2StoredInfoTypeConfig `json:"config,omitempty"`
  6313. // UpdateMask: Mask to control which fields get updated.
  6314. UpdateMask string `json:"updateMask,omitempty"`
  6315. // ForceSendFields is a list of field names (e.g. "Config") to
  6316. // unconditionally include in API requests. By default, fields with
  6317. // empty values are omitted from API requests. However, any non-pointer,
  6318. // non-interface field appearing in ForceSendFields will be sent to the
  6319. // server regardless of whether the field is empty or not. This may be
  6320. // used to include empty fields in Patch requests.
  6321. ForceSendFields []string `json:"-"`
  6322. // NullFields is a list of field names (e.g. "Config") to include in API
  6323. // requests with the JSON null value. By default, fields with empty
  6324. // values are omitted from API requests. However, any field with an
  6325. // empty value appearing in NullFields will be sent to the server as
  6326. // null. It is an error if a field in this list has a non-empty value.
  6327. // This may be used to include null fields in Patch requests.
  6328. NullFields []string `json:"-"`
  6329. }
  6330. func (s *GooglePrivacyDlpV2UpdateStoredInfoTypeRequest) MarshalJSON() ([]byte, error) {
  6331. type NoMethod GooglePrivacyDlpV2UpdateStoredInfoTypeRequest
  6332. raw := NoMethod(*s)
  6333. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6334. }
  6335. // GooglePrivacyDlpV2Value: Set of primitive values supported by the
  6336. // system.
  6337. // Note that for the purposes of inspection or transformation, the
  6338. // number
  6339. // of bytes considered to comprise a 'Value' is based on its
  6340. // representation
  6341. // as a UTF-8 encoded string. For example, if 'integer_value' is set
  6342. // to
  6343. // 123456789, the number of bytes would be counted as 9, even though
  6344. // an
  6345. // int64 only holds up to 8 bytes of data.
  6346. type GooglePrivacyDlpV2Value struct {
  6347. BooleanValue bool `json:"booleanValue,omitempty"`
  6348. DateValue *GoogleTypeDate `json:"dateValue,omitempty"`
  6349. // Possible values:
  6350. // "DAY_OF_WEEK_UNSPECIFIED" - The unspecified day-of-week.
  6351. // "MONDAY" - The day-of-week of Monday.
  6352. // "TUESDAY" - The day-of-week of Tuesday.
  6353. // "WEDNESDAY" - The day-of-week of Wednesday.
  6354. // "THURSDAY" - The day-of-week of Thursday.
  6355. // "FRIDAY" - The day-of-week of Friday.
  6356. // "SATURDAY" - The day-of-week of Saturday.
  6357. // "SUNDAY" - The day-of-week of Sunday.
  6358. DayOfWeekValue string `json:"dayOfWeekValue,omitempty"`
  6359. FloatValue float64 `json:"floatValue,omitempty"`
  6360. IntegerValue int64 `json:"integerValue,omitempty,string"`
  6361. StringValue string `json:"stringValue,omitempty"`
  6362. TimeValue *GoogleTypeTimeOfDay `json:"timeValue,omitempty"`
  6363. TimestampValue string `json:"timestampValue,omitempty"`
  6364. // ForceSendFields is a list of field names (e.g. "BooleanValue") to
  6365. // unconditionally include in API requests. By default, fields with
  6366. // empty values are omitted from API requests. However, any non-pointer,
  6367. // non-interface field appearing in ForceSendFields will be sent to the
  6368. // server regardless of whether the field is empty or not. This may be
  6369. // used to include empty fields in Patch requests.
  6370. ForceSendFields []string `json:"-"`
  6371. // NullFields is a list of field names (e.g. "BooleanValue") to include
  6372. // in API requests with the JSON null value. By default, fields with
  6373. // empty values are omitted from API requests. However, any field with
  6374. // an empty value appearing in NullFields will be sent to the server as
  6375. // null. It is an error if a field in this list has a non-empty value.
  6376. // This may be used to include null fields in Patch requests.
  6377. NullFields []string `json:"-"`
  6378. }
  6379. func (s *GooglePrivacyDlpV2Value) MarshalJSON() ([]byte, error) {
  6380. type NoMethod GooglePrivacyDlpV2Value
  6381. raw := NoMethod(*s)
  6382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6383. }
  6384. func (s *GooglePrivacyDlpV2Value) UnmarshalJSON(data []byte) error {
  6385. type NoMethod GooglePrivacyDlpV2Value
  6386. var s1 struct {
  6387. FloatValue gensupport.JSONFloat64 `json:"floatValue"`
  6388. *NoMethod
  6389. }
  6390. s1.NoMethod = (*NoMethod)(s)
  6391. if err := json.Unmarshal(data, &s1); err != nil {
  6392. return err
  6393. }
  6394. s.FloatValue = float64(s1.FloatValue)
  6395. return nil
  6396. }
  6397. // GooglePrivacyDlpV2ValueFrequency: A value of a field, including its
  6398. // frequency.
  6399. type GooglePrivacyDlpV2ValueFrequency struct {
  6400. // Count: How many times the value is contained in the field.
  6401. Count int64 `json:"count,omitempty,string"`
  6402. // Value: A value contained in the field in question.
  6403. Value *GooglePrivacyDlpV2Value `json:"value,omitempty"`
  6404. // ForceSendFields is a list of field names (e.g. "Count") to
  6405. // unconditionally include in API requests. By default, fields with
  6406. // empty values are omitted from API requests. However, any non-pointer,
  6407. // non-interface field appearing in ForceSendFields will be sent to the
  6408. // server regardless of whether the field is empty or not. This may be
  6409. // used to include empty fields in Patch requests.
  6410. ForceSendFields []string `json:"-"`
  6411. // NullFields is a list of field names (e.g. "Count") to include in API
  6412. // requests with the JSON null value. By default, fields with empty
  6413. // values are omitted from API requests. However, any field with an
  6414. // empty value appearing in NullFields will be sent to the server as
  6415. // null. It is an error if a field in this list has a non-empty value.
  6416. // This may be used to include null fields in Patch requests.
  6417. NullFields []string `json:"-"`
  6418. }
  6419. func (s *GooglePrivacyDlpV2ValueFrequency) MarshalJSON() ([]byte, error) {
  6420. type NoMethod GooglePrivacyDlpV2ValueFrequency
  6421. raw := NoMethod(*s)
  6422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6423. }
  6424. // GooglePrivacyDlpV2WordList: Message defining a list of words or
  6425. // phrases to search for in the data.
  6426. type GooglePrivacyDlpV2WordList struct {
  6427. // Words: Words or phrases defining the dictionary. The dictionary must
  6428. // contain
  6429. // at least one phrase and every phrase must contain at least 2
  6430. // characters
  6431. // that are letters or digits. [required]
  6432. Words []string `json:"words,omitempty"`
  6433. // ForceSendFields is a list of field names (e.g. "Words") to
  6434. // unconditionally include in API requests. By default, fields with
  6435. // empty values are omitted from API requests. However, any non-pointer,
  6436. // non-interface field appearing in ForceSendFields will be sent to the
  6437. // server regardless of whether the field is empty or not. This may be
  6438. // used to include empty fields in Patch requests.
  6439. ForceSendFields []string `json:"-"`
  6440. // NullFields is a list of field names (e.g. "Words") to include in API
  6441. // requests with the JSON null value. By default, fields with empty
  6442. // values are omitted from API requests. However, any field with an
  6443. // empty value appearing in NullFields will be sent to the server as
  6444. // null. It is an error if a field in this list has a non-empty value.
  6445. // This may be used to include null fields in Patch requests.
  6446. NullFields []string `json:"-"`
  6447. }
  6448. func (s *GooglePrivacyDlpV2WordList) MarshalJSON() ([]byte, error) {
  6449. type NoMethod GooglePrivacyDlpV2WordList
  6450. raw := NoMethod(*s)
  6451. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6452. }
  6453. // GoogleProtobufEmpty: A generic empty message that you can re-use to
  6454. // avoid defining duplicated
  6455. // empty messages in your APIs. A typical example is to use it as the
  6456. // request
  6457. // or the response type of an API method. For instance:
  6458. //
  6459. // service Foo {
  6460. // rpc Bar(google.protobuf.Empty) returns
  6461. // (google.protobuf.Empty);
  6462. // }
  6463. //
  6464. // The JSON representation for `Empty` is empty JSON object `{}`.
  6465. type GoogleProtobufEmpty struct {
  6466. // ServerResponse contains the HTTP response code and headers from the
  6467. // server.
  6468. googleapi.ServerResponse `json:"-"`
  6469. }
  6470. // GoogleRpcStatus: The `Status` type defines a logical error model that
  6471. // is suitable for
  6472. // different programming environments, including REST APIs and RPC APIs.
  6473. // It is
  6474. // used by [gRPC](https://github.com/grpc). The error model is designed
  6475. // to be:
  6476. //
  6477. // - Simple to use and understand for most users
  6478. // - Flexible enough to meet unexpected needs
  6479. //
  6480. // # Overview
  6481. //
  6482. // The `Status` message contains three pieces of data: error code,
  6483. // error
  6484. // message, and error details. The error code should be an enum value
  6485. // of
  6486. // google.rpc.Code, but it may accept additional error codes if needed.
  6487. // The
  6488. // error message should be a developer-facing English message that
  6489. // helps
  6490. // developers *understand* and *resolve* the error. If a localized
  6491. // user-facing
  6492. // error message is needed, put the localized message in the error
  6493. // details or
  6494. // localize it in the client. The optional error details may contain
  6495. // arbitrary
  6496. // information about the error. There is a predefined set of error
  6497. // detail types
  6498. // in the package `google.rpc` that can be used for common error
  6499. // conditions.
  6500. //
  6501. // # Language mapping
  6502. //
  6503. // The `Status` message is the logical representation of the error
  6504. // model, but it
  6505. // is not necessarily the actual wire format. When the `Status` message
  6506. // is
  6507. // exposed in different client libraries and different wire protocols,
  6508. // it can be
  6509. // mapped differently. For example, it will likely be mapped to some
  6510. // exceptions
  6511. // in Java, but more likely mapped to some error codes in C.
  6512. //
  6513. // # Other uses
  6514. //
  6515. // The error model and the `Status` message can be used in a variety
  6516. // of
  6517. // environments, either with or without APIs, to provide a
  6518. // consistent developer experience across different
  6519. // environments.
  6520. //
  6521. // Example uses of this error model include:
  6522. //
  6523. // - Partial errors. If a service needs to return partial errors to the
  6524. // client,
  6525. // it may embed the `Status` in the normal response to indicate the
  6526. // partial
  6527. // errors.
  6528. //
  6529. // - Workflow errors. A typical workflow has multiple steps. Each step
  6530. // may
  6531. // have a `Status` message for error reporting.
  6532. //
  6533. // - Batch operations. If a client uses batch request and batch
  6534. // response, the
  6535. // `Status` message should be used directly inside batch response,
  6536. // one for
  6537. // each error sub-response.
  6538. //
  6539. // - Asynchronous operations. If an API call embeds asynchronous
  6540. // operation
  6541. // results in its response, the status of those operations should
  6542. // be
  6543. // represented directly using the `Status` message.
  6544. //
  6545. // - Logging. If some API errors are stored in logs, the message
  6546. // `Status` could
  6547. // be used directly after any stripping needed for security/privacy
  6548. // reasons.
  6549. type GoogleRpcStatus struct {
  6550. // Code: The status code, which should be an enum value of
  6551. // google.rpc.Code.
  6552. Code int64 `json:"code,omitempty"`
  6553. // Details: A list of messages that carry the error details. There is a
  6554. // common set of
  6555. // message types for APIs to use.
  6556. Details []googleapi.RawMessage `json:"details,omitempty"`
  6557. // Message: A developer-facing error message, which should be in
  6558. // English. Any
  6559. // user-facing error message should be localized and sent in
  6560. // the
  6561. // google.rpc.Status.details field, or localized by the client.
  6562. Message string `json:"message,omitempty"`
  6563. // ForceSendFields is a list of field names (e.g. "Code") to
  6564. // unconditionally include in API requests. By default, fields with
  6565. // empty values are omitted from API requests. However, any non-pointer,
  6566. // non-interface field appearing in ForceSendFields will be sent to the
  6567. // server regardless of whether the field is empty or not. This may be
  6568. // used to include empty fields in Patch requests.
  6569. ForceSendFields []string `json:"-"`
  6570. // NullFields is a list of field names (e.g. "Code") to include in API
  6571. // requests with the JSON null value. By default, fields with empty
  6572. // values are omitted from API requests. However, any field with an
  6573. // empty value appearing in NullFields will be sent to the server as
  6574. // null. It is an error if a field in this list has a non-empty value.
  6575. // This may be used to include null fields in Patch requests.
  6576. NullFields []string `json:"-"`
  6577. }
  6578. func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) {
  6579. type NoMethod GoogleRpcStatus
  6580. raw := NoMethod(*s)
  6581. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6582. }
  6583. // GoogleTypeDate: Represents a whole or partial calendar date, e.g. a
  6584. // birthday. The time of day
  6585. // and time zone are either specified elsewhere or are not significant.
  6586. // The date
  6587. // is relative to the Proleptic Gregorian Calendar. This can
  6588. // represent:
  6589. //
  6590. // * A full date, with non-zero year, month and day values
  6591. // * A month and day value, with a zero year, e.g. an anniversary
  6592. // * A year on its own, with zero month and day values
  6593. // * A year and month value, with a zero day, e.g. a credit card
  6594. // expiration date
  6595. //
  6596. // Related types are google.type.TimeOfDay and
  6597. // `google.protobuf.Timestamp`.
  6598. type GoogleTypeDate struct {
  6599. // Day: Day of month. Must be from 1 to 31 and valid for the year and
  6600. // month, or 0
  6601. // if specifying a year by itself or a year and month where the day is
  6602. // not
  6603. // significant.
  6604. Day int64 `json:"day,omitempty"`
  6605. // Month: Month of year. Must be from 1 to 12, or 0 if specifying a year
  6606. // without a
  6607. // month and day.
  6608. Month int64 `json:"month,omitempty"`
  6609. // Year: Year of date. Must be from 1 to 9999, or 0 if specifying a date
  6610. // without
  6611. // a year.
  6612. Year int64 `json:"year,omitempty"`
  6613. // ForceSendFields is a list of field names (e.g. "Day") to
  6614. // unconditionally include in API requests. By default, fields with
  6615. // empty values are omitted from API requests. However, any non-pointer,
  6616. // non-interface field appearing in ForceSendFields will be sent to the
  6617. // server regardless of whether the field is empty or not. This may be
  6618. // used to include empty fields in Patch requests.
  6619. ForceSendFields []string `json:"-"`
  6620. // NullFields is a list of field names (e.g. "Day") to include in API
  6621. // requests with the JSON null value. By default, fields with empty
  6622. // values are omitted from API requests. However, any field with an
  6623. // empty value appearing in NullFields will be sent to the server as
  6624. // null. It is an error if a field in this list has a non-empty value.
  6625. // This may be used to include null fields in Patch requests.
  6626. NullFields []string `json:"-"`
  6627. }
  6628. func (s *GoogleTypeDate) MarshalJSON() ([]byte, error) {
  6629. type NoMethod GoogleTypeDate
  6630. raw := NoMethod(*s)
  6631. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6632. }
  6633. // GoogleTypeTimeOfDay: Represents a time of day. The date and time zone
  6634. // are either not significant
  6635. // or are specified elsewhere. An API may choose to allow leap seconds.
  6636. // Related
  6637. // types are google.type.Date and `google.protobuf.Timestamp`.
  6638. type GoogleTypeTimeOfDay struct {
  6639. // Hours: Hours of day in 24 hour format. Should be from 0 to 23. An API
  6640. // may choose
  6641. // to allow the value "24:00:00" for scenarios like business closing
  6642. // time.
  6643. Hours int64 `json:"hours,omitempty"`
  6644. // Minutes: Minutes of hour of day. Must be from 0 to 59.
  6645. Minutes int64 `json:"minutes,omitempty"`
  6646. // Nanos: Fractions of seconds in nanoseconds. Must be from 0 to
  6647. // 999,999,999.
  6648. Nanos int64 `json:"nanos,omitempty"`
  6649. // Seconds: Seconds of minutes of the time. Must normally be from 0 to
  6650. // 59. An API may
  6651. // allow the value 60 if it allows leap-seconds.
  6652. Seconds int64 `json:"seconds,omitempty"`
  6653. // ForceSendFields is a list of field names (e.g. "Hours") to
  6654. // unconditionally include in API requests. By default, fields with
  6655. // empty values are omitted from API requests. However, any non-pointer,
  6656. // non-interface field appearing in ForceSendFields will be sent to the
  6657. // server regardless of whether the field is empty or not. This may be
  6658. // used to include empty fields in Patch requests.
  6659. ForceSendFields []string `json:"-"`
  6660. // NullFields is a list of field names (e.g. "Hours") to include in API
  6661. // requests with the JSON null value. By default, fields with empty
  6662. // values are omitted from API requests. However, any field with an
  6663. // empty value appearing in NullFields will be sent to the server as
  6664. // null. It is an error if a field in this list has a non-empty value.
  6665. // This may be used to include null fields in Patch requests.
  6666. NullFields []string `json:"-"`
  6667. }
  6668. func (s *GoogleTypeTimeOfDay) MarshalJSON() ([]byte, error) {
  6669. type NoMethod GoogleTypeTimeOfDay
  6670. raw := NoMethod(*s)
  6671. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6672. }
  6673. // method id "dlp.infoTypes.list":
  6674. type InfoTypesListCall struct {
  6675. s *Service
  6676. urlParams_ gensupport.URLParams
  6677. ifNoneMatch_ string
  6678. ctx_ context.Context
  6679. header_ http.Header
  6680. }
  6681. // List: Returns a list of the sensitive information types that the DLP
  6682. // API
  6683. // supports. See https://cloud.google.com/dlp/docs/infotypes-reference
  6684. // to
  6685. // learn more.
  6686. func (r *InfoTypesService) List() *InfoTypesListCall {
  6687. c := &InfoTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6688. return c
  6689. }
  6690. // Filter sets the optional parameter "filter": Optional filter to only
  6691. // return infoTypes supported by certain parts of the
  6692. // API. Defaults to supported_by=INSPECT.
  6693. func (c *InfoTypesListCall) Filter(filter string) *InfoTypesListCall {
  6694. c.urlParams_.Set("filter", filter)
  6695. return c
  6696. }
  6697. // LanguageCode sets the optional parameter "languageCode": Optional
  6698. // BCP-47 language code for localized infoType friendly
  6699. // names. If omitted, or if localized strings are not available,
  6700. // en-US strings will be returned.
  6701. func (c *InfoTypesListCall) LanguageCode(languageCode string) *InfoTypesListCall {
  6702. c.urlParams_.Set("languageCode", languageCode)
  6703. return c
  6704. }
  6705. // Fields allows partial responses to be retrieved. See
  6706. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6707. // for more information.
  6708. func (c *InfoTypesListCall) Fields(s ...googleapi.Field) *InfoTypesListCall {
  6709. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6710. return c
  6711. }
  6712. // IfNoneMatch sets the optional parameter which makes the operation
  6713. // fail if the object's ETag matches the given value. This is useful for
  6714. // getting updates only after the object has changed since the last
  6715. // request. Use googleapi.IsNotModified to check whether the response
  6716. // error from Do is the result of In-None-Match.
  6717. func (c *InfoTypesListCall) IfNoneMatch(entityTag string) *InfoTypesListCall {
  6718. c.ifNoneMatch_ = entityTag
  6719. return c
  6720. }
  6721. // Context sets the context to be used in this call's Do method. Any
  6722. // pending HTTP request will be aborted if the provided context is
  6723. // canceled.
  6724. func (c *InfoTypesListCall) Context(ctx context.Context) *InfoTypesListCall {
  6725. c.ctx_ = ctx
  6726. return c
  6727. }
  6728. // Header returns an http.Header that can be modified by the caller to
  6729. // add HTTP headers to the request.
  6730. func (c *InfoTypesListCall) Header() http.Header {
  6731. if c.header_ == nil {
  6732. c.header_ = make(http.Header)
  6733. }
  6734. return c.header_
  6735. }
  6736. func (c *InfoTypesListCall) doRequest(alt string) (*http.Response, error) {
  6737. reqHeaders := make(http.Header)
  6738. for k, v := range c.header_ {
  6739. reqHeaders[k] = v
  6740. }
  6741. reqHeaders.Set("User-Agent", c.s.userAgent())
  6742. if c.ifNoneMatch_ != "" {
  6743. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6744. }
  6745. var body io.Reader = nil
  6746. c.urlParams_.Set("alt", alt)
  6747. c.urlParams_.Set("prettyPrint", "false")
  6748. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/infoTypes")
  6749. urls += "?" + c.urlParams_.Encode()
  6750. req, err := http.NewRequest("GET", urls, body)
  6751. if err != nil {
  6752. return nil, err
  6753. }
  6754. req.Header = reqHeaders
  6755. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6756. }
  6757. // Do executes the "dlp.infoTypes.list" call.
  6758. // Exactly one of *GooglePrivacyDlpV2ListInfoTypesResponse or error will
  6759. // be non-nil. Any non-2xx status code is an error. Response headers are
  6760. // in either
  6761. // *GooglePrivacyDlpV2ListInfoTypesResponse.ServerResponse.Header or (if
  6762. // a response was returned at all) in error.(*googleapi.Error).Header.
  6763. // Use googleapi.IsNotModified to check whether the returned error was
  6764. // because http.StatusNotModified was returned.
  6765. func (c *InfoTypesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListInfoTypesResponse, error) {
  6766. gensupport.SetOptions(c.urlParams_, opts...)
  6767. res, err := c.doRequest("json")
  6768. if res != nil && res.StatusCode == http.StatusNotModified {
  6769. if res.Body != nil {
  6770. res.Body.Close()
  6771. }
  6772. return nil, &googleapi.Error{
  6773. Code: res.StatusCode,
  6774. Header: res.Header,
  6775. }
  6776. }
  6777. if err != nil {
  6778. return nil, err
  6779. }
  6780. defer googleapi.CloseBody(res)
  6781. if err := googleapi.CheckResponse(res); err != nil {
  6782. return nil, err
  6783. }
  6784. ret := &GooglePrivacyDlpV2ListInfoTypesResponse{
  6785. ServerResponse: googleapi.ServerResponse{
  6786. Header: res.Header,
  6787. HTTPStatusCode: res.StatusCode,
  6788. },
  6789. }
  6790. target := &ret
  6791. if err := gensupport.DecodeResponse(target, res); err != nil {
  6792. return nil, err
  6793. }
  6794. return ret, nil
  6795. // {
  6796. // "description": "Returns a list of the sensitive information types that the DLP API\nsupports. See https://cloud.google.com/dlp/docs/infotypes-reference to\nlearn more.",
  6797. // "flatPath": "v2/infoTypes",
  6798. // "httpMethod": "GET",
  6799. // "id": "dlp.infoTypes.list",
  6800. // "parameterOrder": [],
  6801. // "parameters": {
  6802. // "filter": {
  6803. // "description": "Optional filter to only return infoTypes supported by certain parts of the\nAPI. Defaults to supported_by=INSPECT.",
  6804. // "location": "query",
  6805. // "type": "string"
  6806. // },
  6807. // "languageCode": {
  6808. // "description": "Optional BCP-47 language code for localized infoType friendly\nnames. If omitted, or if localized strings are not available,\nen-US strings will be returned.",
  6809. // "location": "query",
  6810. // "type": "string"
  6811. // }
  6812. // },
  6813. // "path": "v2/infoTypes",
  6814. // "response": {
  6815. // "$ref": "GooglePrivacyDlpV2ListInfoTypesResponse"
  6816. // },
  6817. // "scopes": [
  6818. // "https://www.googleapis.com/auth/cloud-platform"
  6819. // ]
  6820. // }
  6821. }
  6822. // method id "dlp.organizations.deidentifyTemplates.create":
  6823. type OrganizationsDeidentifyTemplatesCreateCall struct {
  6824. s *Service
  6825. parent string
  6826. googleprivacydlpv2createdeidentifytemplaterequest *GooglePrivacyDlpV2CreateDeidentifyTemplateRequest
  6827. urlParams_ gensupport.URLParams
  6828. ctx_ context.Context
  6829. header_ http.Header
  6830. }
  6831. // Create: Creates a DeidentifyTemplate for re-using frequently used
  6832. // configuration
  6833. // for de-identifying content, images, and storage.
  6834. // See https://cloud.google.com/dlp/docs/creating-templates-deid to
  6835. // learn
  6836. // more.
  6837. func (r *OrganizationsDeidentifyTemplatesService) Create(parent string, googleprivacydlpv2createdeidentifytemplaterequest *GooglePrivacyDlpV2CreateDeidentifyTemplateRequest) *OrganizationsDeidentifyTemplatesCreateCall {
  6838. c := &OrganizationsDeidentifyTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6839. c.parent = parent
  6840. c.googleprivacydlpv2createdeidentifytemplaterequest = googleprivacydlpv2createdeidentifytemplaterequest
  6841. return c
  6842. }
  6843. // Fields allows partial responses to be retrieved. See
  6844. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6845. // for more information.
  6846. func (c *OrganizationsDeidentifyTemplatesCreateCall) Fields(s ...googleapi.Field) *OrganizationsDeidentifyTemplatesCreateCall {
  6847. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6848. return c
  6849. }
  6850. // Context sets the context to be used in this call's Do method. Any
  6851. // pending HTTP request will be aborted if the provided context is
  6852. // canceled.
  6853. func (c *OrganizationsDeidentifyTemplatesCreateCall) Context(ctx context.Context) *OrganizationsDeidentifyTemplatesCreateCall {
  6854. c.ctx_ = ctx
  6855. return c
  6856. }
  6857. // Header returns an http.Header that can be modified by the caller to
  6858. // add HTTP headers to the request.
  6859. func (c *OrganizationsDeidentifyTemplatesCreateCall) Header() http.Header {
  6860. if c.header_ == nil {
  6861. c.header_ = make(http.Header)
  6862. }
  6863. return c.header_
  6864. }
  6865. func (c *OrganizationsDeidentifyTemplatesCreateCall) doRequest(alt string) (*http.Response, error) {
  6866. reqHeaders := make(http.Header)
  6867. for k, v := range c.header_ {
  6868. reqHeaders[k] = v
  6869. }
  6870. reqHeaders.Set("User-Agent", c.s.userAgent())
  6871. var body io.Reader = nil
  6872. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createdeidentifytemplaterequest)
  6873. if err != nil {
  6874. return nil, err
  6875. }
  6876. reqHeaders.Set("Content-Type", "application/json")
  6877. c.urlParams_.Set("alt", alt)
  6878. c.urlParams_.Set("prettyPrint", "false")
  6879. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/deidentifyTemplates")
  6880. urls += "?" + c.urlParams_.Encode()
  6881. req, err := http.NewRequest("POST", urls, body)
  6882. if err != nil {
  6883. return nil, err
  6884. }
  6885. req.Header = reqHeaders
  6886. googleapi.Expand(req.URL, map[string]string{
  6887. "parent": c.parent,
  6888. })
  6889. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6890. }
  6891. // Do executes the "dlp.organizations.deidentifyTemplates.create" call.
  6892. // Exactly one of *GooglePrivacyDlpV2DeidentifyTemplate or error will be
  6893. // non-nil. Any non-2xx status code is an error. Response headers are in
  6894. // either *GooglePrivacyDlpV2DeidentifyTemplate.ServerResponse.Header or
  6895. // (if a response was returned at all) in
  6896. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6897. // whether the returned error was because http.StatusNotModified was
  6898. // returned.
  6899. func (c *OrganizationsDeidentifyTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyTemplate, error) {
  6900. gensupport.SetOptions(c.urlParams_, opts...)
  6901. res, err := c.doRequest("json")
  6902. if res != nil && res.StatusCode == http.StatusNotModified {
  6903. if res.Body != nil {
  6904. res.Body.Close()
  6905. }
  6906. return nil, &googleapi.Error{
  6907. Code: res.StatusCode,
  6908. Header: res.Header,
  6909. }
  6910. }
  6911. if err != nil {
  6912. return nil, err
  6913. }
  6914. defer googleapi.CloseBody(res)
  6915. if err := googleapi.CheckResponse(res); err != nil {
  6916. return nil, err
  6917. }
  6918. ret := &GooglePrivacyDlpV2DeidentifyTemplate{
  6919. ServerResponse: googleapi.ServerResponse{
  6920. Header: res.Header,
  6921. HTTPStatusCode: res.StatusCode,
  6922. },
  6923. }
  6924. target := &ret
  6925. if err := gensupport.DecodeResponse(target, res); err != nil {
  6926. return nil, err
  6927. }
  6928. return ret, nil
  6929. // {
  6930. // "description": "Creates a DeidentifyTemplate for re-using frequently used configuration\nfor de-identifying content, images, and storage.\nSee https://cloud.google.com/dlp/docs/creating-templates-deid to learn\nmore.",
  6931. // "flatPath": "v2/organizations/{organizationsId}/deidentifyTemplates",
  6932. // "httpMethod": "POST",
  6933. // "id": "dlp.organizations.deidentifyTemplates.create",
  6934. // "parameterOrder": [
  6935. // "parent"
  6936. // ],
  6937. // "parameters": {
  6938. // "parent": {
  6939. // "description": "The parent resource name, for example projects/my-project-id or\norganizations/my-org-id.",
  6940. // "location": "path",
  6941. // "pattern": "^organizations/[^/]+$",
  6942. // "required": true,
  6943. // "type": "string"
  6944. // }
  6945. // },
  6946. // "path": "v2/{+parent}/deidentifyTemplates",
  6947. // "request": {
  6948. // "$ref": "GooglePrivacyDlpV2CreateDeidentifyTemplateRequest"
  6949. // },
  6950. // "response": {
  6951. // "$ref": "GooglePrivacyDlpV2DeidentifyTemplate"
  6952. // },
  6953. // "scopes": [
  6954. // "https://www.googleapis.com/auth/cloud-platform"
  6955. // ]
  6956. // }
  6957. }
  6958. // method id "dlp.organizations.deidentifyTemplates.delete":
  6959. type OrganizationsDeidentifyTemplatesDeleteCall struct {
  6960. s *Service
  6961. name string
  6962. urlParams_ gensupport.URLParams
  6963. ctx_ context.Context
  6964. header_ http.Header
  6965. }
  6966. // Delete: Deletes a DeidentifyTemplate.
  6967. // See https://cloud.google.com/dlp/docs/creating-templates-deid to
  6968. // learn
  6969. // more.
  6970. func (r *OrganizationsDeidentifyTemplatesService) Delete(name string) *OrganizationsDeidentifyTemplatesDeleteCall {
  6971. c := &OrganizationsDeidentifyTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6972. c.name = name
  6973. return c
  6974. }
  6975. // Fields allows partial responses to be retrieved. See
  6976. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6977. // for more information.
  6978. func (c *OrganizationsDeidentifyTemplatesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsDeidentifyTemplatesDeleteCall {
  6979. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6980. return c
  6981. }
  6982. // Context sets the context to be used in this call's Do method. Any
  6983. // pending HTTP request will be aborted if the provided context is
  6984. // canceled.
  6985. func (c *OrganizationsDeidentifyTemplatesDeleteCall) Context(ctx context.Context) *OrganizationsDeidentifyTemplatesDeleteCall {
  6986. c.ctx_ = ctx
  6987. return c
  6988. }
  6989. // Header returns an http.Header that can be modified by the caller to
  6990. // add HTTP headers to the request.
  6991. func (c *OrganizationsDeidentifyTemplatesDeleteCall) Header() http.Header {
  6992. if c.header_ == nil {
  6993. c.header_ = make(http.Header)
  6994. }
  6995. return c.header_
  6996. }
  6997. func (c *OrganizationsDeidentifyTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  6998. reqHeaders := make(http.Header)
  6999. for k, v := range c.header_ {
  7000. reqHeaders[k] = v
  7001. }
  7002. reqHeaders.Set("User-Agent", c.s.userAgent())
  7003. var body io.Reader = nil
  7004. c.urlParams_.Set("alt", alt)
  7005. c.urlParams_.Set("prettyPrint", "false")
  7006. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  7007. urls += "?" + c.urlParams_.Encode()
  7008. req, err := http.NewRequest("DELETE", urls, body)
  7009. if err != nil {
  7010. return nil, err
  7011. }
  7012. req.Header = reqHeaders
  7013. googleapi.Expand(req.URL, map[string]string{
  7014. "name": c.name,
  7015. })
  7016. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7017. }
  7018. // Do executes the "dlp.organizations.deidentifyTemplates.delete" call.
  7019. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  7020. // non-2xx status code is an error. Response headers are in either
  7021. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  7022. // returned at all) in error.(*googleapi.Error).Header. Use
  7023. // googleapi.IsNotModified to check whether the returned error was
  7024. // because http.StatusNotModified was returned.
  7025. func (c *OrganizationsDeidentifyTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  7026. gensupport.SetOptions(c.urlParams_, opts...)
  7027. res, err := c.doRequest("json")
  7028. if res != nil && res.StatusCode == http.StatusNotModified {
  7029. if res.Body != nil {
  7030. res.Body.Close()
  7031. }
  7032. return nil, &googleapi.Error{
  7033. Code: res.StatusCode,
  7034. Header: res.Header,
  7035. }
  7036. }
  7037. if err != nil {
  7038. return nil, err
  7039. }
  7040. defer googleapi.CloseBody(res)
  7041. if err := googleapi.CheckResponse(res); err != nil {
  7042. return nil, err
  7043. }
  7044. ret := &GoogleProtobufEmpty{
  7045. ServerResponse: googleapi.ServerResponse{
  7046. Header: res.Header,
  7047. HTTPStatusCode: res.StatusCode,
  7048. },
  7049. }
  7050. target := &ret
  7051. if err := gensupport.DecodeResponse(target, res); err != nil {
  7052. return nil, err
  7053. }
  7054. return ret, nil
  7055. // {
  7056. // "description": "Deletes a DeidentifyTemplate.\nSee https://cloud.google.com/dlp/docs/creating-templates-deid to learn\nmore.",
  7057. // "flatPath": "v2/organizations/{organizationsId}/deidentifyTemplates/{deidentifyTemplatesId}",
  7058. // "httpMethod": "DELETE",
  7059. // "id": "dlp.organizations.deidentifyTemplates.delete",
  7060. // "parameterOrder": [
  7061. // "name"
  7062. // ],
  7063. // "parameters": {
  7064. // "name": {
  7065. // "description": "Resource name of the organization and deidentify template to be deleted,\nfor example `organizations/433245324/deidentifyTemplates/432452342` or\nprojects/project-id/deidentifyTemplates/432452342.",
  7066. // "location": "path",
  7067. // "pattern": "^organizations/[^/]+/deidentifyTemplates/[^/]+$",
  7068. // "required": true,
  7069. // "type": "string"
  7070. // }
  7071. // },
  7072. // "path": "v2/{+name}",
  7073. // "response": {
  7074. // "$ref": "GoogleProtobufEmpty"
  7075. // },
  7076. // "scopes": [
  7077. // "https://www.googleapis.com/auth/cloud-platform"
  7078. // ]
  7079. // }
  7080. }
  7081. // method id "dlp.organizations.deidentifyTemplates.get":
  7082. type OrganizationsDeidentifyTemplatesGetCall struct {
  7083. s *Service
  7084. name string
  7085. urlParams_ gensupport.URLParams
  7086. ifNoneMatch_ string
  7087. ctx_ context.Context
  7088. header_ http.Header
  7089. }
  7090. // Get: Gets a DeidentifyTemplate.
  7091. // See https://cloud.google.com/dlp/docs/creating-templates-deid to
  7092. // learn
  7093. // more.
  7094. func (r *OrganizationsDeidentifyTemplatesService) Get(name string) *OrganizationsDeidentifyTemplatesGetCall {
  7095. c := &OrganizationsDeidentifyTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7096. c.name = name
  7097. return c
  7098. }
  7099. // Fields allows partial responses to be retrieved. See
  7100. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7101. // for more information.
  7102. func (c *OrganizationsDeidentifyTemplatesGetCall) Fields(s ...googleapi.Field) *OrganizationsDeidentifyTemplatesGetCall {
  7103. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7104. return c
  7105. }
  7106. // IfNoneMatch sets the optional parameter which makes the operation
  7107. // fail if the object's ETag matches the given value. This is useful for
  7108. // getting updates only after the object has changed since the last
  7109. // request. Use googleapi.IsNotModified to check whether the response
  7110. // error from Do is the result of In-None-Match.
  7111. func (c *OrganizationsDeidentifyTemplatesGetCall) IfNoneMatch(entityTag string) *OrganizationsDeidentifyTemplatesGetCall {
  7112. c.ifNoneMatch_ = entityTag
  7113. return c
  7114. }
  7115. // Context sets the context to be used in this call's Do method. Any
  7116. // pending HTTP request will be aborted if the provided context is
  7117. // canceled.
  7118. func (c *OrganizationsDeidentifyTemplatesGetCall) Context(ctx context.Context) *OrganizationsDeidentifyTemplatesGetCall {
  7119. c.ctx_ = ctx
  7120. return c
  7121. }
  7122. // Header returns an http.Header that can be modified by the caller to
  7123. // add HTTP headers to the request.
  7124. func (c *OrganizationsDeidentifyTemplatesGetCall) Header() http.Header {
  7125. if c.header_ == nil {
  7126. c.header_ = make(http.Header)
  7127. }
  7128. return c.header_
  7129. }
  7130. func (c *OrganizationsDeidentifyTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  7131. reqHeaders := make(http.Header)
  7132. for k, v := range c.header_ {
  7133. reqHeaders[k] = v
  7134. }
  7135. reqHeaders.Set("User-Agent", c.s.userAgent())
  7136. if c.ifNoneMatch_ != "" {
  7137. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7138. }
  7139. var body io.Reader = nil
  7140. c.urlParams_.Set("alt", alt)
  7141. c.urlParams_.Set("prettyPrint", "false")
  7142. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  7143. urls += "?" + c.urlParams_.Encode()
  7144. req, err := http.NewRequest("GET", urls, body)
  7145. if err != nil {
  7146. return nil, err
  7147. }
  7148. req.Header = reqHeaders
  7149. googleapi.Expand(req.URL, map[string]string{
  7150. "name": c.name,
  7151. })
  7152. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7153. }
  7154. // Do executes the "dlp.organizations.deidentifyTemplates.get" call.
  7155. // Exactly one of *GooglePrivacyDlpV2DeidentifyTemplate or error will be
  7156. // non-nil. Any non-2xx status code is an error. Response headers are in
  7157. // either *GooglePrivacyDlpV2DeidentifyTemplate.ServerResponse.Header or
  7158. // (if a response was returned at all) in
  7159. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7160. // whether the returned error was because http.StatusNotModified was
  7161. // returned.
  7162. func (c *OrganizationsDeidentifyTemplatesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyTemplate, error) {
  7163. gensupport.SetOptions(c.urlParams_, opts...)
  7164. res, err := c.doRequest("json")
  7165. if res != nil && res.StatusCode == http.StatusNotModified {
  7166. if res.Body != nil {
  7167. res.Body.Close()
  7168. }
  7169. return nil, &googleapi.Error{
  7170. Code: res.StatusCode,
  7171. Header: res.Header,
  7172. }
  7173. }
  7174. if err != nil {
  7175. return nil, err
  7176. }
  7177. defer googleapi.CloseBody(res)
  7178. if err := googleapi.CheckResponse(res); err != nil {
  7179. return nil, err
  7180. }
  7181. ret := &GooglePrivacyDlpV2DeidentifyTemplate{
  7182. ServerResponse: googleapi.ServerResponse{
  7183. Header: res.Header,
  7184. HTTPStatusCode: res.StatusCode,
  7185. },
  7186. }
  7187. target := &ret
  7188. if err := gensupport.DecodeResponse(target, res); err != nil {
  7189. return nil, err
  7190. }
  7191. return ret, nil
  7192. // {
  7193. // "description": "Gets a DeidentifyTemplate.\nSee https://cloud.google.com/dlp/docs/creating-templates-deid to learn\nmore.",
  7194. // "flatPath": "v2/organizations/{organizationsId}/deidentifyTemplates/{deidentifyTemplatesId}",
  7195. // "httpMethod": "GET",
  7196. // "id": "dlp.organizations.deidentifyTemplates.get",
  7197. // "parameterOrder": [
  7198. // "name"
  7199. // ],
  7200. // "parameters": {
  7201. // "name": {
  7202. // "description": "Resource name of the organization and deidentify template to be read, for\nexample `organizations/433245324/deidentifyTemplates/432452342` or\nprojects/project-id/deidentifyTemplates/432452342.",
  7203. // "location": "path",
  7204. // "pattern": "^organizations/[^/]+/deidentifyTemplates/[^/]+$",
  7205. // "required": true,
  7206. // "type": "string"
  7207. // }
  7208. // },
  7209. // "path": "v2/{+name}",
  7210. // "response": {
  7211. // "$ref": "GooglePrivacyDlpV2DeidentifyTemplate"
  7212. // },
  7213. // "scopes": [
  7214. // "https://www.googleapis.com/auth/cloud-platform"
  7215. // ]
  7216. // }
  7217. }
  7218. // method id "dlp.organizations.deidentifyTemplates.list":
  7219. type OrganizationsDeidentifyTemplatesListCall struct {
  7220. s *Service
  7221. parent string
  7222. urlParams_ gensupport.URLParams
  7223. ifNoneMatch_ string
  7224. ctx_ context.Context
  7225. header_ http.Header
  7226. }
  7227. // List: Lists DeidentifyTemplates.
  7228. // See https://cloud.google.com/dlp/docs/creating-templates-deid to
  7229. // learn
  7230. // more.
  7231. func (r *OrganizationsDeidentifyTemplatesService) List(parent string) *OrganizationsDeidentifyTemplatesListCall {
  7232. c := &OrganizationsDeidentifyTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7233. c.parent = parent
  7234. return c
  7235. }
  7236. // OrderBy sets the optional parameter "orderBy": Optional comma
  7237. // separated list of fields to order by,
  7238. // followed by `asc` or `desc` postfix. This list is
  7239. // case-insensitive,
  7240. // default sorting order is ascending, redundant space characters
  7241. // are
  7242. // insignificant.
  7243. //
  7244. // Example: `name asc,update_time, create_time desc`
  7245. //
  7246. // Supported fields are:
  7247. //
  7248. // - `create_time`: corresponds to time the template was created.
  7249. // - `update_time`: corresponds to time the template was last updated.
  7250. // - `name`: corresponds to template's name.
  7251. // - `display_name`: corresponds to template's display name.
  7252. func (c *OrganizationsDeidentifyTemplatesListCall) OrderBy(orderBy string) *OrganizationsDeidentifyTemplatesListCall {
  7253. c.urlParams_.Set("orderBy", orderBy)
  7254. return c
  7255. }
  7256. // PageSize sets the optional parameter "pageSize": Optional size of the
  7257. // page, can be limited by server. If zero server returns
  7258. // a page of max size 100.
  7259. func (c *OrganizationsDeidentifyTemplatesListCall) PageSize(pageSize int64) *OrganizationsDeidentifyTemplatesListCall {
  7260. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7261. return c
  7262. }
  7263. // PageToken sets the optional parameter "pageToken": Optional page
  7264. // token to continue retrieval. Comes from previous call
  7265. // to `ListDeidentifyTemplates`.
  7266. func (c *OrganizationsDeidentifyTemplatesListCall) PageToken(pageToken string) *OrganizationsDeidentifyTemplatesListCall {
  7267. c.urlParams_.Set("pageToken", pageToken)
  7268. return c
  7269. }
  7270. // Fields allows partial responses to be retrieved. See
  7271. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7272. // for more information.
  7273. func (c *OrganizationsDeidentifyTemplatesListCall) Fields(s ...googleapi.Field) *OrganizationsDeidentifyTemplatesListCall {
  7274. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7275. return c
  7276. }
  7277. // IfNoneMatch sets the optional parameter which makes the operation
  7278. // fail if the object's ETag matches the given value. This is useful for
  7279. // getting updates only after the object has changed since the last
  7280. // request. Use googleapi.IsNotModified to check whether the response
  7281. // error from Do is the result of In-None-Match.
  7282. func (c *OrganizationsDeidentifyTemplatesListCall) IfNoneMatch(entityTag string) *OrganizationsDeidentifyTemplatesListCall {
  7283. c.ifNoneMatch_ = entityTag
  7284. return c
  7285. }
  7286. // Context sets the context to be used in this call's Do method. Any
  7287. // pending HTTP request will be aborted if the provided context is
  7288. // canceled.
  7289. func (c *OrganizationsDeidentifyTemplatesListCall) Context(ctx context.Context) *OrganizationsDeidentifyTemplatesListCall {
  7290. c.ctx_ = ctx
  7291. return c
  7292. }
  7293. // Header returns an http.Header that can be modified by the caller to
  7294. // add HTTP headers to the request.
  7295. func (c *OrganizationsDeidentifyTemplatesListCall) Header() http.Header {
  7296. if c.header_ == nil {
  7297. c.header_ = make(http.Header)
  7298. }
  7299. return c.header_
  7300. }
  7301. func (c *OrganizationsDeidentifyTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  7302. reqHeaders := make(http.Header)
  7303. for k, v := range c.header_ {
  7304. reqHeaders[k] = v
  7305. }
  7306. reqHeaders.Set("User-Agent", c.s.userAgent())
  7307. if c.ifNoneMatch_ != "" {
  7308. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7309. }
  7310. var body io.Reader = nil
  7311. c.urlParams_.Set("alt", alt)
  7312. c.urlParams_.Set("prettyPrint", "false")
  7313. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/deidentifyTemplates")
  7314. urls += "?" + c.urlParams_.Encode()
  7315. req, err := http.NewRequest("GET", urls, body)
  7316. if err != nil {
  7317. return nil, err
  7318. }
  7319. req.Header = reqHeaders
  7320. googleapi.Expand(req.URL, map[string]string{
  7321. "parent": c.parent,
  7322. })
  7323. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7324. }
  7325. // Do executes the "dlp.organizations.deidentifyTemplates.list" call.
  7326. // Exactly one of *GooglePrivacyDlpV2ListDeidentifyTemplatesResponse or
  7327. // error will be non-nil. Any non-2xx status code is an error. Response
  7328. // headers are in either
  7329. // *GooglePrivacyDlpV2ListDeidentifyTemplatesResponse.ServerResponse.Head
  7330. // er or (if a response was returned at all) in
  7331. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7332. // whether the returned error was because http.StatusNotModified was
  7333. // returned.
  7334. func (c *OrganizationsDeidentifyTemplatesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListDeidentifyTemplatesResponse, error) {
  7335. gensupport.SetOptions(c.urlParams_, opts...)
  7336. res, err := c.doRequest("json")
  7337. if res != nil && res.StatusCode == http.StatusNotModified {
  7338. if res.Body != nil {
  7339. res.Body.Close()
  7340. }
  7341. return nil, &googleapi.Error{
  7342. Code: res.StatusCode,
  7343. Header: res.Header,
  7344. }
  7345. }
  7346. if err != nil {
  7347. return nil, err
  7348. }
  7349. defer googleapi.CloseBody(res)
  7350. if err := googleapi.CheckResponse(res); err != nil {
  7351. return nil, err
  7352. }
  7353. ret := &GooglePrivacyDlpV2ListDeidentifyTemplatesResponse{
  7354. ServerResponse: googleapi.ServerResponse{
  7355. Header: res.Header,
  7356. HTTPStatusCode: res.StatusCode,
  7357. },
  7358. }
  7359. target := &ret
  7360. if err := gensupport.DecodeResponse(target, res); err != nil {
  7361. return nil, err
  7362. }
  7363. return ret, nil
  7364. // {
  7365. // "description": "Lists DeidentifyTemplates.\nSee https://cloud.google.com/dlp/docs/creating-templates-deid to learn\nmore.",
  7366. // "flatPath": "v2/organizations/{organizationsId}/deidentifyTemplates",
  7367. // "httpMethod": "GET",
  7368. // "id": "dlp.organizations.deidentifyTemplates.list",
  7369. // "parameterOrder": [
  7370. // "parent"
  7371. // ],
  7372. // "parameters": {
  7373. // "orderBy": {
  7374. // "description": "Optional comma separated list of fields to order by,\nfollowed by `asc` or `desc` postfix. This list is case-insensitive,\ndefault sorting order is ascending, redundant space characters are\ninsignificant.\n\nExample: `name asc,update_time, create_time desc`\n\nSupported fields are:\n\n- `create_time`: corresponds to time the template was created.\n- `update_time`: corresponds to time the template was last updated.\n- `name`: corresponds to template's name.\n- `display_name`: corresponds to template's display name.",
  7375. // "location": "query",
  7376. // "type": "string"
  7377. // },
  7378. // "pageSize": {
  7379. // "description": "Optional size of the page, can be limited by server. If zero server returns\na page of max size 100.",
  7380. // "format": "int32",
  7381. // "location": "query",
  7382. // "type": "integer"
  7383. // },
  7384. // "pageToken": {
  7385. // "description": "Optional page token to continue retrieval. Comes from previous call\nto `ListDeidentifyTemplates`.",
  7386. // "location": "query",
  7387. // "type": "string"
  7388. // },
  7389. // "parent": {
  7390. // "description": "The parent resource name, for example projects/my-project-id or\norganizations/my-org-id.",
  7391. // "location": "path",
  7392. // "pattern": "^organizations/[^/]+$",
  7393. // "required": true,
  7394. // "type": "string"
  7395. // }
  7396. // },
  7397. // "path": "v2/{+parent}/deidentifyTemplates",
  7398. // "response": {
  7399. // "$ref": "GooglePrivacyDlpV2ListDeidentifyTemplatesResponse"
  7400. // },
  7401. // "scopes": [
  7402. // "https://www.googleapis.com/auth/cloud-platform"
  7403. // ]
  7404. // }
  7405. }
  7406. // Pages invokes f for each page of results.
  7407. // A non-nil error returned from f will halt the iteration.
  7408. // The provided context supersedes any context provided to the Context method.
  7409. func (c *OrganizationsDeidentifyTemplatesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListDeidentifyTemplatesResponse) error) error {
  7410. c.ctx_ = ctx
  7411. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7412. for {
  7413. x, err := c.Do()
  7414. if err != nil {
  7415. return err
  7416. }
  7417. if err := f(x); err != nil {
  7418. return err
  7419. }
  7420. if x.NextPageToken == "" {
  7421. return nil
  7422. }
  7423. c.PageToken(x.NextPageToken)
  7424. }
  7425. }
  7426. // method id "dlp.organizations.deidentifyTemplates.patch":
  7427. type OrganizationsDeidentifyTemplatesPatchCall struct {
  7428. s *Service
  7429. name string
  7430. googleprivacydlpv2updatedeidentifytemplaterequest *GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest
  7431. urlParams_ gensupport.URLParams
  7432. ctx_ context.Context
  7433. header_ http.Header
  7434. }
  7435. // Patch: Updates the DeidentifyTemplate.
  7436. // See https://cloud.google.com/dlp/docs/creating-templates-deid to
  7437. // learn
  7438. // more.
  7439. func (r *OrganizationsDeidentifyTemplatesService) Patch(name string, googleprivacydlpv2updatedeidentifytemplaterequest *GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest) *OrganizationsDeidentifyTemplatesPatchCall {
  7440. c := &OrganizationsDeidentifyTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7441. c.name = name
  7442. c.googleprivacydlpv2updatedeidentifytemplaterequest = googleprivacydlpv2updatedeidentifytemplaterequest
  7443. return c
  7444. }
  7445. // Fields allows partial responses to be retrieved. See
  7446. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7447. // for more information.
  7448. func (c *OrganizationsDeidentifyTemplatesPatchCall) Fields(s ...googleapi.Field) *OrganizationsDeidentifyTemplatesPatchCall {
  7449. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7450. return c
  7451. }
  7452. // Context sets the context to be used in this call's Do method. Any
  7453. // pending HTTP request will be aborted if the provided context is
  7454. // canceled.
  7455. func (c *OrganizationsDeidentifyTemplatesPatchCall) Context(ctx context.Context) *OrganizationsDeidentifyTemplatesPatchCall {
  7456. c.ctx_ = ctx
  7457. return c
  7458. }
  7459. // Header returns an http.Header that can be modified by the caller to
  7460. // add HTTP headers to the request.
  7461. func (c *OrganizationsDeidentifyTemplatesPatchCall) Header() http.Header {
  7462. if c.header_ == nil {
  7463. c.header_ = make(http.Header)
  7464. }
  7465. return c.header_
  7466. }
  7467. func (c *OrganizationsDeidentifyTemplatesPatchCall) doRequest(alt string) (*http.Response, error) {
  7468. reqHeaders := make(http.Header)
  7469. for k, v := range c.header_ {
  7470. reqHeaders[k] = v
  7471. }
  7472. reqHeaders.Set("User-Agent", c.s.userAgent())
  7473. var body io.Reader = nil
  7474. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatedeidentifytemplaterequest)
  7475. if err != nil {
  7476. return nil, err
  7477. }
  7478. reqHeaders.Set("Content-Type", "application/json")
  7479. c.urlParams_.Set("alt", alt)
  7480. c.urlParams_.Set("prettyPrint", "false")
  7481. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  7482. urls += "?" + c.urlParams_.Encode()
  7483. req, err := http.NewRequest("PATCH", urls, body)
  7484. if err != nil {
  7485. return nil, err
  7486. }
  7487. req.Header = reqHeaders
  7488. googleapi.Expand(req.URL, map[string]string{
  7489. "name": c.name,
  7490. })
  7491. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7492. }
  7493. // Do executes the "dlp.organizations.deidentifyTemplates.patch" call.
  7494. // Exactly one of *GooglePrivacyDlpV2DeidentifyTemplate or error will be
  7495. // non-nil. Any non-2xx status code is an error. Response headers are in
  7496. // either *GooglePrivacyDlpV2DeidentifyTemplate.ServerResponse.Header or
  7497. // (if a response was returned at all) in
  7498. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7499. // whether the returned error was because http.StatusNotModified was
  7500. // returned.
  7501. func (c *OrganizationsDeidentifyTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyTemplate, error) {
  7502. gensupport.SetOptions(c.urlParams_, opts...)
  7503. res, err := c.doRequest("json")
  7504. if res != nil && res.StatusCode == http.StatusNotModified {
  7505. if res.Body != nil {
  7506. res.Body.Close()
  7507. }
  7508. return nil, &googleapi.Error{
  7509. Code: res.StatusCode,
  7510. Header: res.Header,
  7511. }
  7512. }
  7513. if err != nil {
  7514. return nil, err
  7515. }
  7516. defer googleapi.CloseBody(res)
  7517. if err := googleapi.CheckResponse(res); err != nil {
  7518. return nil, err
  7519. }
  7520. ret := &GooglePrivacyDlpV2DeidentifyTemplate{
  7521. ServerResponse: googleapi.ServerResponse{
  7522. Header: res.Header,
  7523. HTTPStatusCode: res.StatusCode,
  7524. },
  7525. }
  7526. target := &ret
  7527. if err := gensupport.DecodeResponse(target, res); err != nil {
  7528. return nil, err
  7529. }
  7530. return ret, nil
  7531. // {
  7532. // "description": "Updates the DeidentifyTemplate.\nSee https://cloud.google.com/dlp/docs/creating-templates-deid to learn\nmore.",
  7533. // "flatPath": "v2/organizations/{organizationsId}/deidentifyTemplates/{deidentifyTemplatesId}",
  7534. // "httpMethod": "PATCH",
  7535. // "id": "dlp.organizations.deidentifyTemplates.patch",
  7536. // "parameterOrder": [
  7537. // "name"
  7538. // ],
  7539. // "parameters": {
  7540. // "name": {
  7541. // "description": "Resource name of organization and deidentify template to be updated, for\nexample `organizations/433245324/deidentifyTemplates/432452342` or\nprojects/project-id/deidentifyTemplates/432452342.",
  7542. // "location": "path",
  7543. // "pattern": "^organizations/[^/]+/deidentifyTemplates/[^/]+$",
  7544. // "required": true,
  7545. // "type": "string"
  7546. // }
  7547. // },
  7548. // "path": "v2/{+name}",
  7549. // "request": {
  7550. // "$ref": "GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest"
  7551. // },
  7552. // "response": {
  7553. // "$ref": "GooglePrivacyDlpV2DeidentifyTemplate"
  7554. // },
  7555. // "scopes": [
  7556. // "https://www.googleapis.com/auth/cloud-platform"
  7557. // ]
  7558. // }
  7559. }
  7560. // method id "dlp.organizations.inspectTemplates.create":
  7561. type OrganizationsInspectTemplatesCreateCall struct {
  7562. s *Service
  7563. parent string
  7564. googleprivacydlpv2createinspecttemplaterequest *GooglePrivacyDlpV2CreateInspectTemplateRequest
  7565. urlParams_ gensupport.URLParams
  7566. ctx_ context.Context
  7567. header_ http.Header
  7568. }
  7569. // Create: Creates an InspectTemplate for re-using frequently used
  7570. // configuration
  7571. // for inspecting content, images, and storage.
  7572. // See https://cloud.google.com/dlp/docs/creating-templates to learn
  7573. // more.
  7574. func (r *OrganizationsInspectTemplatesService) Create(parent string, googleprivacydlpv2createinspecttemplaterequest *GooglePrivacyDlpV2CreateInspectTemplateRequest) *OrganizationsInspectTemplatesCreateCall {
  7575. c := &OrganizationsInspectTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7576. c.parent = parent
  7577. c.googleprivacydlpv2createinspecttemplaterequest = googleprivacydlpv2createinspecttemplaterequest
  7578. return c
  7579. }
  7580. // Fields allows partial responses to be retrieved. See
  7581. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7582. // for more information.
  7583. func (c *OrganizationsInspectTemplatesCreateCall) Fields(s ...googleapi.Field) *OrganizationsInspectTemplatesCreateCall {
  7584. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7585. return c
  7586. }
  7587. // Context sets the context to be used in this call's Do method. Any
  7588. // pending HTTP request will be aborted if the provided context is
  7589. // canceled.
  7590. func (c *OrganizationsInspectTemplatesCreateCall) Context(ctx context.Context) *OrganizationsInspectTemplatesCreateCall {
  7591. c.ctx_ = ctx
  7592. return c
  7593. }
  7594. // Header returns an http.Header that can be modified by the caller to
  7595. // add HTTP headers to the request.
  7596. func (c *OrganizationsInspectTemplatesCreateCall) Header() http.Header {
  7597. if c.header_ == nil {
  7598. c.header_ = make(http.Header)
  7599. }
  7600. return c.header_
  7601. }
  7602. func (c *OrganizationsInspectTemplatesCreateCall) doRequest(alt string) (*http.Response, error) {
  7603. reqHeaders := make(http.Header)
  7604. for k, v := range c.header_ {
  7605. reqHeaders[k] = v
  7606. }
  7607. reqHeaders.Set("User-Agent", c.s.userAgent())
  7608. var body io.Reader = nil
  7609. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createinspecttemplaterequest)
  7610. if err != nil {
  7611. return nil, err
  7612. }
  7613. reqHeaders.Set("Content-Type", "application/json")
  7614. c.urlParams_.Set("alt", alt)
  7615. c.urlParams_.Set("prettyPrint", "false")
  7616. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/inspectTemplates")
  7617. urls += "?" + c.urlParams_.Encode()
  7618. req, err := http.NewRequest("POST", urls, body)
  7619. if err != nil {
  7620. return nil, err
  7621. }
  7622. req.Header = reqHeaders
  7623. googleapi.Expand(req.URL, map[string]string{
  7624. "parent": c.parent,
  7625. })
  7626. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7627. }
  7628. // Do executes the "dlp.organizations.inspectTemplates.create" call.
  7629. // Exactly one of *GooglePrivacyDlpV2InspectTemplate or error will be
  7630. // non-nil. Any non-2xx status code is an error. Response headers are in
  7631. // either *GooglePrivacyDlpV2InspectTemplate.ServerResponse.Header or
  7632. // (if a response was returned at all) in
  7633. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7634. // whether the returned error was because http.StatusNotModified was
  7635. // returned.
  7636. func (c *OrganizationsInspectTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectTemplate, error) {
  7637. gensupport.SetOptions(c.urlParams_, opts...)
  7638. res, err := c.doRequest("json")
  7639. if res != nil && res.StatusCode == http.StatusNotModified {
  7640. if res.Body != nil {
  7641. res.Body.Close()
  7642. }
  7643. return nil, &googleapi.Error{
  7644. Code: res.StatusCode,
  7645. Header: res.Header,
  7646. }
  7647. }
  7648. if err != nil {
  7649. return nil, err
  7650. }
  7651. defer googleapi.CloseBody(res)
  7652. if err := googleapi.CheckResponse(res); err != nil {
  7653. return nil, err
  7654. }
  7655. ret := &GooglePrivacyDlpV2InspectTemplate{
  7656. ServerResponse: googleapi.ServerResponse{
  7657. Header: res.Header,
  7658. HTTPStatusCode: res.StatusCode,
  7659. },
  7660. }
  7661. target := &ret
  7662. if err := gensupport.DecodeResponse(target, res); err != nil {
  7663. return nil, err
  7664. }
  7665. return ret, nil
  7666. // {
  7667. // "description": "Creates an InspectTemplate for re-using frequently used configuration\nfor inspecting content, images, and storage.\nSee https://cloud.google.com/dlp/docs/creating-templates to learn more.",
  7668. // "flatPath": "v2/organizations/{organizationsId}/inspectTemplates",
  7669. // "httpMethod": "POST",
  7670. // "id": "dlp.organizations.inspectTemplates.create",
  7671. // "parameterOrder": [
  7672. // "parent"
  7673. // ],
  7674. // "parameters": {
  7675. // "parent": {
  7676. // "description": "The parent resource name, for example projects/my-project-id or\norganizations/my-org-id.",
  7677. // "location": "path",
  7678. // "pattern": "^organizations/[^/]+$",
  7679. // "required": true,
  7680. // "type": "string"
  7681. // }
  7682. // },
  7683. // "path": "v2/{+parent}/inspectTemplates",
  7684. // "request": {
  7685. // "$ref": "GooglePrivacyDlpV2CreateInspectTemplateRequest"
  7686. // },
  7687. // "response": {
  7688. // "$ref": "GooglePrivacyDlpV2InspectTemplate"
  7689. // },
  7690. // "scopes": [
  7691. // "https://www.googleapis.com/auth/cloud-platform"
  7692. // ]
  7693. // }
  7694. }
  7695. // method id "dlp.organizations.inspectTemplates.delete":
  7696. type OrganizationsInspectTemplatesDeleteCall struct {
  7697. s *Service
  7698. name string
  7699. urlParams_ gensupport.URLParams
  7700. ctx_ context.Context
  7701. header_ http.Header
  7702. }
  7703. // Delete: Deletes an InspectTemplate.
  7704. // See https://cloud.google.com/dlp/docs/creating-templates to learn
  7705. // more.
  7706. func (r *OrganizationsInspectTemplatesService) Delete(name string) *OrganizationsInspectTemplatesDeleteCall {
  7707. c := &OrganizationsInspectTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7708. c.name = name
  7709. return c
  7710. }
  7711. // Fields allows partial responses to be retrieved. See
  7712. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7713. // for more information.
  7714. func (c *OrganizationsInspectTemplatesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsInspectTemplatesDeleteCall {
  7715. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7716. return c
  7717. }
  7718. // Context sets the context to be used in this call's Do method. Any
  7719. // pending HTTP request will be aborted if the provided context is
  7720. // canceled.
  7721. func (c *OrganizationsInspectTemplatesDeleteCall) Context(ctx context.Context) *OrganizationsInspectTemplatesDeleteCall {
  7722. c.ctx_ = ctx
  7723. return c
  7724. }
  7725. // Header returns an http.Header that can be modified by the caller to
  7726. // add HTTP headers to the request.
  7727. func (c *OrganizationsInspectTemplatesDeleteCall) Header() http.Header {
  7728. if c.header_ == nil {
  7729. c.header_ = make(http.Header)
  7730. }
  7731. return c.header_
  7732. }
  7733. func (c *OrganizationsInspectTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  7734. reqHeaders := make(http.Header)
  7735. for k, v := range c.header_ {
  7736. reqHeaders[k] = v
  7737. }
  7738. reqHeaders.Set("User-Agent", c.s.userAgent())
  7739. var body io.Reader = nil
  7740. c.urlParams_.Set("alt", alt)
  7741. c.urlParams_.Set("prettyPrint", "false")
  7742. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  7743. urls += "?" + c.urlParams_.Encode()
  7744. req, err := http.NewRequest("DELETE", urls, body)
  7745. if err != nil {
  7746. return nil, err
  7747. }
  7748. req.Header = reqHeaders
  7749. googleapi.Expand(req.URL, map[string]string{
  7750. "name": c.name,
  7751. })
  7752. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7753. }
  7754. // Do executes the "dlp.organizations.inspectTemplates.delete" call.
  7755. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  7756. // non-2xx status code is an error. Response headers are in either
  7757. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  7758. // returned at all) in error.(*googleapi.Error).Header. Use
  7759. // googleapi.IsNotModified to check whether the returned error was
  7760. // because http.StatusNotModified was returned.
  7761. func (c *OrganizationsInspectTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  7762. gensupport.SetOptions(c.urlParams_, opts...)
  7763. res, err := c.doRequest("json")
  7764. if res != nil && res.StatusCode == http.StatusNotModified {
  7765. if res.Body != nil {
  7766. res.Body.Close()
  7767. }
  7768. return nil, &googleapi.Error{
  7769. Code: res.StatusCode,
  7770. Header: res.Header,
  7771. }
  7772. }
  7773. if err != nil {
  7774. return nil, err
  7775. }
  7776. defer googleapi.CloseBody(res)
  7777. if err := googleapi.CheckResponse(res); err != nil {
  7778. return nil, err
  7779. }
  7780. ret := &GoogleProtobufEmpty{
  7781. ServerResponse: googleapi.ServerResponse{
  7782. Header: res.Header,
  7783. HTTPStatusCode: res.StatusCode,
  7784. },
  7785. }
  7786. target := &ret
  7787. if err := gensupport.DecodeResponse(target, res); err != nil {
  7788. return nil, err
  7789. }
  7790. return ret, nil
  7791. // {
  7792. // "description": "Deletes an InspectTemplate.\nSee https://cloud.google.com/dlp/docs/creating-templates to learn more.",
  7793. // "flatPath": "v2/organizations/{organizationsId}/inspectTemplates/{inspectTemplatesId}",
  7794. // "httpMethod": "DELETE",
  7795. // "id": "dlp.organizations.inspectTemplates.delete",
  7796. // "parameterOrder": [
  7797. // "name"
  7798. // ],
  7799. // "parameters": {
  7800. // "name": {
  7801. // "description": "Resource name of the organization and inspectTemplate to be deleted, for\nexample `organizations/433245324/inspectTemplates/432452342` or\nprojects/project-id/inspectTemplates/432452342.",
  7802. // "location": "path",
  7803. // "pattern": "^organizations/[^/]+/inspectTemplates/[^/]+$",
  7804. // "required": true,
  7805. // "type": "string"
  7806. // }
  7807. // },
  7808. // "path": "v2/{+name}",
  7809. // "response": {
  7810. // "$ref": "GoogleProtobufEmpty"
  7811. // },
  7812. // "scopes": [
  7813. // "https://www.googleapis.com/auth/cloud-platform"
  7814. // ]
  7815. // }
  7816. }
  7817. // method id "dlp.organizations.inspectTemplates.get":
  7818. type OrganizationsInspectTemplatesGetCall struct {
  7819. s *Service
  7820. name string
  7821. urlParams_ gensupport.URLParams
  7822. ifNoneMatch_ string
  7823. ctx_ context.Context
  7824. header_ http.Header
  7825. }
  7826. // Get: Gets an InspectTemplate.
  7827. // See https://cloud.google.com/dlp/docs/creating-templates to learn
  7828. // more.
  7829. func (r *OrganizationsInspectTemplatesService) Get(name string) *OrganizationsInspectTemplatesGetCall {
  7830. c := &OrganizationsInspectTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7831. c.name = name
  7832. return c
  7833. }
  7834. // Fields allows partial responses to be retrieved. See
  7835. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7836. // for more information.
  7837. func (c *OrganizationsInspectTemplatesGetCall) Fields(s ...googleapi.Field) *OrganizationsInspectTemplatesGetCall {
  7838. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7839. return c
  7840. }
  7841. // IfNoneMatch sets the optional parameter which makes the operation
  7842. // fail if the object's ETag matches the given value. This is useful for
  7843. // getting updates only after the object has changed since the last
  7844. // request. Use googleapi.IsNotModified to check whether the response
  7845. // error from Do is the result of In-None-Match.
  7846. func (c *OrganizationsInspectTemplatesGetCall) IfNoneMatch(entityTag string) *OrganizationsInspectTemplatesGetCall {
  7847. c.ifNoneMatch_ = entityTag
  7848. return c
  7849. }
  7850. // Context sets the context to be used in this call's Do method. Any
  7851. // pending HTTP request will be aborted if the provided context is
  7852. // canceled.
  7853. func (c *OrganizationsInspectTemplatesGetCall) Context(ctx context.Context) *OrganizationsInspectTemplatesGetCall {
  7854. c.ctx_ = ctx
  7855. return c
  7856. }
  7857. // Header returns an http.Header that can be modified by the caller to
  7858. // add HTTP headers to the request.
  7859. func (c *OrganizationsInspectTemplatesGetCall) Header() http.Header {
  7860. if c.header_ == nil {
  7861. c.header_ = make(http.Header)
  7862. }
  7863. return c.header_
  7864. }
  7865. func (c *OrganizationsInspectTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  7866. reqHeaders := make(http.Header)
  7867. for k, v := range c.header_ {
  7868. reqHeaders[k] = v
  7869. }
  7870. reqHeaders.Set("User-Agent", c.s.userAgent())
  7871. if c.ifNoneMatch_ != "" {
  7872. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7873. }
  7874. var body io.Reader = nil
  7875. c.urlParams_.Set("alt", alt)
  7876. c.urlParams_.Set("prettyPrint", "false")
  7877. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  7878. urls += "?" + c.urlParams_.Encode()
  7879. req, err := http.NewRequest("GET", urls, body)
  7880. if err != nil {
  7881. return nil, err
  7882. }
  7883. req.Header = reqHeaders
  7884. googleapi.Expand(req.URL, map[string]string{
  7885. "name": c.name,
  7886. })
  7887. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7888. }
  7889. // Do executes the "dlp.organizations.inspectTemplates.get" call.
  7890. // Exactly one of *GooglePrivacyDlpV2InspectTemplate or error will be
  7891. // non-nil. Any non-2xx status code is an error. Response headers are in
  7892. // either *GooglePrivacyDlpV2InspectTemplate.ServerResponse.Header or
  7893. // (if a response was returned at all) in
  7894. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7895. // whether the returned error was because http.StatusNotModified was
  7896. // returned.
  7897. func (c *OrganizationsInspectTemplatesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectTemplate, error) {
  7898. gensupport.SetOptions(c.urlParams_, opts...)
  7899. res, err := c.doRequest("json")
  7900. if res != nil && res.StatusCode == http.StatusNotModified {
  7901. if res.Body != nil {
  7902. res.Body.Close()
  7903. }
  7904. return nil, &googleapi.Error{
  7905. Code: res.StatusCode,
  7906. Header: res.Header,
  7907. }
  7908. }
  7909. if err != nil {
  7910. return nil, err
  7911. }
  7912. defer googleapi.CloseBody(res)
  7913. if err := googleapi.CheckResponse(res); err != nil {
  7914. return nil, err
  7915. }
  7916. ret := &GooglePrivacyDlpV2InspectTemplate{
  7917. ServerResponse: googleapi.ServerResponse{
  7918. Header: res.Header,
  7919. HTTPStatusCode: res.StatusCode,
  7920. },
  7921. }
  7922. target := &ret
  7923. if err := gensupport.DecodeResponse(target, res); err != nil {
  7924. return nil, err
  7925. }
  7926. return ret, nil
  7927. // {
  7928. // "description": "Gets an InspectTemplate.\nSee https://cloud.google.com/dlp/docs/creating-templates to learn more.",
  7929. // "flatPath": "v2/organizations/{organizationsId}/inspectTemplates/{inspectTemplatesId}",
  7930. // "httpMethod": "GET",
  7931. // "id": "dlp.organizations.inspectTemplates.get",
  7932. // "parameterOrder": [
  7933. // "name"
  7934. // ],
  7935. // "parameters": {
  7936. // "name": {
  7937. // "description": "Resource name of the organization and inspectTemplate to be read, for\nexample `organizations/433245324/inspectTemplates/432452342` or\nprojects/project-id/inspectTemplates/432452342.",
  7938. // "location": "path",
  7939. // "pattern": "^organizations/[^/]+/inspectTemplates/[^/]+$",
  7940. // "required": true,
  7941. // "type": "string"
  7942. // }
  7943. // },
  7944. // "path": "v2/{+name}",
  7945. // "response": {
  7946. // "$ref": "GooglePrivacyDlpV2InspectTemplate"
  7947. // },
  7948. // "scopes": [
  7949. // "https://www.googleapis.com/auth/cloud-platform"
  7950. // ]
  7951. // }
  7952. }
  7953. // method id "dlp.organizations.inspectTemplates.list":
  7954. type OrganizationsInspectTemplatesListCall struct {
  7955. s *Service
  7956. parent string
  7957. urlParams_ gensupport.URLParams
  7958. ifNoneMatch_ string
  7959. ctx_ context.Context
  7960. header_ http.Header
  7961. }
  7962. // List: Lists InspectTemplates.
  7963. // See https://cloud.google.com/dlp/docs/creating-templates to learn
  7964. // more.
  7965. func (r *OrganizationsInspectTemplatesService) List(parent string) *OrganizationsInspectTemplatesListCall {
  7966. c := &OrganizationsInspectTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7967. c.parent = parent
  7968. return c
  7969. }
  7970. // OrderBy sets the optional parameter "orderBy": Optional comma
  7971. // separated list of fields to order by,
  7972. // followed by `asc` or `desc` postfix. This list is
  7973. // case-insensitive,
  7974. // default sorting order is ascending, redundant space characters
  7975. // are
  7976. // insignificant.
  7977. //
  7978. // Example: `name asc,update_time, create_time desc`
  7979. //
  7980. // Supported fields are:
  7981. //
  7982. // - `create_time`: corresponds to time the template was created.
  7983. // - `update_time`: corresponds to time the template was last updated.
  7984. // - `name`: corresponds to template's name.
  7985. // - `display_name`: corresponds to template's display name.
  7986. func (c *OrganizationsInspectTemplatesListCall) OrderBy(orderBy string) *OrganizationsInspectTemplatesListCall {
  7987. c.urlParams_.Set("orderBy", orderBy)
  7988. return c
  7989. }
  7990. // PageSize sets the optional parameter "pageSize": Optional size of the
  7991. // page, can be limited by server. If zero server returns
  7992. // a page of max size 100.
  7993. func (c *OrganizationsInspectTemplatesListCall) PageSize(pageSize int64) *OrganizationsInspectTemplatesListCall {
  7994. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7995. return c
  7996. }
  7997. // PageToken sets the optional parameter "pageToken": Optional page
  7998. // token to continue retrieval. Comes from previous call
  7999. // to `ListInspectTemplates`.
  8000. func (c *OrganizationsInspectTemplatesListCall) PageToken(pageToken string) *OrganizationsInspectTemplatesListCall {
  8001. c.urlParams_.Set("pageToken", pageToken)
  8002. return c
  8003. }
  8004. // Fields allows partial responses to be retrieved. See
  8005. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8006. // for more information.
  8007. func (c *OrganizationsInspectTemplatesListCall) Fields(s ...googleapi.Field) *OrganizationsInspectTemplatesListCall {
  8008. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8009. return c
  8010. }
  8011. // IfNoneMatch sets the optional parameter which makes the operation
  8012. // fail if the object's ETag matches the given value. This is useful for
  8013. // getting updates only after the object has changed since the last
  8014. // request. Use googleapi.IsNotModified to check whether the response
  8015. // error from Do is the result of In-None-Match.
  8016. func (c *OrganizationsInspectTemplatesListCall) IfNoneMatch(entityTag string) *OrganizationsInspectTemplatesListCall {
  8017. c.ifNoneMatch_ = entityTag
  8018. return c
  8019. }
  8020. // Context sets the context to be used in this call's Do method. Any
  8021. // pending HTTP request will be aborted if the provided context is
  8022. // canceled.
  8023. func (c *OrganizationsInspectTemplatesListCall) Context(ctx context.Context) *OrganizationsInspectTemplatesListCall {
  8024. c.ctx_ = ctx
  8025. return c
  8026. }
  8027. // Header returns an http.Header that can be modified by the caller to
  8028. // add HTTP headers to the request.
  8029. func (c *OrganizationsInspectTemplatesListCall) Header() http.Header {
  8030. if c.header_ == nil {
  8031. c.header_ = make(http.Header)
  8032. }
  8033. return c.header_
  8034. }
  8035. func (c *OrganizationsInspectTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  8036. reqHeaders := make(http.Header)
  8037. for k, v := range c.header_ {
  8038. reqHeaders[k] = v
  8039. }
  8040. reqHeaders.Set("User-Agent", c.s.userAgent())
  8041. if c.ifNoneMatch_ != "" {
  8042. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8043. }
  8044. var body io.Reader = nil
  8045. c.urlParams_.Set("alt", alt)
  8046. c.urlParams_.Set("prettyPrint", "false")
  8047. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/inspectTemplates")
  8048. urls += "?" + c.urlParams_.Encode()
  8049. req, err := http.NewRequest("GET", urls, body)
  8050. if err != nil {
  8051. return nil, err
  8052. }
  8053. req.Header = reqHeaders
  8054. googleapi.Expand(req.URL, map[string]string{
  8055. "parent": c.parent,
  8056. })
  8057. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8058. }
  8059. // Do executes the "dlp.organizations.inspectTemplates.list" call.
  8060. // Exactly one of *GooglePrivacyDlpV2ListInspectTemplatesResponse or
  8061. // error will be non-nil. Any non-2xx status code is an error. Response
  8062. // headers are in either
  8063. // *GooglePrivacyDlpV2ListInspectTemplatesResponse.ServerResponse.Header
  8064. // or (if a response was returned at all) in
  8065. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8066. // whether the returned error was because http.StatusNotModified was
  8067. // returned.
  8068. func (c *OrganizationsInspectTemplatesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListInspectTemplatesResponse, error) {
  8069. gensupport.SetOptions(c.urlParams_, opts...)
  8070. res, err := c.doRequest("json")
  8071. if res != nil && res.StatusCode == http.StatusNotModified {
  8072. if res.Body != nil {
  8073. res.Body.Close()
  8074. }
  8075. return nil, &googleapi.Error{
  8076. Code: res.StatusCode,
  8077. Header: res.Header,
  8078. }
  8079. }
  8080. if err != nil {
  8081. return nil, err
  8082. }
  8083. defer googleapi.CloseBody(res)
  8084. if err := googleapi.CheckResponse(res); err != nil {
  8085. return nil, err
  8086. }
  8087. ret := &GooglePrivacyDlpV2ListInspectTemplatesResponse{
  8088. ServerResponse: googleapi.ServerResponse{
  8089. Header: res.Header,
  8090. HTTPStatusCode: res.StatusCode,
  8091. },
  8092. }
  8093. target := &ret
  8094. if err := gensupport.DecodeResponse(target, res); err != nil {
  8095. return nil, err
  8096. }
  8097. return ret, nil
  8098. // {
  8099. // "description": "Lists InspectTemplates.\nSee https://cloud.google.com/dlp/docs/creating-templates to learn more.",
  8100. // "flatPath": "v2/organizations/{organizationsId}/inspectTemplates",
  8101. // "httpMethod": "GET",
  8102. // "id": "dlp.organizations.inspectTemplates.list",
  8103. // "parameterOrder": [
  8104. // "parent"
  8105. // ],
  8106. // "parameters": {
  8107. // "orderBy": {
  8108. // "description": "Optional comma separated list of fields to order by,\nfollowed by `asc` or `desc` postfix. This list is case-insensitive,\ndefault sorting order is ascending, redundant space characters are\ninsignificant.\n\nExample: `name asc,update_time, create_time desc`\n\nSupported fields are:\n\n- `create_time`: corresponds to time the template was created.\n- `update_time`: corresponds to time the template was last updated.\n- `name`: corresponds to template's name.\n- `display_name`: corresponds to template's display name.",
  8109. // "location": "query",
  8110. // "type": "string"
  8111. // },
  8112. // "pageSize": {
  8113. // "description": "Optional size of the page, can be limited by server. If zero server returns\na page of max size 100.",
  8114. // "format": "int32",
  8115. // "location": "query",
  8116. // "type": "integer"
  8117. // },
  8118. // "pageToken": {
  8119. // "description": "Optional page token to continue retrieval. Comes from previous call\nto `ListInspectTemplates`.",
  8120. // "location": "query",
  8121. // "type": "string"
  8122. // },
  8123. // "parent": {
  8124. // "description": "The parent resource name, for example projects/my-project-id or\norganizations/my-org-id.",
  8125. // "location": "path",
  8126. // "pattern": "^organizations/[^/]+$",
  8127. // "required": true,
  8128. // "type": "string"
  8129. // }
  8130. // },
  8131. // "path": "v2/{+parent}/inspectTemplates",
  8132. // "response": {
  8133. // "$ref": "GooglePrivacyDlpV2ListInspectTemplatesResponse"
  8134. // },
  8135. // "scopes": [
  8136. // "https://www.googleapis.com/auth/cloud-platform"
  8137. // ]
  8138. // }
  8139. }
  8140. // Pages invokes f for each page of results.
  8141. // A non-nil error returned from f will halt the iteration.
  8142. // The provided context supersedes any context provided to the Context method.
  8143. func (c *OrganizationsInspectTemplatesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListInspectTemplatesResponse) error) error {
  8144. c.ctx_ = ctx
  8145. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8146. for {
  8147. x, err := c.Do()
  8148. if err != nil {
  8149. return err
  8150. }
  8151. if err := f(x); err != nil {
  8152. return err
  8153. }
  8154. if x.NextPageToken == "" {
  8155. return nil
  8156. }
  8157. c.PageToken(x.NextPageToken)
  8158. }
  8159. }
  8160. // method id "dlp.organizations.inspectTemplates.patch":
  8161. type OrganizationsInspectTemplatesPatchCall struct {
  8162. s *Service
  8163. name string
  8164. googleprivacydlpv2updateinspecttemplaterequest *GooglePrivacyDlpV2UpdateInspectTemplateRequest
  8165. urlParams_ gensupport.URLParams
  8166. ctx_ context.Context
  8167. header_ http.Header
  8168. }
  8169. // Patch: Updates the InspectTemplate.
  8170. // See https://cloud.google.com/dlp/docs/creating-templates to learn
  8171. // more.
  8172. func (r *OrganizationsInspectTemplatesService) Patch(name string, googleprivacydlpv2updateinspecttemplaterequest *GooglePrivacyDlpV2UpdateInspectTemplateRequest) *OrganizationsInspectTemplatesPatchCall {
  8173. c := &OrganizationsInspectTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8174. c.name = name
  8175. c.googleprivacydlpv2updateinspecttemplaterequest = googleprivacydlpv2updateinspecttemplaterequest
  8176. return c
  8177. }
  8178. // Fields allows partial responses to be retrieved. See
  8179. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8180. // for more information.
  8181. func (c *OrganizationsInspectTemplatesPatchCall) Fields(s ...googleapi.Field) *OrganizationsInspectTemplatesPatchCall {
  8182. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8183. return c
  8184. }
  8185. // Context sets the context to be used in this call's Do method. Any
  8186. // pending HTTP request will be aborted if the provided context is
  8187. // canceled.
  8188. func (c *OrganizationsInspectTemplatesPatchCall) Context(ctx context.Context) *OrganizationsInspectTemplatesPatchCall {
  8189. c.ctx_ = ctx
  8190. return c
  8191. }
  8192. // Header returns an http.Header that can be modified by the caller to
  8193. // add HTTP headers to the request.
  8194. func (c *OrganizationsInspectTemplatesPatchCall) Header() http.Header {
  8195. if c.header_ == nil {
  8196. c.header_ = make(http.Header)
  8197. }
  8198. return c.header_
  8199. }
  8200. func (c *OrganizationsInspectTemplatesPatchCall) doRequest(alt string) (*http.Response, error) {
  8201. reqHeaders := make(http.Header)
  8202. for k, v := range c.header_ {
  8203. reqHeaders[k] = v
  8204. }
  8205. reqHeaders.Set("User-Agent", c.s.userAgent())
  8206. var body io.Reader = nil
  8207. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updateinspecttemplaterequest)
  8208. if err != nil {
  8209. return nil, err
  8210. }
  8211. reqHeaders.Set("Content-Type", "application/json")
  8212. c.urlParams_.Set("alt", alt)
  8213. c.urlParams_.Set("prettyPrint", "false")
  8214. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  8215. urls += "?" + c.urlParams_.Encode()
  8216. req, err := http.NewRequest("PATCH", urls, body)
  8217. if err != nil {
  8218. return nil, err
  8219. }
  8220. req.Header = reqHeaders
  8221. googleapi.Expand(req.URL, map[string]string{
  8222. "name": c.name,
  8223. })
  8224. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8225. }
  8226. // Do executes the "dlp.organizations.inspectTemplates.patch" call.
  8227. // Exactly one of *GooglePrivacyDlpV2InspectTemplate or error will be
  8228. // non-nil. Any non-2xx status code is an error. Response headers are in
  8229. // either *GooglePrivacyDlpV2InspectTemplate.ServerResponse.Header or
  8230. // (if a response was returned at all) in
  8231. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8232. // whether the returned error was because http.StatusNotModified was
  8233. // returned.
  8234. func (c *OrganizationsInspectTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectTemplate, error) {
  8235. gensupport.SetOptions(c.urlParams_, opts...)
  8236. res, err := c.doRequest("json")
  8237. if res != nil && res.StatusCode == http.StatusNotModified {
  8238. if res.Body != nil {
  8239. res.Body.Close()
  8240. }
  8241. return nil, &googleapi.Error{
  8242. Code: res.StatusCode,
  8243. Header: res.Header,
  8244. }
  8245. }
  8246. if err != nil {
  8247. return nil, err
  8248. }
  8249. defer googleapi.CloseBody(res)
  8250. if err := googleapi.CheckResponse(res); err != nil {
  8251. return nil, err
  8252. }
  8253. ret := &GooglePrivacyDlpV2InspectTemplate{
  8254. ServerResponse: googleapi.ServerResponse{
  8255. Header: res.Header,
  8256. HTTPStatusCode: res.StatusCode,
  8257. },
  8258. }
  8259. target := &ret
  8260. if err := gensupport.DecodeResponse(target, res); err != nil {
  8261. return nil, err
  8262. }
  8263. return ret, nil
  8264. // {
  8265. // "description": "Updates the InspectTemplate.\nSee https://cloud.google.com/dlp/docs/creating-templates to learn more.",
  8266. // "flatPath": "v2/organizations/{organizationsId}/inspectTemplates/{inspectTemplatesId}",
  8267. // "httpMethod": "PATCH",
  8268. // "id": "dlp.organizations.inspectTemplates.patch",
  8269. // "parameterOrder": [
  8270. // "name"
  8271. // ],
  8272. // "parameters": {
  8273. // "name": {
  8274. // "description": "Resource name of organization and inspectTemplate to be updated, for\nexample `organizations/433245324/inspectTemplates/432452342` or\nprojects/project-id/inspectTemplates/432452342.",
  8275. // "location": "path",
  8276. // "pattern": "^organizations/[^/]+/inspectTemplates/[^/]+$",
  8277. // "required": true,
  8278. // "type": "string"
  8279. // }
  8280. // },
  8281. // "path": "v2/{+name}",
  8282. // "request": {
  8283. // "$ref": "GooglePrivacyDlpV2UpdateInspectTemplateRequest"
  8284. // },
  8285. // "response": {
  8286. // "$ref": "GooglePrivacyDlpV2InspectTemplate"
  8287. // },
  8288. // "scopes": [
  8289. // "https://www.googleapis.com/auth/cloud-platform"
  8290. // ]
  8291. // }
  8292. }
  8293. // method id "dlp.organizations.storedInfoTypes.create":
  8294. type OrganizationsStoredInfoTypesCreateCall struct {
  8295. s *Service
  8296. parent string
  8297. googleprivacydlpv2createstoredinfotyperequest *GooglePrivacyDlpV2CreateStoredInfoTypeRequest
  8298. urlParams_ gensupport.URLParams
  8299. ctx_ context.Context
  8300. header_ http.Header
  8301. }
  8302. // Create: Creates a pre-built stored infoType to be used for
  8303. // inspection.
  8304. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes
  8305. // to
  8306. // learn more.
  8307. func (r *OrganizationsStoredInfoTypesService) Create(parent string, googleprivacydlpv2createstoredinfotyperequest *GooglePrivacyDlpV2CreateStoredInfoTypeRequest) *OrganizationsStoredInfoTypesCreateCall {
  8308. c := &OrganizationsStoredInfoTypesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8309. c.parent = parent
  8310. c.googleprivacydlpv2createstoredinfotyperequest = googleprivacydlpv2createstoredinfotyperequest
  8311. return c
  8312. }
  8313. // Fields allows partial responses to be retrieved. See
  8314. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8315. // for more information.
  8316. func (c *OrganizationsStoredInfoTypesCreateCall) Fields(s ...googleapi.Field) *OrganizationsStoredInfoTypesCreateCall {
  8317. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8318. return c
  8319. }
  8320. // Context sets the context to be used in this call's Do method. Any
  8321. // pending HTTP request will be aborted if the provided context is
  8322. // canceled.
  8323. func (c *OrganizationsStoredInfoTypesCreateCall) Context(ctx context.Context) *OrganizationsStoredInfoTypesCreateCall {
  8324. c.ctx_ = ctx
  8325. return c
  8326. }
  8327. // Header returns an http.Header that can be modified by the caller to
  8328. // add HTTP headers to the request.
  8329. func (c *OrganizationsStoredInfoTypesCreateCall) Header() http.Header {
  8330. if c.header_ == nil {
  8331. c.header_ = make(http.Header)
  8332. }
  8333. return c.header_
  8334. }
  8335. func (c *OrganizationsStoredInfoTypesCreateCall) doRequest(alt string) (*http.Response, error) {
  8336. reqHeaders := make(http.Header)
  8337. for k, v := range c.header_ {
  8338. reqHeaders[k] = v
  8339. }
  8340. reqHeaders.Set("User-Agent", c.s.userAgent())
  8341. var body io.Reader = nil
  8342. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createstoredinfotyperequest)
  8343. if err != nil {
  8344. return nil, err
  8345. }
  8346. reqHeaders.Set("Content-Type", "application/json")
  8347. c.urlParams_.Set("alt", alt)
  8348. c.urlParams_.Set("prettyPrint", "false")
  8349. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/storedInfoTypes")
  8350. urls += "?" + c.urlParams_.Encode()
  8351. req, err := http.NewRequest("POST", urls, body)
  8352. if err != nil {
  8353. return nil, err
  8354. }
  8355. req.Header = reqHeaders
  8356. googleapi.Expand(req.URL, map[string]string{
  8357. "parent": c.parent,
  8358. })
  8359. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8360. }
  8361. // Do executes the "dlp.organizations.storedInfoTypes.create" call.
  8362. // Exactly one of *GooglePrivacyDlpV2StoredInfoType or error will be
  8363. // non-nil. Any non-2xx status code is an error. Response headers are in
  8364. // either *GooglePrivacyDlpV2StoredInfoType.ServerResponse.Header or (if
  8365. // a response was returned at all) in error.(*googleapi.Error).Header.
  8366. // Use googleapi.IsNotModified to check whether the returned error was
  8367. // because http.StatusNotModified was returned.
  8368. func (c *OrganizationsStoredInfoTypesCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2StoredInfoType, error) {
  8369. gensupport.SetOptions(c.urlParams_, opts...)
  8370. res, err := c.doRequest("json")
  8371. if res != nil && res.StatusCode == http.StatusNotModified {
  8372. if res.Body != nil {
  8373. res.Body.Close()
  8374. }
  8375. return nil, &googleapi.Error{
  8376. Code: res.StatusCode,
  8377. Header: res.Header,
  8378. }
  8379. }
  8380. if err != nil {
  8381. return nil, err
  8382. }
  8383. defer googleapi.CloseBody(res)
  8384. if err := googleapi.CheckResponse(res); err != nil {
  8385. return nil, err
  8386. }
  8387. ret := &GooglePrivacyDlpV2StoredInfoType{
  8388. ServerResponse: googleapi.ServerResponse{
  8389. Header: res.Header,
  8390. HTTPStatusCode: res.StatusCode,
  8391. },
  8392. }
  8393. target := &ret
  8394. if err := gensupport.DecodeResponse(target, res); err != nil {
  8395. return nil, err
  8396. }
  8397. return ret, nil
  8398. // {
  8399. // "description": "Creates a pre-built stored infoType to be used for inspection.\nSee https://cloud.google.com/dlp/docs/creating-stored-infotypes to\nlearn more.",
  8400. // "flatPath": "v2/organizations/{organizationsId}/storedInfoTypes",
  8401. // "httpMethod": "POST",
  8402. // "id": "dlp.organizations.storedInfoTypes.create",
  8403. // "parameterOrder": [
  8404. // "parent"
  8405. // ],
  8406. // "parameters": {
  8407. // "parent": {
  8408. // "description": "The parent resource name, for example projects/my-project-id or\norganizations/my-org-id.",
  8409. // "location": "path",
  8410. // "pattern": "^organizations/[^/]+$",
  8411. // "required": true,
  8412. // "type": "string"
  8413. // }
  8414. // },
  8415. // "path": "v2/{+parent}/storedInfoTypes",
  8416. // "request": {
  8417. // "$ref": "GooglePrivacyDlpV2CreateStoredInfoTypeRequest"
  8418. // },
  8419. // "response": {
  8420. // "$ref": "GooglePrivacyDlpV2StoredInfoType"
  8421. // },
  8422. // "scopes": [
  8423. // "https://www.googleapis.com/auth/cloud-platform"
  8424. // ]
  8425. // }
  8426. }
  8427. // method id "dlp.organizations.storedInfoTypes.delete":
  8428. type OrganizationsStoredInfoTypesDeleteCall struct {
  8429. s *Service
  8430. name string
  8431. urlParams_ gensupport.URLParams
  8432. ctx_ context.Context
  8433. header_ http.Header
  8434. }
  8435. // Delete: Deletes a stored infoType.
  8436. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes
  8437. // to
  8438. // learn more.
  8439. func (r *OrganizationsStoredInfoTypesService) Delete(name string) *OrganizationsStoredInfoTypesDeleteCall {
  8440. c := &OrganizationsStoredInfoTypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8441. c.name = name
  8442. return c
  8443. }
  8444. // Fields allows partial responses to be retrieved. See
  8445. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8446. // for more information.
  8447. func (c *OrganizationsStoredInfoTypesDeleteCall) Fields(s ...googleapi.Field) *OrganizationsStoredInfoTypesDeleteCall {
  8448. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8449. return c
  8450. }
  8451. // Context sets the context to be used in this call's Do method. Any
  8452. // pending HTTP request will be aborted if the provided context is
  8453. // canceled.
  8454. func (c *OrganizationsStoredInfoTypesDeleteCall) Context(ctx context.Context) *OrganizationsStoredInfoTypesDeleteCall {
  8455. c.ctx_ = ctx
  8456. return c
  8457. }
  8458. // Header returns an http.Header that can be modified by the caller to
  8459. // add HTTP headers to the request.
  8460. func (c *OrganizationsStoredInfoTypesDeleteCall) Header() http.Header {
  8461. if c.header_ == nil {
  8462. c.header_ = make(http.Header)
  8463. }
  8464. return c.header_
  8465. }
  8466. func (c *OrganizationsStoredInfoTypesDeleteCall) doRequest(alt string) (*http.Response, error) {
  8467. reqHeaders := make(http.Header)
  8468. for k, v := range c.header_ {
  8469. reqHeaders[k] = v
  8470. }
  8471. reqHeaders.Set("User-Agent", c.s.userAgent())
  8472. var body io.Reader = nil
  8473. c.urlParams_.Set("alt", alt)
  8474. c.urlParams_.Set("prettyPrint", "false")
  8475. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  8476. urls += "?" + c.urlParams_.Encode()
  8477. req, err := http.NewRequest("DELETE", urls, body)
  8478. if err != nil {
  8479. return nil, err
  8480. }
  8481. req.Header = reqHeaders
  8482. googleapi.Expand(req.URL, map[string]string{
  8483. "name": c.name,
  8484. })
  8485. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8486. }
  8487. // Do executes the "dlp.organizations.storedInfoTypes.delete" call.
  8488. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  8489. // non-2xx status code is an error. Response headers are in either
  8490. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  8491. // returned at all) in error.(*googleapi.Error).Header. Use
  8492. // googleapi.IsNotModified to check whether the returned error was
  8493. // because http.StatusNotModified was returned.
  8494. func (c *OrganizationsStoredInfoTypesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  8495. gensupport.SetOptions(c.urlParams_, opts...)
  8496. res, err := c.doRequest("json")
  8497. if res != nil && res.StatusCode == http.StatusNotModified {
  8498. if res.Body != nil {
  8499. res.Body.Close()
  8500. }
  8501. return nil, &googleapi.Error{
  8502. Code: res.StatusCode,
  8503. Header: res.Header,
  8504. }
  8505. }
  8506. if err != nil {
  8507. return nil, err
  8508. }
  8509. defer googleapi.CloseBody(res)
  8510. if err := googleapi.CheckResponse(res); err != nil {
  8511. return nil, err
  8512. }
  8513. ret := &GoogleProtobufEmpty{
  8514. ServerResponse: googleapi.ServerResponse{
  8515. Header: res.Header,
  8516. HTTPStatusCode: res.StatusCode,
  8517. },
  8518. }
  8519. target := &ret
  8520. if err := gensupport.DecodeResponse(target, res); err != nil {
  8521. return nil, err
  8522. }
  8523. return ret, nil
  8524. // {
  8525. // "description": "Deletes a stored infoType.\nSee https://cloud.google.com/dlp/docs/creating-stored-infotypes to\nlearn more.",
  8526. // "flatPath": "v2/organizations/{organizationsId}/storedInfoTypes/{storedInfoTypesId}",
  8527. // "httpMethod": "DELETE",
  8528. // "id": "dlp.organizations.storedInfoTypes.delete",
  8529. // "parameterOrder": [
  8530. // "name"
  8531. // ],
  8532. // "parameters": {
  8533. // "name": {
  8534. // "description": "Resource name of the organization and storedInfoType to be deleted, for\nexample `organizations/433245324/storedInfoTypes/432452342` or\nprojects/project-id/storedInfoTypes/432452342.",
  8535. // "location": "path",
  8536. // "pattern": "^organizations/[^/]+/storedInfoTypes/[^/]+$",
  8537. // "required": true,
  8538. // "type": "string"
  8539. // }
  8540. // },
  8541. // "path": "v2/{+name}",
  8542. // "response": {
  8543. // "$ref": "GoogleProtobufEmpty"
  8544. // },
  8545. // "scopes": [
  8546. // "https://www.googleapis.com/auth/cloud-platform"
  8547. // ]
  8548. // }
  8549. }
  8550. // method id "dlp.organizations.storedInfoTypes.get":
  8551. type OrganizationsStoredInfoTypesGetCall struct {
  8552. s *Service
  8553. name string
  8554. urlParams_ gensupport.URLParams
  8555. ifNoneMatch_ string
  8556. ctx_ context.Context
  8557. header_ http.Header
  8558. }
  8559. // Get: Gets a stored infoType.
  8560. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes
  8561. // to
  8562. // learn more.
  8563. func (r *OrganizationsStoredInfoTypesService) Get(name string) *OrganizationsStoredInfoTypesGetCall {
  8564. c := &OrganizationsStoredInfoTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8565. c.name = name
  8566. return c
  8567. }
  8568. // Fields allows partial responses to be retrieved. See
  8569. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8570. // for more information.
  8571. func (c *OrganizationsStoredInfoTypesGetCall) Fields(s ...googleapi.Field) *OrganizationsStoredInfoTypesGetCall {
  8572. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8573. return c
  8574. }
  8575. // IfNoneMatch sets the optional parameter which makes the operation
  8576. // fail if the object's ETag matches the given value. This is useful for
  8577. // getting updates only after the object has changed since the last
  8578. // request. Use googleapi.IsNotModified to check whether the response
  8579. // error from Do is the result of In-None-Match.
  8580. func (c *OrganizationsStoredInfoTypesGetCall) IfNoneMatch(entityTag string) *OrganizationsStoredInfoTypesGetCall {
  8581. c.ifNoneMatch_ = entityTag
  8582. return c
  8583. }
  8584. // Context sets the context to be used in this call's Do method. Any
  8585. // pending HTTP request will be aborted if the provided context is
  8586. // canceled.
  8587. func (c *OrganizationsStoredInfoTypesGetCall) Context(ctx context.Context) *OrganizationsStoredInfoTypesGetCall {
  8588. c.ctx_ = ctx
  8589. return c
  8590. }
  8591. // Header returns an http.Header that can be modified by the caller to
  8592. // add HTTP headers to the request.
  8593. func (c *OrganizationsStoredInfoTypesGetCall) Header() http.Header {
  8594. if c.header_ == nil {
  8595. c.header_ = make(http.Header)
  8596. }
  8597. return c.header_
  8598. }
  8599. func (c *OrganizationsStoredInfoTypesGetCall) doRequest(alt string) (*http.Response, error) {
  8600. reqHeaders := make(http.Header)
  8601. for k, v := range c.header_ {
  8602. reqHeaders[k] = v
  8603. }
  8604. reqHeaders.Set("User-Agent", c.s.userAgent())
  8605. if c.ifNoneMatch_ != "" {
  8606. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8607. }
  8608. var body io.Reader = nil
  8609. c.urlParams_.Set("alt", alt)
  8610. c.urlParams_.Set("prettyPrint", "false")
  8611. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  8612. urls += "?" + c.urlParams_.Encode()
  8613. req, err := http.NewRequest("GET", urls, body)
  8614. if err != nil {
  8615. return nil, err
  8616. }
  8617. req.Header = reqHeaders
  8618. googleapi.Expand(req.URL, map[string]string{
  8619. "name": c.name,
  8620. })
  8621. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8622. }
  8623. // Do executes the "dlp.organizations.storedInfoTypes.get" call.
  8624. // Exactly one of *GooglePrivacyDlpV2StoredInfoType or error will be
  8625. // non-nil. Any non-2xx status code is an error. Response headers are in
  8626. // either *GooglePrivacyDlpV2StoredInfoType.ServerResponse.Header or (if
  8627. // a response was returned at all) in error.(*googleapi.Error).Header.
  8628. // Use googleapi.IsNotModified to check whether the returned error was
  8629. // because http.StatusNotModified was returned.
  8630. func (c *OrganizationsStoredInfoTypesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2StoredInfoType, error) {
  8631. gensupport.SetOptions(c.urlParams_, opts...)
  8632. res, err := c.doRequest("json")
  8633. if res != nil && res.StatusCode == http.StatusNotModified {
  8634. if res.Body != nil {
  8635. res.Body.Close()
  8636. }
  8637. return nil, &googleapi.Error{
  8638. Code: res.StatusCode,
  8639. Header: res.Header,
  8640. }
  8641. }
  8642. if err != nil {
  8643. return nil, err
  8644. }
  8645. defer googleapi.CloseBody(res)
  8646. if err := googleapi.CheckResponse(res); err != nil {
  8647. return nil, err
  8648. }
  8649. ret := &GooglePrivacyDlpV2StoredInfoType{
  8650. ServerResponse: googleapi.ServerResponse{
  8651. Header: res.Header,
  8652. HTTPStatusCode: res.StatusCode,
  8653. },
  8654. }
  8655. target := &ret
  8656. if err := gensupport.DecodeResponse(target, res); err != nil {
  8657. return nil, err
  8658. }
  8659. return ret, nil
  8660. // {
  8661. // "description": "Gets a stored infoType.\nSee https://cloud.google.com/dlp/docs/creating-stored-infotypes to\nlearn more.",
  8662. // "flatPath": "v2/organizations/{organizationsId}/storedInfoTypes/{storedInfoTypesId}",
  8663. // "httpMethod": "GET",
  8664. // "id": "dlp.organizations.storedInfoTypes.get",
  8665. // "parameterOrder": [
  8666. // "name"
  8667. // ],
  8668. // "parameters": {
  8669. // "name": {
  8670. // "description": "Resource name of the organization and storedInfoType to be read, for\nexample `organizations/433245324/storedInfoTypes/432452342` or\nprojects/project-id/storedInfoTypes/432452342.",
  8671. // "location": "path",
  8672. // "pattern": "^organizations/[^/]+/storedInfoTypes/[^/]+$",
  8673. // "required": true,
  8674. // "type": "string"
  8675. // }
  8676. // },
  8677. // "path": "v2/{+name}",
  8678. // "response": {
  8679. // "$ref": "GooglePrivacyDlpV2StoredInfoType"
  8680. // },
  8681. // "scopes": [
  8682. // "https://www.googleapis.com/auth/cloud-platform"
  8683. // ]
  8684. // }
  8685. }
  8686. // method id "dlp.organizations.storedInfoTypes.list":
  8687. type OrganizationsStoredInfoTypesListCall struct {
  8688. s *Service
  8689. parent string
  8690. urlParams_ gensupport.URLParams
  8691. ifNoneMatch_ string
  8692. ctx_ context.Context
  8693. header_ http.Header
  8694. }
  8695. // List: Lists stored infoTypes.
  8696. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes
  8697. // to
  8698. // learn more.
  8699. func (r *OrganizationsStoredInfoTypesService) List(parent string) *OrganizationsStoredInfoTypesListCall {
  8700. c := &OrganizationsStoredInfoTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8701. c.parent = parent
  8702. return c
  8703. }
  8704. // OrderBy sets the optional parameter "orderBy": Optional comma
  8705. // separated list of fields to order by,
  8706. // followed by `asc` or `desc` postfix. This list is
  8707. // case-insensitive,
  8708. // default sorting order is ascending, redundant space characters
  8709. // are
  8710. // insignificant.
  8711. //
  8712. // Example: `name asc, display_name, create_time desc`
  8713. //
  8714. // Supported fields are:
  8715. //
  8716. // - `create_time`: corresponds to time the most recent version of
  8717. // the
  8718. // resource was created.
  8719. // - `state`: corresponds to the state of the resource.
  8720. // - `name`: corresponds to resource name.
  8721. // - `display_name`: corresponds to info type's display name.
  8722. func (c *OrganizationsStoredInfoTypesListCall) OrderBy(orderBy string) *OrganizationsStoredInfoTypesListCall {
  8723. c.urlParams_.Set("orderBy", orderBy)
  8724. return c
  8725. }
  8726. // PageSize sets the optional parameter "pageSize": Optional size of the
  8727. // page, can be limited by server. If zero server returns
  8728. // a page of max size 100.
  8729. func (c *OrganizationsStoredInfoTypesListCall) PageSize(pageSize int64) *OrganizationsStoredInfoTypesListCall {
  8730. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8731. return c
  8732. }
  8733. // PageToken sets the optional parameter "pageToken": Optional page
  8734. // token to continue retrieval. Comes from previous call
  8735. // to `ListStoredInfoTypes`.
  8736. func (c *OrganizationsStoredInfoTypesListCall) PageToken(pageToken string) *OrganizationsStoredInfoTypesListCall {
  8737. c.urlParams_.Set("pageToken", pageToken)
  8738. return c
  8739. }
  8740. // Fields allows partial responses to be retrieved. See
  8741. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8742. // for more information.
  8743. func (c *OrganizationsStoredInfoTypesListCall) Fields(s ...googleapi.Field) *OrganizationsStoredInfoTypesListCall {
  8744. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8745. return c
  8746. }
  8747. // IfNoneMatch sets the optional parameter which makes the operation
  8748. // fail if the object's ETag matches the given value. This is useful for
  8749. // getting updates only after the object has changed since the last
  8750. // request. Use googleapi.IsNotModified to check whether the response
  8751. // error from Do is the result of In-None-Match.
  8752. func (c *OrganizationsStoredInfoTypesListCall) IfNoneMatch(entityTag string) *OrganizationsStoredInfoTypesListCall {
  8753. c.ifNoneMatch_ = entityTag
  8754. return c
  8755. }
  8756. // Context sets the context to be used in this call's Do method. Any
  8757. // pending HTTP request will be aborted if the provided context is
  8758. // canceled.
  8759. func (c *OrganizationsStoredInfoTypesListCall) Context(ctx context.Context) *OrganizationsStoredInfoTypesListCall {
  8760. c.ctx_ = ctx
  8761. return c
  8762. }
  8763. // Header returns an http.Header that can be modified by the caller to
  8764. // add HTTP headers to the request.
  8765. func (c *OrganizationsStoredInfoTypesListCall) Header() http.Header {
  8766. if c.header_ == nil {
  8767. c.header_ = make(http.Header)
  8768. }
  8769. return c.header_
  8770. }
  8771. func (c *OrganizationsStoredInfoTypesListCall) doRequest(alt string) (*http.Response, error) {
  8772. reqHeaders := make(http.Header)
  8773. for k, v := range c.header_ {
  8774. reqHeaders[k] = v
  8775. }
  8776. reqHeaders.Set("User-Agent", c.s.userAgent())
  8777. if c.ifNoneMatch_ != "" {
  8778. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8779. }
  8780. var body io.Reader = nil
  8781. c.urlParams_.Set("alt", alt)
  8782. c.urlParams_.Set("prettyPrint", "false")
  8783. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/storedInfoTypes")
  8784. urls += "?" + c.urlParams_.Encode()
  8785. req, err := http.NewRequest("GET", urls, body)
  8786. if err != nil {
  8787. return nil, err
  8788. }
  8789. req.Header = reqHeaders
  8790. googleapi.Expand(req.URL, map[string]string{
  8791. "parent": c.parent,
  8792. })
  8793. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8794. }
  8795. // Do executes the "dlp.organizations.storedInfoTypes.list" call.
  8796. // Exactly one of *GooglePrivacyDlpV2ListStoredInfoTypesResponse or
  8797. // error will be non-nil. Any non-2xx status code is an error. Response
  8798. // headers are in either
  8799. // *GooglePrivacyDlpV2ListStoredInfoTypesResponse.ServerResponse.Header
  8800. // or (if a response was returned at all) in
  8801. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8802. // whether the returned error was because http.StatusNotModified was
  8803. // returned.
  8804. func (c *OrganizationsStoredInfoTypesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListStoredInfoTypesResponse, error) {
  8805. gensupport.SetOptions(c.urlParams_, opts...)
  8806. res, err := c.doRequest("json")
  8807. if res != nil && res.StatusCode == http.StatusNotModified {
  8808. if res.Body != nil {
  8809. res.Body.Close()
  8810. }
  8811. return nil, &googleapi.Error{
  8812. Code: res.StatusCode,
  8813. Header: res.Header,
  8814. }
  8815. }
  8816. if err != nil {
  8817. return nil, err
  8818. }
  8819. defer googleapi.CloseBody(res)
  8820. if err := googleapi.CheckResponse(res); err != nil {
  8821. return nil, err
  8822. }
  8823. ret := &GooglePrivacyDlpV2ListStoredInfoTypesResponse{
  8824. ServerResponse: googleapi.ServerResponse{
  8825. Header: res.Header,
  8826. HTTPStatusCode: res.StatusCode,
  8827. },
  8828. }
  8829. target := &ret
  8830. if err := gensupport.DecodeResponse(target, res); err != nil {
  8831. return nil, err
  8832. }
  8833. return ret, nil
  8834. // {
  8835. // "description": "Lists stored infoTypes.\nSee https://cloud.google.com/dlp/docs/creating-stored-infotypes to\nlearn more.",
  8836. // "flatPath": "v2/organizations/{organizationsId}/storedInfoTypes",
  8837. // "httpMethod": "GET",
  8838. // "id": "dlp.organizations.storedInfoTypes.list",
  8839. // "parameterOrder": [
  8840. // "parent"
  8841. // ],
  8842. // "parameters": {
  8843. // "orderBy": {
  8844. // "description": "Optional comma separated list of fields to order by,\nfollowed by `asc` or `desc` postfix. This list is case-insensitive,\ndefault sorting order is ascending, redundant space characters are\ninsignificant.\n\nExample: `name asc, display_name, create_time desc`\n\nSupported fields are:\n\n- `create_time`: corresponds to time the most recent version of the\nresource was created.\n- `state`: corresponds to the state of the resource.\n- `name`: corresponds to resource name.\n- `display_name`: corresponds to info type's display name.",
  8845. // "location": "query",
  8846. // "type": "string"
  8847. // },
  8848. // "pageSize": {
  8849. // "description": "Optional size of the page, can be limited by server. If zero server returns\na page of max size 100.",
  8850. // "format": "int32",
  8851. // "location": "query",
  8852. // "type": "integer"
  8853. // },
  8854. // "pageToken": {
  8855. // "description": "Optional page token to continue retrieval. Comes from previous call\nto `ListStoredInfoTypes`.",
  8856. // "location": "query",
  8857. // "type": "string"
  8858. // },
  8859. // "parent": {
  8860. // "description": "The parent resource name, for example projects/my-project-id or\norganizations/my-org-id.",
  8861. // "location": "path",
  8862. // "pattern": "^organizations/[^/]+$",
  8863. // "required": true,
  8864. // "type": "string"
  8865. // }
  8866. // },
  8867. // "path": "v2/{+parent}/storedInfoTypes",
  8868. // "response": {
  8869. // "$ref": "GooglePrivacyDlpV2ListStoredInfoTypesResponse"
  8870. // },
  8871. // "scopes": [
  8872. // "https://www.googleapis.com/auth/cloud-platform"
  8873. // ]
  8874. // }
  8875. }
  8876. // Pages invokes f for each page of results.
  8877. // A non-nil error returned from f will halt the iteration.
  8878. // The provided context supersedes any context provided to the Context method.
  8879. func (c *OrganizationsStoredInfoTypesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListStoredInfoTypesResponse) error) error {
  8880. c.ctx_ = ctx
  8881. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8882. for {
  8883. x, err := c.Do()
  8884. if err != nil {
  8885. return err
  8886. }
  8887. if err := f(x); err != nil {
  8888. return err
  8889. }
  8890. if x.NextPageToken == "" {
  8891. return nil
  8892. }
  8893. c.PageToken(x.NextPageToken)
  8894. }
  8895. }
  8896. // method id "dlp.organizations.storedInfoTypes.patch":
  8897. type OrganizationsStoredInfoTypesPatchCall struct {
  8898. s *Service
  8899. name string
  8900. googleprivacydlpv2updatestoredinfotyperequest *GooglePrivacyDlpV2UpdateStoredInfoTypeRequest
  8901. urlParams_ gensupport.URLParams
  8902. ctx_ context.Context
  8903. header_ http.Header
  8904. }
  8905. // Patch: Updates the stored infoType by creating a new version. The
  8906. // existing version
  8907. // will continue to be used until the new version is ready.
  8908. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes
  8909. // to
  8910. // learn more.
  8911. func (r *OrganizationsStoredInfoTypesService) Patch(name string, googleprivacydlpv2updatestoredinfotyperequest *GooglePrivacyDlpV2UpdateStoredInfoTypeRequest) *OrganizationsStoredInfoTypesPatchCall {
  8912. c := &OrganizationsStoredInfoTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8913. c.name = name
  8914. c.googleprivacydlpv2updatestoredinfotyperequest = googleprivacydlpv2updatestoredinfotyperequest
  8915. return c
  8916. }
  8917. // Fields allows partial responses to be retrieved. See
  8918. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8919. // for more information.
  8920. func (c *OrganizationsStoredInfoTypesPatchCall) Fields(s ...googleapi.Field) *OrganizationsStoredInfoTypesPatchCall {
  8921. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8922. return c
  8923. }
  8924. // Context sets the context to be used in this call's Do method. Any
  8925. // pending HTTP request will be aborted if the provided context is
  8926. // canceled.
  8927. func (c *OrganizationsStoredInfoTypesPatchCall) Context(ctx context.Context) *OrganizationsStoredInfoTypesPatchCall {
  8928. c.ctx_ = ctx
  8929. return c
  8930. }
  8931. // Header returns an http.Header that can be modified by the caller to
  8932. // add HTTP headers to the request.
  8933. func (c *OrganizationsStoredInfoTypesPatchCall) Header() http.Header {
  8934. if c.header_ == nil {
  8935. c.header_ = make(http.Header)
  8936. }
  8937. return c.header_
  8938. }
  8939. func (c *OrganizationsStoredInfoTypesPatchCall) doRequest(alt string) (*http.Response, error) {
  8940. reqHeaders := make(http.Header)
  8941. for k, v := range c.header_ {
  8942. reqHeaders[k] = v
  8943. }
  8944. reqHeaders.Set("User-Agent", c.s.userAgent())
  8945. var body io.Reader = nil
  8946. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatestoredinfotyperequest)
  8947. if err != nil {
  8948. return nil, err
  8949. }
  8950. reqHeaders.Set("Content-Type", "application/json")
  8951. c.urlParams_.Set("alt", alt)
  8952. c.urlParams_.Set("prettyPrint", "false")
  8953. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  8954. urls += "?" + c.urlParams_.Encode()
  8955. req, err := http.NewRequest("PATCH", urls, body)
  8956. if err != nil {
  8957. return nil, err
  8958. }
  8959. req.Header = reqHeaders
  8960. googleapi.Expand(req.URL, map[string]string{
  8961. "name": c.name,
  8962. })
  8963. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8964. }
  8965. // Do executes the "dlp.organizations.storedInfoTypes.patch" call.
  8966. // Exactly one of *GooglePrivacyDlpV2StoredInfoType or error will be
  8967. // non-nil. Any non-2xx status code is an error. Response headers are in
  8968. // either *GooglePrivacyDlpV2StoredInfoType.ServerResponse.Header or (if
  8969. // a response was returned at all) in error.(*googleapi.Error).Header.
  8970. // Use googleapi.IsNotModified to check whether the returned error was
  8971. // because http.StatusNotModified was returned.
  8972. func (c *OrganizationsStoredInfoTypesPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2StoredInfoType, error) {
  8973. gensupport.SetOptions(c.urlParams_, opts...)
  8974. res, err := c.doRequest("json")
  8975. if res != nil && res.StatusCode == http.StatusNotModified {
  8976. if res.Body != nil {
  8977. res.Body.Close()
  8978. }
  8979. return nil, &googleapi.Error{
  8980. Code: res.StatusCode,
  8981. Header: res.Header,
  8982. }
  8983. }
  8984. if err != nil {
  8985. return nil, err
  8986. }
  8987. defer googleapi.CloseBody(res)
  8988. if err := googleapi.CheckResponse(res); err != nil {
  8989. return nil, err
  8990. }
  8991. ret := &GooglePrivacyDlpV2StoredInfoType{
  8992. ServerResponse: googleapi.ServerResponse{
  8993. Header: res.Header,
  8994. HTTPStatusCode: res.StatusCode,
  8995. },
  8996. }
  8997. target := &ret
  8998. if err := gensupport.DecodeResponse(target, res); err != nil {
  8999. return nil, err
  9000. }
  9001. return ret, nil
  9002. // {
  9003. // "description": "Updates the stored infoType by creating a new version. The existing version\nwill continue to be used until the new version is ready.\nSee https://cloud.google.com/dlp/docs/creating-stored-infotypes to\nlearn more.",
  9004. // "flatPath": "v2/organizations/{organizationsId}/storedInfoTypes/{storedInfoTypesId}",
  9005. // "httpMethod": "PATCH",
  9006. // "id": "dlp.organizations.storedInfoTypes.patch",
  9007. // "parameterOrder": [
  9008. // "name"
  9009. // ],
  9010. // "parameters": {
  9011. // "name": {
  9012. // "description": "Resource name of organization and storedInfoType to be updated, for\nexample `organizations/433245324/storedInfoTypes/432452342` or\nprojects/project-id/storedInfoTypes/432452342.",
  9013. // "location": "path",
  9014. // "pattern": "^organizations/[^/]+/storedInfoTypes/[^/]+$",
  9015. // "required": true,
  9016. // "type": "string"
  9017. // }
  9018. // },
  9019. // "path": "v2/{+name}",
  9020. // "request": {
  9021. // "$ref": "GooglePrivacyDlpV2UpdateStoredInfoTypeRequest"
  9022. // },
  9023. // "response": {
  9024. // "$ref": "GooglePrivacyDlpV2StoredInfoType"
  9025. // },
  9026. // "scopes": [
  9027. // "https://www.googleapis.com/auth/cloud-platform"
  9028. // ]
  9029. // }
  9030. }
  9031. // method id "dlp.projects.content.deidentify":
  9032. type ProjectsContentDeidentifyCall struct {
  9033. s *Service
  9034. parent string
  9035. googleprivacydlpv2deidentifycontentrequest *GooglePrivacyDlpV2DeidentifyContentRequest
  9036. urlParams_ gensupport.URLParams
  9037. ctx_ context.Context
  9038. header_ http.Header
  9039. }
  9040. // Deidentify: De-identifies potentially sensitive info from a
  9041. // ContentItem.
  9042. // This method has limits on input size and output size.
  9043. // See https://cloud.google.com/dlp/docs/deidentify-sensitive-data
  9044. // to
  9045. // learn more.
  9046. //
  9047. // When no InfoTypes or CustomInfoTypes are specified in this request,
  9048. // the
  9049. // system will automatically choose what detectors to run. By default
  9050. // this may
  9051. // be all types, but may change over time as detectors are updated.
  9052. func (r *ProjectsContentService) Deidentify(parent string, googleprivacydlpv2deidentifycontentrequest *GooglePrivacyDlpV2DeidentifyContentRequest) *ProjectsContentDeidentifyCall {
  9053. c := &ProjectsContentDeidentifyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9054. c.parent = parent
  9055. c.googleprivacydlpv2deidentifycontentrequest = googleprivacydlpv2deidentifycontentrequest
  9056. return c
  9057. }
  9058. // Fields allows partial responses to be retrieved. See
  9059. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9060. // for more information.
  9061. func (c *ProjectsContentDeidentifyCall) Fields(s ...googleapi.Field) *ProjectsContentDeidentifyCall {
  9062. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9063. return c
  9064. }
  9065. // Context sets the context to be used in this call's Do method. Any
  9066. // pending HTTP request will be aborted if the provided context is
  9067. // canceled.
  9068. func (c *ProjectsContentDeidentifyCall) Context(ctx context.Context) *ProjectsContentDeidentifyCall {
  9069. c.ctx_ = ctx
  9070. return c
  9071. }
  9072. // Header returns an http.Header that can be modified by the caller to
  9073. // add HTTP headers to the request.
  9074. func (c *ProjectsContentDeidentifyCall) Header() http.Header {
  9075. if c.header_ == nil {
  9076. c.header_ = make(http.Header)
  9077. }
  9078. return c.header_
  9079. }
  9080. func (c *ProjectsContentDeidentifyCall) doRequest(alt string) (*http.Response, error) {
  9081. reqHeaders := make(http.Header)
  9082. for k, v := range c.header_ {
  9083. reqHeaders[k] = v
  9084. }
  9085. reqHeaders.Set("User-Agent", c.s.userAgent())
  9086. var body io.Reader = nil
  9087. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2deidentifycontentrequest)
  9088. if err != nil {
  9089. return nil, err
  9090. }
  9091. reqHeaders.Set("Content-Type", "application/json")
  9092. c.urlParams_.Set("alt", alt)
  9093. c.urlParams_.Set("prettyPrint", "false")
  9094. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/content:deidentify")
  9095. urls += "?" + c.urlParams_.Encode()
  9096. req, err := http.NewRequest("POST", urls, body)
  9097. if err != nil {
  9098. return nil, err
  9099. }
  9100. req.Header = reqHeaders
  9101. googleapi.Expand(req.URL, map[string]string{
  9102. "parent": c.parent,
  9103. })
  9104. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9105. }
  9106. // Do executes the "dlp.projects.content.deidentify" call.
  9107. // Exactly one of *GooglePrivacyDlpV2DeidentifyContentResponse or error
  9108. // will be non-nil. Any non-2xx status code is an error. Response
  9109. // headers are in either
  9110. // *GooglePrivacyDlpV2DeidentifyContentResponse.ServerResponse.Header or
  9111. // (if a response was returned at all) in
  9112. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9113. // whether the returned error was because http.StatusNotModified was
  9114. // returned.
  9115. func (c *ProjectsContentDeidentifyCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyContentResponse, error) {
  9116. gensupport.SetOptions(c.urlParams_, opts...)
  9117. res, err := c.doRequest("json")
  9118. if res != nil && res.StatusCode == http.StatusNotModified {
  9119. if res.Body != nil {
  9120. res.Body.Close()
  9121. }
  9122. return nil, &googleapi.Error{
  9123. Code: res.StatusCode,
  9124. Header: res.Header,
  9125. }
  9126. }
  9127. if err != nil {
  9128. return nil, err
  9129. }
  9130. defer googleapi.CloseBody(res)
  9131. if err := googleapi.CheckResponse(res); err != nil {
  9132. return nil, err
  9133. }
  9134. ret := &GooglePrivacyDlpV2DeidentifyContentResponse{
  9135. ServerResponse: googleapi.ServerResponse{
  9136. Header: res.Header,
  9137. HTTPStatusCode: res.StatusCode,
  9138. },
  9139. }
  9140. target := &ret
  9141. if err := gensupport.DecodeResponse(target, res); err != nil {
  9142. return nil, err
  9143. }
  9144. return ret, nil
  9145. // {
  9146. // "description": "De-identifies potentially sensitive info from a ContentItem.\nThis method has limits on input size and output size.\nSee https://cloud.google.com/dlp/docs/deidentify-sensitive-data to\nlearn more.\n\nWhen no InfoTypes or CustomInfoTypes are specified in this request, the\nsystem will automatically choose what detectors to run. By default this may\nbe all types, but may change over time as detectors are updated.",
  9147. // "flatPath": "v2/projects/{projectsId}/content:deidentify",
  9148. // "httpMethod": "POST",
  9149. // "id": "dlp.projects.content.deidentify",
  9150. // "parameterOrder": [
  9151. // "parent"
  9152. // ],
  9153. // "parameters": {
  9154. // "parent": {
  9155. // "description": "The parent resource name, for example projects/my-project-id.",
  9156. // "location": "path",
  9157. // "pattern": "^projects/[^/]+$",
  9158. // "required": true,
  9159. // "type": "string"
  9160. // }
  9161. // },
  9162. // "path": "v2/{+parent}/content:deidentify",
  9163. // "request": {
  9164. // "$ref": "GooglePrivacyDlpV2DeidentifyContentRequest"
  9165. // },
  9166. // "response": {
  9167. // "$ref": "GooglePrivacyDlpV2DeidentifyContentResponse"
  9168. // },
  9169. // "scopes": [
  9170. // "https://www.googleapis.com/auth/cloud-platform"
  9171. // ]
  9172. // }
  9173. }
  9174. // method id "dlp.projects.content.inspect":
  9175. type ProjectsContentInspectCall struct {
  9176. s *Service
  9177. parent string
  9178. googleprivacydlpv2inspectcontentrequest *GooglePrivacyDlpV2InspectContentRequest
  9179. urlParams_ gensupport.URLParams
  9180. ctx_ context.Context
  9181. header_ http.Header
  9182. }
  9183. // Inspect: Finds potentially sensitive info in content.
  9184. // This method has limits on input size, processing time, and output
  9185. // size.
  9186. //
  9187. // When no InfoTypes or CustomInfoTypes are specified in this request,
  9188. // the
  9189. // system will automatically choose what detectors to run. By default
  9190. // this may
  9191. // be all types, but may change over time as detectors are updated.
  9192. //
  9193. // For how to guides, see
  9194. // https://cloud.google.com/dlp/docs/inspecting-images
  9195. // and https://cloud.google.com/dlp/docs/inspecting-text,
  9196. func (r *ProjectsContentService) Inspect(parent string, googleprivacydlpv2inspectcontentrequest *GooglePrivacyDlpV2InspectContentRequest) *ProjectsContentInspectCall {
  9197. c := &ProjectsContentInspectCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9198. c.parent = parent
  9199. c.googleprivacydlpv2inspectcontentrequest = googleprivacydlpv2inspectcontentrequest
  9200. return c
  9201. }
  9202. // Fields allows partial responses to be retrieved. See
  9203. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9204. // for more information.
  9205. func (c *ProjectsContentInspectCall) Fields(s ...googleapi.Field) *ProjectsContentInspectCall {
  9206. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9207. return c
  9208. }
  9209. // Context sets the context to be used in this call's Do method. Any
  9210. // pending HTTP request will be aborted if the provided context is
  9211. // canceled.
  9212. func (c *ProjectsContentInspectCall) Context(ctx context.Context) *ProjectsContentInspectCall {
  9213. c.ctx_ = ctx
  9214. return c
  9215. }
  9216. // Header returns an http.Header that can be modified by the caller to
  9217. // add HTTP headers to the request.
  9218. func (c *ProjectsContentInspectCall) Header() http.Header {
  9219. if c.header_ == nil {
  9220. c.header_ = make(http.Header)
  9221. }
  9222. return c.header_
  9223. }
  9224. func (c *ProjectsContentInspectCall) doRequest(alt string) (*http.Response, error) {
  9225. reqHeaders := make(http.Header)
  9226. for k, v := range c.header_ {
  9227. reqHeaders[k] = v
  9228. }
  9229. reqHeaders.Set("User-Agent", c.s.userAgent())
  9230. var body io.Reader = nil
  9231. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2inspectcontentrequest)
  9232. if err != nil {
  9233. return nil, err
  9234. }
  9235. reqHeaders.Set("Content-Type", "application/json")
  9236. c.urlParams_.Set("alt", alt)
  9237. c.urlParams_.Set("prettyPrint", "false")
  9238. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/content:inspect")
  9239. urls += "?" + c.urlParams_.Encode()
  9240. req, err := http.NewRequest("POST", urls, body)
  9241. if err != nil {
  9242. return nil, err
  9243. }
  9244. req.Header = reqHeaders
  9245. googleapi.Expand(req.URL, map[string]string{
  9246. "parent": c.parent,
  9247. })
  9248. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9249. }
  9250. // Do executes the "dlp.projects.content.inspect" call.
  9251. // Exactly one of *GooglePrivacyDlpV2InspectContentResponse or error
  9252. // will be non-nil. Any non-2xx status code is an error. Response
  9253. // headers are in either
  9254. // *GooglePrivacyDlpV2InspectContentResponse.ServerResponse.Header or
  9255. // (if a response was returned at all) in
  9256. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9257. // whether the returned error was because http.StatusNotModified was
  9258. // returned.
  9259. func (c *ProjectsContentInspectCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectContentResponse, error) {
  9260. gensupport.SetOptions(c.urlParams_, opts...)
  9261. res, err := c.doRequest("json")
  9262. if res != nil && res.StatusCode == http.StatusNotModified {
  9263. if res.Body != nil {
  9264. res.Body.Close()
  9265. }
  9266. return nil, &googleapi.Error{
  9267. Code: res.StatusCode,
  9268. Header: res.Header,
  9269. }
  9270. }
  9271. if err != nil {
  9272. return nil, err
  9273. }
  9274. defer googleapi.CloseBody(res)
  9275. if err := googleapi.CheckResponse(res); err != nil {
  9276. return nil, err
  9277. }
  9278. ret := &GooglePrivacyDlpV2InspectContentResponse{
  9279. ServerResponse: googleapi.ServerResponse{
  9280. Header: res.Header,
  9281. HTTPStatusCode: res.StatusCode,
  9282. },
  9283. }
  9284. target := &ret
  9285. if err := gensupport.DecodeResponse(target, res); err != nil {
  9286. return nil, err
  9287. }
  9288. return ret, nil
  9289. // {
  9290. // "description": "Finds potentially sensitive info in content.\nThis method has limits on input size, processing time, and output size.\n\nWhen no InfoTypes or CustomInfoTypes are specified in this request, the\nsystem will automatically choose what detectors to run. By default this may\nbe all types, but may change over time as detectors are updated.\n\nFor how to guides, see https://cloud.google.com/dlp/docs/inspecting-images\nand https://cloud.google.com/dlp/docs/inspecting-text,",
  9291. // "flatPath": "v2/projects/{projectsId}/content:inspect",
  9292. // "httpMethod": "POST",
  9293. // "id": "dlp.projects.content.inspect",
  9294. // "parameterOrder": [
  9295. // "parent"
  9296. // ],
  9297. // "parameters": {
  9298. // "parent": {
  9299. // "description": "The parent resource name, for example projects/my-project-id.",
  9300. // "location": "path",
  9301. // "pattern": "^projects/[^/]+$",
  9302. // "required": true,
  9303. // "type": "string"
  9304. // }
  9305. // },
  9306. // "path": "v2/{+parent}/content:inspect",
  9307. // "request": {
  9308. // "$ref": "GooglePrivacyDlpV2InspectContentRequest"
  9309. // },
  9310. // "response": {
  9311. // "$ref": "GooglePrivacyDlpV2InspectContentResponse"
  9312. // },
  9313. // "scopes": [
  9314. // "https://www.googleapis.com/auth/cloud-platform"
  9315. // ]
  9316. // }
  9317. }
  9318. // method id "dlp.projects.content.reidentify":
  9319. type ProjectsContentReidentifyCall struct {
  9320. s *Service
  9321. parent string
  9322. googleprivacydlpv2reidentifycontentrequest *GooglePrivacyDlpV2ReidentifyContentRequest
  9323. urlParams_ gensupport.URLParams
  9324. ctx_ context.Context
  9325. header_ http.Header
  9326. }
  9327. // Reidentify: Re-identifies content that has been
  9328. // de-identified.
  9329. // See
  9330. // https://cloud.google.com/dlp/docs/pseudonymization#
  9331. // re-identification_in_free_text_code_example
  9332. // to learn more.
  9333. func (r *ProjectsContentService) Reidentify(parent string, googleprivacydlpv2reidentifycontentrequest *GooglePrivacyDlpV2ReidentifyContentRequest) *ProjectsContentReidentifyCall {
  9334. c := &ProjectsContentReidentifyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9335. c.parent = parent
  9336. c.googleprivacydlpv2reidentifycontentrequest = googleprivacydlpv2reidentifycontentrequest
  9337. return c
  9338. }
  9339. // Fields allows partial responses to be retrieved. See
  9340. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9341. // for more information.
  9342. func (c *ProjectsContentReidentifyCall) Fields(s ...googleapi.Field) *ProjectsContentReidentifyCall {
  9343. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9344. return c
  9345. }
  9346. // Context sets the context to be used in this call's Do method. Any
  9347. // pending HTTP request will be aborted if the provided context is
  9348. // canceled.
  9349. func (c *ProjectsContentReidentifyCall) Context(ctx context.Context) *ProjectsContentReidentifyCall {
  9350. c.ctx_ = ctx
  9351. return c
  9352. }
  9353. // Header returns an http.Header that can be modified by the caller to
  9354. // add HTTP headers to the request.
  9355. func (c *ProjectsContentReidentifyCall) Header() http.Header {
  9356. if c.header_ == nil {
  9357. c.header_ = make(http.Header)
  9358. }
  9359. return c.header_
  9360. }
  9361. func (c *ProjectsContentReidentifyCall) doRequest(alt string) (*http.Response, error) {
  9362. reqHeaders := make(http.Header)
  9363. for k, v := range c.header_ {
  9364. reqHeaders[k] = v
  9365. }
  9366. reqHeaders.Set("User-Agent", c.s.userAgent())
  9367. var body io.Reader = nil
  9368. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2reidentifycontentrequest)
  9369. if err != nil {
  9370. return nil, err
  9371. }
  9372. reqHeaders.Set("Content-Type", "application/json")
  9373. c.urlParams_.Set("alt", alt)
  9374. c.urlParams_.Set("prettyPrint", "false")
  9375. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/content:reidentify")
  9376. urls += "?" + c.urlParams_.Encode()
  9377. req, err := http.NewRequest("POST", urls, body)
  9378. if err != nil {
  9379. return nil, err
  9380. }
  9381. req.Header = reqHeaders
  9382. googleapi.Expand(req.URL, map[string]string{
  9383. "parent": c.parent,
  9384. })
  9385. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9386. }
  9387. // Do executes the "dlp.projects.content.reidentify" call.
  9388. // Exactly one of *GooglePrivacyDlpV2ReidentifyContentResponse or error
  9389. // will be non-nil. Any non-2xx status code is an error. Response
  9390. // headers are in either
  9391. // *GooglePrivacyDlpV2ReidentifyContentResponse.ServerResponse.Header or
  9392. // (if a response was returned at all) in
  9393. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9394. // whether the returned error was because http.StatusNotModified was
  9395. // returned.
  9396. func (c *ProjectsContentReidentifyCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ReidentifyContentResponse, error) {
  9397. gensupport.SetOptions(c.urlParams_, opts...)
  9398. res, err := c.doRequest("json")
  9399. if res != nil && res.StatusCode == http.StatusNotModified {
  9400. if res.Body != nil {
  9401. res.Body.Close()
  9402. }
  9403. return nil, &googleapi.Error{
  9404. Code: res.StatusCode,
  9405. Header: res.Header,
  9406. }
  9407. }
  9408. if err != nil {
  9409. return nil, err
  9410. }
  9411. defer googleapi.CloseBody(res)
  9412. if err := googleapi.CheckResponse(res); err != nil {
  9413. return nil, err
  9414. }
  9415. ret := &GooglePrivacyDlpV2ReidentifyContentResponse{
  9416. ServerResponse: googleapi.ServerResponse{
  9417. Header: res.Header,
  9418. HTTPStatusCode: res.StatusCode,
  9419. },
  9420. }
  9421. target := &ret
  9422. if err := gensupport.DecodeResponse(target, res); err != nil {
  9423. return nil, err
  9424. }
  9425. return ret, nil
  9426. // {
  9427. // "description": "Re-identifies content that has been de-identified.\nSee\nhttps://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example\nto learn more.",
  9428. // "flatPath": "v2/projects/{projectsId}/content:reidentify",
  9429. // "httpMethod": "POST",
  9430. // "id": "dlp.projects.content.reidentify",
  9431. // "parameterOrder": [
  9432. // "parent"
  9433. // ],
  9434. // "parameters": {
  9435. // "parent": {
  9436. // "description": "The parent resource name.",
  9437. // "location": "path",
  9438. // "pattern": "^projects/[^/]+$",
  9439. // "required": true,
  9440. // "type": "string"
  9441. // }
  9442. // },
  9443. // "path": "v2/{+parent}/content:reidentify",
  9444. // "request": {
  9445. // "$ref": "GooglePrivacyDlpV2ReidentifyContentRequest"
  9446. // },
  9447. // "response": {
  9448. // "$ref": "GooglePrivacyDlpV2ReidentifyContentResponse"
  9449. // },
  9450. // "scopes": [
  9451. // "https://www.googleapis.com/auth/cloud-platform"
  9452. // ]
  9453. // }
  9454. }
  9455. // method id "dlp.projects.deidentifyTemplates.create":
  9456. type ProjectsDeidentifyTemplatesCreateCall struct {
  9457. s *Service
  9458. parent string
  9459. googleprivacydlpv2createdeidentifytemplaterequest *GooglePrivacyDlpV2CreateDeidentifyTemplateRequest
  9460. urlParams_ gensupport.URLParams
  9461. ctx_ context.Context
  9462. header_ http.Header
  9463. }
  9464. // Create: Creates a DeidentifyTemplate for re-using frequently used
  9465. // configuration
  9466. // for de-identifying content, images, and storage.
  9467. // See https://cloud.google.com/dlp/docs/creating-templates-deid to
  9468. // learn
  9469. // more.
  9470. func (r *ProjectsDeidentifyTemplatesService) Create(parent string, googleprivacydlpv2createdeidentifytemplaterequest *GooglePrivacyDlpV2CreateDeidentifyTemplateRequest) *ProjectsDeidentifyTemplatesCreateCall {
  9471. c := &ProjectsDeidentifyTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9472. c.parent = parent
  9473. c.googleprivacydlpv2createdeidentifytemplaterequest = googleprivacydlpv2createdeidentifytemplaterequest
  9474. return c
  9475. }
  9476. // Fields allows partial responses to be retrieved. See
  9477. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9478. // for more information.
  9479. func (c *ProjectsDeidentifyTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsDeidentifyTemplatesCreateCall {
  9480. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9481. return c
  9482. }
  9483. // Context sets the context to be used in this call's Do method. Any
  9484. // pending HTTP request will be aborted if the provided context is
  9485. // canceled.
  9486. func (c *ProjectsDeidentifyTemplatesCreateCall) Context(ctx context.Context) *ProjectsDeidentifyTemplatesCreateCall {
  9487. c.ctx_ = ctx
  9488. return c
  9489. }
  9490. // Header returns an http.Header that can be modified by the caller to
  9491. // add HTTP headers to the request.
  9492. func (c *ProjectsDeidentifyTemplatesCreateCall) Header() http.Header {
  9493. if c.header_ == nil {
  9494. c.header_ = make(http.Header)
  9495. }
  9496. return c.header_
  9497. }
  9498. func (c *ProjectsDeidentifyTemplatesCreateCall) doRequest(alt string) (*http.Response, error) {
  9499. reqHeaders := make(http.Header)
  9500. for k, v := range c.header_ {
  9501. reqHeaders[k] = v
  9502. }
  9503. reqHeaders.Set("User-Agent", c.s.userAgent())
  9504. var body io.Reader = nil
  9505. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createdeidentifytemplaterequest)
  9506. if err != nil {
  9507. return nil, err
  9508. }
  9509. reqHeaders.Set("Content-Type", "application/json")
  9510. c.urlParams_.Set("alt", alt)
  9511. c.urlParams_.Set("prettyPrint", "false")
  9512. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/deidentifyTemplates")
  9513. urls += "?" + c.urlParams_.Encode()
  9514. req, err := http.NewRequest("POST", urls, body)
  9515. if err != nil {
  9516. return nil, err
  9517. }
  9518. req.Header = reqHeaders
  9519. googleapi.Expand(req.URL, map[string]string{
  9520. "parent": c.parent,
  9521. })
  9522. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9523. }
  9524. // Do executes the "dlp.projects.deidentifyTemplates.create" call.
  9525. // Exactly one of *GooglePrivacyDlpV2DeidentifyTemplate or error will be
  9526. // non-nil. Any non-2xx status code is an error. Response headers are in
  9527. // either *GooglePrivacyDlpV2DeidentifyTemplate.ServerResponse.Header or
  9528. // (if a response was returned at all) in
  9529. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9530. // whether the returned error was because http.StatusNotModified was
  9531. // returned.
  9532. func (c *ProjectsDeidentifyTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyTemplate, error) {
  9533. gensupport.SetOptions(c.urlParams_, opts...)
  9534. res, err := c.doRequest("json")
  9535. if res != nil && res.StatusCode == http.StatusNotModified {
  9536. if res.Body != nil {
  9537. res.Body.Close()
  9538. }
  9539. return nil, &googleapi.Error{
  9540. Code: res.StatusCode,
  9541. Header: res.Header,
  9542. }
  9543. }
  9544. if err != nil {
  9545. return nil, err
  9546. }
  9547. defer googleapi.CloseBody(res)
  9548. if err := googleapi.CheckResponse(res); err != nil {
  9549. return nil, err
  9550. }
  9551. ret := &GooglePrivacyDlpV2DeidentifyTemplate{
  9552. ServerResponse: googleapi.ServerResponse{
  9553. Header: res.Header,
  9554. HTTPStatusCode: res.StatusCode,
  9555. },
  9556. }
  9557. target := &ret
  9558. if err := gensupport.DecodeResponse(target, res); err != nil {
  9559. return nil, err
  9560. }
  9561. return ret, nil
  9562. // {
  9563. // "description": "Creates a DeidentifyTemplate for re-using frequently used configuration\nfor de-identifying content, images, and storage.\nSee https://cloud.google.com/dlp/docs/creating-templates-deid to learn\nmore.",
  9564. // "flatPath": "v2/projects/{projectsId}/deidentifyTemplates",
  9565. // "httpMethod": "POST",
  9566. // "id": "dlp.projects.deidentifyTemplates.create",
  9567. // "parameterOrder": [
  9568. // "parent"
  9569. // ],
  9570. // "parameters": {
  9571. // "parent": {
  9572. // "description": "The parent resource name, for example projects/my-project-id or\norganizations/my-org-id.",
  9573. // "location": "path",
  9574. // "pattern": "^projects/[^/]+$",
  9575. // "required": true,
  9576. // "type": "string"
  9577. // }
  9578. // },
  9579. // "path": "v2/{+parent}/deidentifyTemplates",
  9580. // "request": {
  9581. // "$ref": "GooglePrivacyDlpV2CreateDeidentifyTemplateRequest"
  9582. // },
  9583. // "response": {
  9584. // "$ref": "GooglePrivacyDlpV2DeidentifyTemplate"
  9585. // },
  9586. // "scopes": [
  9587. // "https://www.googleapis.com/auth/cloud-platform"
  9588. // ]
  9589. // }
  9590. }
  9591. // method id "dlp.projects.deidentifyTemplates.delete":
  9592. type ProjectsDeidentifyTemplatesDeleteCall struct {
  9593. s *Service
  9594. name string
  9595. urlParams_ gensupport.URLParams
  9596. ctx_ context.Context
  9597. header_ http.Header
  9598. }
  9599. // Delete: Deletes a DeidentifyTemplate.
  9600. // See https://cloud.google.com/dlp/docs/creating-templates-deid to
  9601. // learn
  9602. // more.
  9603. func (r *ProjectsDeidentifyTemplatesService) Delete(name string) *ProjectsDeidentifyTemplatesDeleteCall {
  9604. c := &ProjectsDeidentifyTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9605. c.name = name
  9606. return c
  9607. }
  9608. // Fields allows partial responses to be retrieved. See
  9609. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9610. // for more information.
  9611. func (c *ProjectsDeidentifyTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsDeidentifyTemplatesDeleteCall {
  9612. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9613. return c
  9614. }
  9615. // Context sets the context to be used in this call's Do method. Any
  9616. // pending HTTP request will be aborted if the provided context is
  9617. // canceled.
  9618. func (c *ProjectsDeidentifyTemplatesDeleteCall) Context(ctx context.Context) *ProjectsDeidentifyTemplatesDeleteCall {
  9619. c.ctx_ = ctx
  9620. return c
  9621. }
  9622. // Header returns an http.Header that can be modified by the caller to
  9623. // add HTTP headers to the request.
  9624. func (c *ProjectsDeidentifyTemplatesDeleteCall) Header() http.Header {
  9625. if c.header_ == nil {
  9626. c.header_ = make(http.Header)
  9627. }
  9628. return c.header_
  9629. }
  9630. func (c *ProjectsDeidentifyTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  9631. reqHeaders := make(http.Header)
  9632. for k, v := range c.header_ {
  9633. reqHeaders[k] = v
  9634. }
  9635. reqHeaders.Set("User-Agent", c.s.userAgent())
  9636. var body io.Reader = nil
  9637. c.urlParams_.Set("alt", alt)
  9638. c.urlParams_.Set("prettyPrint", "false")
  9639. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  9640. urls += "?" + c.urlParams_.Encode()
  9641. req, err := http.NewRequest("DELETE", urls, body)
  9642. if err != nil {
  9643. return nil, err
  9644. }
  9645. req.Header = reqHeaders
  9646. googleapi.Expand(req.URL, map[string]string{
  9647. "name": c.name,
  9648. })
  9649. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9650. }
  9651. // Do executes the "dlp.projects.deidentifyTemplates.delete" call.
  9652. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  9653. // non-2xx status code is an error. Response headers are in either
  9654. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  9655. // returned at all) in error.(*googleapi.Error).Header. Use
  9656. // googleapi.IsNotModified to check whether the returned error was
  9657. // because http.StatusNotModified was returned.
  9658. func (c *ProjectsDeidentifyTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  9659. gensupport.SetOptions(c.urlParams_, opts...)
  9660. res, err := c.doRequest("json")
  9661. if res != nil && res.StatusCode == http.StatusNotModified {
  9662. if res.Body != nil {
  9663. res.Body.Close()
  9664. }
  9665. return nil, &googleapi.Error{
  9666. Code: res.StatusCode,
  9667. Header: res.Header,
  9668. }
  9669. }
  9670. if err != nil {
  9671. return nil, err
  9672. }
  9673. defer googleapi.CloseBody(res)
  9674. if err := googleapi.CheckResponse(res); err != nil {
  9675. return nil, err
  9676. }
  9677. ret := &GoogleProtobufEmpty{
  9678. ServerResponse: googleapi.ServerResponse{
  9679. Header: res.Header,
  9680. HTTPStatusCode: res.StatusCode,
  9681. },
  9682. }
  9683. target := &ret
  9684. if err := gensupport.DecodeResponse(target, res); err != nil {
  9685. return nil, err
  9686. }
  9687. return ret, nil
  9688. // {
  9689. // "description": "Deletes a DeidentifyTemplate.\nSee https://cloud.google.com/dlp/docs/creating-templates-deid to learn\nmore.",
  9690. // "flatPath": "v2/projects/{projectsId}/deidentifyTemplates/{deidentifyTemplatesId}",
  9691. // "httpMethod": "DELETE",
  9692. // "id": "dlp.projects.deidentifyTemplates.delete",
  9693. // "parameterOrder": [
  9694. // "name"
  9695. // ],
  9696. // "parameters": {
  9697. // "name": {
  9698. // "description": "Resource name of the organization and deidentify template to be deleted,\nfor example `organizations/433245324/deidentifyTemplates/432452342` or\nprojects/project-id/deidentifyTemplates/432452342.",
  9699. // "location": "path",
  9700. // "pattern": "^projects/[^/]+/deidentifyTemplates/[^/]+$",
  9701. // "required": true,
  9702. // "type": "string"
  9703. // }
  9704. // },
  9705. // "path": "v2/{+name}",
  9706. // "response": {
  9707. // "$ref": "GoogleProtobufEmpty"
  9708. // },
  9709. // "scopes": [
  9710. // "https://www.googleapis.com/auth/cloud-platform"
  9711. // ]
  9712. // }
  9713. }
  9714. // method id "dlp.projects.deidentifyTemplates.get":
  9715. type ProjectsDeidentifyTemplatesGetCall struct {
  9716. s *Service
  9717. name string
  9718. urlParams_ gensupport.URLParams
  9719. ifNoneMatch_ string
  9720. ctx_ context.Context
  9721. header_ http.Header
  9722. }
  9723. // Get: Gets a DeidentifyTemplate.
  9724. // See https://cloud.google.com/dlp/docs/creating-templates-deid to
  9725. // learn
  9726. // more.
  9727. func (r *ProjectsDeidentifyTemplatesService) Get(name string) *ProjectsDeidentifyTemplatesGetCall {
  9728. c := &ProjectsDeidentifyTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9729. c.name = name
  9730. return c
  9731. }
  9732. // Fields allows partial responses to be retrieved. See
  9733. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9734. // for more information.
  9735. func (c *ProjectsDeidentifyTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsDeidentifyTemplatesGetCall {
  9736. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9737. return c
  9738. }
  9739. // IfNoneMatch sets the optional parameter which makes the operation
  9740. // fail if the object's ETag matches the given value. This is useful for
  9741. // getting updates only after the object has changed since the last
  9742. // request. Use googleapi.IsNotModified to check whether the response
  9743. // error from Do is the result of In-None-Match.
  9744. func (c *ProjectsDeidentifyTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsDeidentifyTemplatesGetCall {
  9745. c.ifNoneMatch_ = entityTag
  9746. return c
  9747. }
  9748. // Context sets the context to be used in this call's Do method. Any
  9749. // pending HTTP request will be aborted if the provided context is
  9750. // canceled.
  9751. func (c *ProjectsDeidentifyTemplatesGetCall) Context(ctx context.Context) *ProjectsDeidentifyTemplatesGetCall {
  9752. c.ctx_ = ctx
  9753. return c
  9754. }
  9755. // Header returns an http.Header that can be modified by the caller to
  9756. // add HTTP headers to the request.
  9757. func (c *ProjectsDeidentifyTemplatesGetCall) Header() http.Header {
  9758. if c.header_ == nil {
  9759. c.header_ = make(http.Header)
  9760. }
  9761. return c.header_
  9762. }
  9763. func (c *ProjectsDeidentifyTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  9764. reqHeaders := make(http.Header)
  9765. for k, v := range c.header_ {
  9766. reqHeaders[k] = v
  9767. }
  9768. reqHeaders.Set("User-Agent", c.s.userAgent())
  9769. if c.ifNoneMatch_ != "" {
  9770. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9771. }
  9772. var body io.Reader = nil
  9773. c.urlParams_.Set("alt", alt)
  9774. c.urlParams_.Set("prettyPrint", "false")
  9775. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  9776. urls += "?" + c.urlParams_.Encode()
  9777. req, err := http.NewRequest("GET", urls, body)
  9778. if err != nil {
  9779. return nil, err
  9780. }
  9781. req.Header = reqHeaders
  9782. googleapi.Expand(req.URL, map[string]string{
  9783. "name": c.name,
  9784. })
  9785. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9786. }
  9787. // Do executes the "dlp.projects.deidentifyTemplates.get" call.
  9788. // Exactly one of *GooglePrivacyDlpV2DeidentifyTemplate or error will be
  9789. // non-nil. Any non-2xx status code is an error. Response headers are in
  9790. // either *GooglePrivacyDlpV2DeidentifyTemplate.ServerResponse.Header or
  9791. // (if a response was returned at all) in
  9792. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9793. // whether the returned error was because http.StatusNotModified was
  9794. // returned.
  9795. func (c *ProjectsDeidentifyTemplatesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyTemplate, error) {
  9796. gensupport.SetOptions(c.urlParams_, opts...)
  9797. res, err := c.doRequest("json")
  9798. if res != nil && res.StatusCode == http.StatusNotModified {
  9799. if res.Body != nil {
  9800. res.Body.Close()
  9801. }
  9802. return nil, &googleapi.Error{
  9803. Code: res.StatusCode,
  9804. Header: res.Header,
  9805. }
  9806. }
  9807. if err != nil {
  9808. return nil, err
  9809. }
  9810. defer googleapi.CloseBody(res)
  9811. if err := googleapi.CheckResponse(res); err != nil {
  9812. return nil, err
  9813. }
  9814. ret := &GooglePrivacyDlpV2DeidentifyTemplate{
  9815. ServerResponse: googleapi.ServerResponse{
  9816. Header: res.Header,
  9817. HTTPStatusCode: res.StatusCode,
  9818. },
  9819. }
  9820. target := &ret
  9821. if err := gensupport.DecodeResponse(target, res); err != nil {
  9822. return nil, err
  9823. }
  9824. return ret, nil
  9825. // {
  9826. // "description": "Gets a DeidentifyTemplate.\nSee https://cloud.google.com/dlp/docs/creating-templates-deid to learn\nmore.",
  9827. // "flatPath": "v2/projects/{projectsId}/deidentifyTemplates/{deidentifyTemplatesId}",
  9828. // "httpMethod": "GET",
  9829. // "id": "dlp.projects.deidentifyTemplates.get",
  9830. // "parameterOrder": [
  9831. // "name"
  9832. // ],
  9833. // "parameters": {
  9834. // "name": {
  9835. // "description": "Resource name of the organization and deidentify template to be read, for\nexample `organizations/433245324/deidentifyTemplates/432452342` or\nprojects/project-id/deidentifyTemplates/432452342.",
  9836. // "location": "path",
  9837. // "pattern": "^projects/[^/]+/deidentifyTemplates/[^/]+$",
  9838. // "required": true,
  9839. // "type": "string"
  9840. // }
  9841. // },
  9842. // "path": "v2/{+name}",
  9843. // "response": {
  9844. // "$ref": "GooglePrivacyDlpV2DeidentifyTemplate"
  9845. // },
  9846. // "scopes": [
  9847. // "https://www.googleapis.com/auth/cloud-platform"
  9848. // ]
  9849. // }
  9850. }
  9851. // method id "dlp.projects.deidentifyTemplates.list":
  9852. type ProjectsDeidentifyTemplatesListCall struct {
  9853. s *Service
  9854. parent string
  9855. urlParams_ gensupport.URLParams
  9856. ifNoneMatch_ string
  9857. ctx_ context.Context
  9858. header_ http.Header
  9859. }
  9860. // List: Lists DeidentifyTemplates.
  9861. // See https://cloud.google.com/dlp/docs/creating-templates-deid to
  9862. // learn
  9863. // more.
  9864. func (r *ProjectsDeidentifyTemplatesService) List(parent string) *ProjectsDeidentifyTemplatesListCall {
  9865. c := &ProjectsDeidentifyTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9866. c.parent = parent
  9867. return c
  9868. }
  9869. // OrderBy sets the optional parameter "orderBy": Optional comma
  9870. // separated list of fields to order by,
  9871. // followed by `asc` or `desc` postfix. This list is
  9872. // case-insensitive,
  9873. // default sorting order is ascending, redundant space characters
  9874. // are
  9875. // insignificant.
  9876. //
  9877. // Example: `name asc,update_time, create_time desc`
  9878. //
  9879. // Supported fields are:
  9880. //
  9881. // - `create_time`: corresponds to time the template was created.
  9882. // - `update_time`: corresponds to time the template was last updated.
  9883. // - `name`: corresponds to template's name.
  9884. // - `display_name`: corresponds to template's display name.
  9885. func (c *ProjectsDeidentifyTemplatesListCall) OrderBy(orderBy string) *ProjectsDeidentifyTemplatesListCall {
  9886. c.urlParams_.Set("orderBy", orderBy)
  9887. return c
  9888. }
  9889. // PageSize sets the optional parameter "pageSize": Optional size of the
  9890. // page, can be limited by server. If zero server returns
  9891. // a page of max size 100.
  9892. func (c *ProjectsDeidentifyTemplatesListCall) PageSize(pageSize int64) *ProjectsDeidentifyTemplatesListCall {
  9893. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  9894. return c
  9895. }
  9896. // PageToken sets the optional parameter "pageToken": Optional page
  9897. // token to continue retrieval. Comes from previous call
  9898. // to `ListDeidentifyTemplates`.
  9899. func (c *ProjectsDeidentifyTemplatesListCall) PageToken(pageToken string) *ProjectsDeidentifyTemplatesListCall {
  9900. c.urlParams_.Set("pageToken", pageToken)
  9901. return c
  9902. }
  9903. // Fields allows partial responses to be retrieved. See
  9904. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9905. // for more information.
  9906. func (c *ProjectsDeidentifyTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsDeidentifyTemplatesListCall {
  9907. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9908. return c
  9909. }
  9910. // IfNoneMatch sets the optional parameter which makes the operation
  9911. // fail if the object's ETag matches the given value. This is useful for
  9912. // getting updates only after the object has changed since the last
  9913. // request. Use googleapi.IsNotModified to check whether the response
  9914. // error from Do is the result of In-None-Match.
  9915. func (c *ProjectsDeidentifyTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsDeidentifyTemplatesListCall {
  9916. c.ifNoneMatch_ = entityTag
  9917. return c
  9918. }
  9919. // Context sets the context to be used in this call's Do method. Any
  9920. // pending HTTP request will be aborted if the provided context is
  9921. // canceled.
  9922. func (c *ProjectsDeidentifyTemplatesListCall) Context(ctx context.Context) *ProjectsDeidentifyTemplatesListCall {
  9923. c.ctx_ = ctx
  9924. return c
  9925. }
  9926. // Header returns an http.Header that can be modified by the caller to
  9927. // add HTTP headers to the request.
  9928. func (c *ProjectsDeidentifyTemplatesListCall) Header() http.Header {
  9929. if c.header_ == nil {
  9930. c.header_ = make(http.Header)
  9931. }
  9932. return c.header_
  9933. }
  9934. func (c *ProjectsDeidentifyTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  9935. reqHeaders := make(http.Header)
  9936. for k, v := range c.header_ {
  9937. reqHeaders[k] = v
  9938. }
  9939. reqHeaders.Set("User-Agent", c.s.userAgent())
  9940. if c.ifNoneMatch_ != "" {
  9941. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9942. }
  9943. var body io.Reader = nil
  9944. c.urlParams_.Set("alt", alt)
  9945. c.urlParams_.Set("prettyPrint", "false")
  9946. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/deidentifyTemplates")
  9947. urls += "?" + c.urlParams_.Encode()
  9948. req, err := http.NewRequest("GET", urls, body)
  9949. if err != nil {
  9950. return nil, err
  9951. }
  9952. req.Header = reqHeaders
  9953. googleapi.Expand(req.URL, map[string]string{
  9954. "parent": c.parent,
  9955. })
  9956. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9957. }
  9958. // Do executes the "dlp.projects.deidentifyTemplates.list" call.
  9959. // Exactly one of *GooglePrivacyDlpV2ListDeidentifyTemplatesResponse or
  9960. // error will be non-nil. Any non-2xx status code is an error. Response
  9961. // headers are in either
  9962. // *GooglePrivacyDlpV2ListDeidentifyTemplatesResponse.ServerResponse.Head
  9963. // er or (if a response was returned at all) in
  9964. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9965. // whether the returned error was because http.StatusNotModified was
  9966. // returned.
  9967. func (c *ProjectsDeidentifyTemplatesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListDeidentifyTemplatesResponse, error) {
  9968. gensupport.SetOptions(c.urlParams_, opts...)
  9969. res, err := c.doRequest("json")
  9970. if res != nil && res.StatusCode == http.StatusNotModified {
  9971. if res.Body != nil {
  9972. res.Body.Close()
  9973. }
  9974. return nil, &googleapi.Error{
  9975. Code: res.StatusCode,
  9976. Header: res.Header,
  9977. }
  9978. }
  9979. if err != nil {
  9980. return nil, err
  9981. }
  9982. defer googleapi.CloseBody(res)
  9983. if err := googleapi.CheckResponse(res); err != nil {
  9984. return nil, err
  9985. }
  9986. ret := &GooglePrivacyDlpV2ListDeidentifyTemplatesResponse{
  9987. ServerResponse: googleapi.ServerResponse{
  9988. Header: res.Header,
  9989. HTTPStatusCode: res.StatusCode,
  9990. },
  9991. }
  9992. target := &ret
  9993. if err := gensupport.DecodeResponse(target, res); err != nil {
  9994. return nil, err
  9995. }
  9996. return ret, nil
  9997. // {
  9998. // "description": "Lists DeidentifyTemplates.\nSee https://cloud.google.com/dlp/docs/creating-templates-deid to learn\nmore.",
  9999. // "flatPath": "v2/projects/{projectsId}/deidentifyTemplates",
  10000. // "httpMethod": "GET",
  10001. // "id": "dlp.projects.deidentifyTemplates.list",
  10002. // "parameterOrder": [
  10003. // "parent"
  10004. // ],
  10005. // "parameters": {
  10006. // "orderBy": {
  10007. // "description": "Optional comma separated list of fields to order by,\nfollowed by `asc` or `desc` postfix. This list is case-insensitive,\ndefault sorting order is ascending, redundant space characters are\ninsignificant.\n\nExample: `name asc,update_time, create_time desc`\n\nSupported fields are:\n\n- `create_time`: corresponds to time the template was created.\n- `update_time`: corresponds to time the template was last updated.\n- `name`: corresponds to template's name.\n- `display_name`: corresponds to template's display name.",
  10008. // "location": "query",
  10009. // "type": "string"
  10010. // },
  10011. // "pageSize": {
  10012. // "description": "Optional size of the page, can be limited by server. If zero server returns\na page of max size 100.",
  10013. // "format": "int32",
  10014. // "location": "query",
  10015. // "type": "integer"
  10016. // },
  10017. // "pageToken": {
  10018. // "description": "Optional page token to continue retrieval. Comes from previous call\nto `ListDeidentifyTemplates`.",
  10019. // "location": "query",
  10020. // "type": "string"
  10021. // },
  10022. // "parent": {
  10023. // "description": "The parent resource name, for example projects/my-project-id or\norganizations/my-org-id.",
  10024. // "location": "path",
  10025. // "pattern": "^projects/[^/]+$",
  10026. // "required": true,
  10027. // "type": "string"
  10028. // }
  10029. // },
  10030. // "path": "v2/{+parent}/deidentifyTemplates",
  10031. // "response": {
  10032. // "$ref": "GooglePrivacyDlpV2ListDeidentifyTemplatesResponse"
  10033. // },
  10034. // "scopes": [
  10035. // "https://www.googleapis.com/auth/cloud-platform"
  10036. // ]
  10037. // }
  10038. }
  10039. // Pages invokes f for each page of results.
  10040. // A non-nil error returned from f will halt the iteration.
  10041. // The provided context supersedes any context provided to the Context method.
  10042. func (c *ProjectsDeidentifyTemplatesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListDeidentifyTemplatesResponse) error) error {
  10043. c.ctx_ = ctx
  10044. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10045. for {
  10046. x, err := c.Do()
  10047. if err != nil {
  10048. return err
  10049. }
  10050. if err := f(x); err != nil {
  10051. return err
  10052. }
  10053. if x.NextPageToken == "" {
  10054. return nil
  10055. }
  10056. c.PageToken(x.NextPageToken)
  10057. }
  10058. }
  10059. // method id "dlp.projects.deidentifyTemplates.patch":
  10060. type ProjectsDeidentifyTemplatesPatchCall struct {
  10061. s *Service
  10062. name string
  10063. googleprivacydlpv2updatedeidentifytemplaterequest *GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest
  10064. urlParams_ gensupport.URLParams
  10065. ctx_ context.Context
  10066. header_ http.Header
  10067. }
  10068. // Patch: Updates the DeidentifyTemplate.
  10069. // See https://cloud.google.com/dlp/docs/creating-templates-deid to
  10070. // learn
  10071. // more.
  10072. func (r *ProjectsDeidentifyTemplatesService) Patch(name string, googleprivacydlpv2updatedeidentifytemplaterequest *GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest) *ProjectsDeidentifyTemplatesPatchCall {
  10073. c := &ProjectsDeidentifyTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10074. c.name = name
  10075. c.googleprivacydlpv2updatedeidentifytemplaterequest = googleprivacydlpv2updatedeidentifytemplaterequest
  10076. return c
  10077. }
  10078. // Fields allows partial responses to be retrieved. See
  10079. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10080. // for more information.
  10081. func (c *ProjectsDeidentifyTemplatesPatchCall) Fields(s ...googleapi.Field) *ProjectsDeidentifyTemplatesPatchCall {
  10082. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10083. return c
  10084. }
  10085. // Context sets the context to be used in this call's Do method. Any
  10086. // pending HTTP request will be aborted if the provided context is
  10087. // canceled.
  10088. func (c *ProjectsDeidentifyTemplatesPatchCall) Context(ctx context.Context) *ProjectsDeidentifyTemplatesPatchCall {
  10089. c.ctx_ = ctx
  10090. return c
  10091. }
  10092. // Header returns an http.Header that can be modified by the caller to
  10093. // add HTTP headers to the request.
  10094. func (c *ProjectsDeidentifyTemplatesPatchCall) Header() http.Header {
  10095. if c.header_ == nil {
  10096. c.header_ = make(http.Header)
  10097. }
  10098. return c.header_
  10099. }
  10100. func (c *ProjectsDeidentifyTemplatesPatchCall) doRequest(alt string) (*http.Response, error) {
  10101. reqHeaders := make(http.Header)
  10102. for k, v := range c.header_ {
  10103. reqHeaders[k] = v
  10104. }
  10105. reqHeaders.Set("User-Agent", c.s.userAgent())
  10106. var body io.Reader = nil
  10107. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatedeidentifytemplaterequest)
  10108. if err != nil {
  10109. return nil, err
  10110. }
  10111. reqHeaders.Set("Content-Type", "application/json")
  10112. c.urlParams_.Set("alt", alt)
  10113. c.urlParams_.Set("prettyPrint", "false")
  10114. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  10115. urls += "?" + c.urlParams_.Encode()
  10116. req, err := http.NewRequest("PATCH", urls, body)
  10117. if err != nil {
  10118. return nil, err
  10119. }
  10120. req.Header = reqHeaders
  10121. googleapi.Expand(req.URL, map[string]string{
  10122. "name": c.name,
  10123. })
  10124. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10125. }
  10126. // Do executes the "dlp.projects.deidentifyTemplates.patch" call.
  10127. // Exactly one of *GooglePrivacyDlpV2DeidentifyTemplate or error will be
  10128. // non-nil. Any non-2xx status code is an error. Response headers are in
  10129. // either *GooglePrivacyDlpV2DeidentifyTemplate.ServerResponse.Header or
  10130. // (if a response was returned at all) in
  10131. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10132. // whether the returned error was because http.StatusNotModified was
  10133. // returned.
  10134. func (c *ProjectsDeidentifyTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DeidentifyTemplate, error) {
  10135. gensupport.SetOptions(c.urlParams_, opts...)
  10136. res, err := c.doRequest("json")
  10137. if res != nil && res.StatusCode == http.StatusNotModified {
  10138. if res.Body != nil {
  10139. res.Body.Close()
  10140. }
  10141. return nil, &googleapi.Error{
  10142. Code: res.StatusCode,
  10143. Header: res.Header,
  10144. }
  10145. }
  10146. if err != nil {
  10147. return nil, err
  10148. }
  10149. defer googleapi.CloseBody(res)
  10150. if err := googleapi.CheckResponse(res); err != nil {
  10151. return nil, err
  10152. }
  10153. ret := &GooglePrivacyDlpV2DeidentifyTemplate{
  10154. ServerResponse: googleapi.ServerResponse{
  10155. Header: res.Header,
  10156. HTTPStatusCode: res.StatusCode,
  10157. },
  10158. }
  10159. target := &ret
  10160. if err := gensupport.DecodeResponse(target, res); err != nil {
  10161. return nil, err
  10162. }
  10163. return ret, nil
  10164. // {
  10165. // "description": "Updates the DeidentifyTemplate.\nSee https://cloud.google.com/dlp/docs/creating-templates-deid to learn\nmore.",
  10166. // "flatPath": "v2/projects/{projectsId}/deidentifyTemplates/{deidentifyTemplatesId}",
  10167. // "httpMethod": "PATCH",
  10168. // "id": "dlp.projects.deidentifyTemplates.patch",
  10169. // "parameterOrder": [
  10170. // "name"
  10171. // ],
  10172. // "parameters": {
  10173. // "name": {
  10174. // "description": "Resource name of organization and deidentify template to be updated, for\nexample `organizations/433245324/deidentifyTemplates/432452342` or\nprojects/project-id/deidentifyTemplates/432452342.",
  10175. // "location": "path",
  10176. // "pattern": "^projects/[^/]+/deidentifyTemplates/[^/]+$",
  10177. // "required": true,
  10178. // "type": "string"
  10179. // }
  10180. // },
  10181. // "path": "v2/{+name}",
  10182. // "request": {
  10183. // "$ref": "GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest"
  10184. // },
  10185. // "response": {
  10186. // "$ref": "GooglePrivacyDlpV2DeidentifyTemplate"
  10187. // },
  10188. // "scopes": [
  10189. // "https://www.googleapis.com/auth/cloud-platform"
  10190. // ]
  10191. // }
  10192. }
  10193. // method id "dlp.projects.dlpJobs.cancel":
  10194. type ProjectsDlpJobsCancelCall struct {
  10195. s *Service
  10196. name string
  10197. googleprivacydlpv2canceldlpjobrequest *GooglePrivacyDlpV2CancelDlpJobRequest
  10198. urlParams_ gensupport.URLParams
  10199. ctx_ context.Context
  10200. header_ http.Header
  10201. }
  10202. // Cancel: Starts asynchronous cancellation on a long-running DlpJob.
  10203. // The server
  10204. // makes a best effort to cancel the DlpJob, but success is
  10205. // not
  10206. // guaranteed.
  10207. // See https://cloud.google.com/dlp/docs/inspecting-storage
  10208. // and
  10209. // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn
  10210. // more.
  10211. func (r *ProjectsDlpJobsService) Cancel(name string, googleprivacydlpv2canceldlpjobrequest *GooglePrivacyDlpV2CancelDlpJobRequest) *ProjectsDlpJobsCancelCall {
  10212. c := &ProjectsDlpJobsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10213. c.name = name
  10214. c.googleprivacydlpv2canceldlpjobrequest = googleprivacydlpv2canceldlpjobrequest
  10215. return c
  10216. }
  10217. // Fields allows partial responses to be retrieved. See
  10218. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10219. // for more information.
  10220. func (c *ProjectsDlpJobsCancelCall) Fields(s ...googleapi.Field) *ProjectsDlpJobsCancelCall {
  10221. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10222. return c
  10223. }
  10224. // Context sets the context to be used in this call's Do method. Any
  10225. // pending HTTP request will be aborted if the provided context is
  10226. // canceled.
  10227. func (c *ProjectsDlpJobsCancelCall) Context(ctx context.Context) *ProjectsDlpJobsCancelCall {
  10228. c.ctx_ = ctx
  10229. return c
  10230. }
  10231. // Header returns an http.Header that can be modified by the caller to
  10232. // add HTTP headers to the request.
  10233. func (c *ProjectsDlpJobsCancelCall) Header() http.Header {
  10234. if c.header_ == nil {
  10235. c.header_ = make(http.Header)
  10236. }
  10237. return c.header_
  10238. }
  10239. func (c *ProjectsDlpJobsCancelCall) doRequest(alt string) (*http.Response, error) {
  10240. reqHeaders := make(http.Header)
  10241. for k, v := range c.header_ {
  10242. reqHeaders[k] = v
  10243. }
  10244. reqHeaders.Set("User-Agent", c.s.userAgent())
  10245. var body io.Reader = nil
  10246. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2canceldlpjobrequest)
  10247. if err != nil {
  10248. return nil, err
  10249. }
  10250. reqHeaders.Set("Content-Type", "application/json")
  10251. c.urlParams_.Set("alt", alt)
  10252. c.urlParams_.Set("prettyPrint", "false")
  10253. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel")
  10254. urls += "?" + c.urlParams_.Encode()
  10255. req, err := http.NewRequest("POST", urls, body)
  10256. if err != nil {
  10257. return nil, err
  10258. }
  10259. req.Header = reqHeaders
  10260. googleapi.Expand(req.URL, map[string]string{
  10261. "name": c.name,
  10262. })
  10263. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10264. }
  10265. // Do executes the "dlp.projects.dlpJobs.cancel" call.
  10266. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  10267. // non-2xx status code is an error. Response headers are in either
  10268. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  10269. // returned at all) in error.(*googleapi.Error).Header. Use
  10270. // googleapi.IsNotModified to check whether the returned error was
  10271. // because http.StatusNotModified was returned.
  10272. func (c *ProjectsDlpJobsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  10273. gensupport.SetOptions(c.urlParams_, opts...)
  10274. res, err := c.doRequest("json")
  10275. if res != nil && res.StatusCode == http.StatusNotModified {
  10276. if res.Body != nil {
  10277. res.Body.Close()
  10278. }
  10279. return nil, &googleapi.Error{
  10280. Code: res.StatusCode,
  10281. Header: res.Header,
  10282. }
  10283. }
  10284. if err != nil {
  10285. return nil, err
  10286. }
  10287. defer googleapi.CloseBody(res)
  10288. if err := googleapi.CheckResponse(res); err != nil {
  10289. return nil, err
  10290. }
  10291. ret := &GoogleProtobufEmpty{
  10292. ServerResponse: googleapi.ServerResponse{
  10293. Header: res.Header,
  10294. HTTPStatusCode: res.StatusCode,
  10295. },
  10296. }
  10297. target := &ret
  10298. if err := gensupport.DecodeResponse(target, res); err != nil {
  10299. return nil, err
  10300. }
  10301. return ret, nil
  10302. // {
  10303. // "description": "Starts asynchronous cancellation on a long-running DlpJob. The server\nmakes a best effort to cancel the DlpJob, but success is not\nguaranteed.\nSee https://cloud.google.com/dlp/docs/inspecting-storage and\nhttps://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.",
  10304. // "flatPath": "v2/projects/{projectsId}/dlpJobs/{dlpJobsId}:cancel",
  10305. // "httpMethod": "POST",
  10306. // "id": "dlp.projects.dlpJobs.cancel",
  10307. // "parameterOrder": [
  10308. // "name"
  10309. // ],
  10310. // "parameters": {
  10311. // "name": {
  10312. // "description": "The name of the DlpJob resource to be cancelled.",
  10313. // "location": "path",
  10314. // "pattern": "^projects/[^/]+/dlpJobs/[^/]+$",
  10315. // "required": true,
  10316. // "type": "string"
  10317. // }
  10318. // },
  10319. // "path": "v2/{+name}:cancel",
  10320. // "request": {
  10321. // "$ref": "GooglePrivacyDlpV2CancelDlpJobRequest"
  10322. // },
  10323. // "response": {
  10324. // "$ref": "GoogleProtobufEmpty"
  10325. // },
  10326. // "scopes": [
  10327. // "https://www.googleapis.com/auth/cloud-platform"
  10328. // ]
  10329. // }
  10330. }
  10331. // method id "dlp.projects.dlpJobs.create":
  10332. type ProjectsDlpJobsCreateCall struct {
  10333. s *Service
  10334. parent string
  10335. googleprivacydlpv2createdlpjobrequest *GooglePrivacyDlpV2CreateDlpJobRequest
  10336. urlParams_ gensupport.URLParams
  10337. ctx_ context.Context
  10338. header_ http.Header
  10339. }
  10340. // Create: Creates a new job to inspect storage or calculate risk
  10341. // metrics.
  10342. // See https://cloud.google.com/dlp/docs/inspecting-storage
  10343. // and
  10344. // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn
  10345. // more.
  10346. //
  10347. // When no InfoTypes or CustomInfoTypes are specified in inspect jobs,
  10348. // the
  10349. // system will automatically choose what detectors to run. By default
  10350. // this may
  10351. // be all types, but may change over time as detectors are updated.
  10352. func (r *ProjectsDlpJobsService) Create(parent string, googleprivacydlpv2createdlpjobrequest *GooglePrivacyDlpV2CreateDlpJobRequest) *ProjectsDlpJobsCreateCall {
  10353. c := &ProjectsDlpJobsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10354. c.parent = parent
  10355. c.googleprivacydlpv2createdlpjobrequest = googleprivacydlpv2createdlpjobrequest
  10356. return c
  10357. }
  10358. // Fields allows partial responses to be retrieved. See
  10359. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10360. // for more information.
  10361. func (c *ProjectsDlpJobsCreateCall) Fields(s ...googleapi.Field) *ProjectsDlpJobsCreateCall {
  10362. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10363. return c
  10364. }
  10365. // Context sets the context to be used in this call's Do method. Any
  10366. // pending HTTP request will be aborted if the provided context is
  10367. // canceled.
  10368. func (c *ProjectsDlpJobsCreateCall) Context(ctx context.Context) *ProjectsDlpJobsCreateCall {
  10369. c.ctx_ = ctx
  10370. return c
  10371. }
  10372. // Header returns an http.Header that can be modified by the caller to
  10373. // add HTTP headers to the request.
  10374. func (c *ProjectsDlpJobsCreateCall) Header() http.Header {
  10375. if c.header_ == nil {
  10376. c.header_ = make(http.Header)
  10377. }
  10378. return c.header_
  10379. }
  10380. func (c *ProjectsDlpJobsCreateCall) doRequest(alt string) (*http.Response, error) {
  10381. reqHeaders := make(http.Header)
  10382. for k, v := range c.header_ {
  10383. reqHeaders[k] = v
  10384. }
  10385. reqHeaders.Set("User-Agent", c.s.userAgent())
  10386. var body io.Reader = nil
  10387. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createdlpjobrequest)
  10388. if err != nil {
  10389. return nil, err
  10390. }
  10391. reqHeaders.Set("Content-Type", "application/json")
  10392. c.urlParams_.Set("alt", alt)
  10393. c.urlParams_.Set("prettyPrint", "false")
  10394. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/dlpJobs")
  10395. urls += "?" + c.urlParams_.Encode()
  10396. req, err := http.NewRequest("POST", urls, body)
  10397. if err != nil {
  10398. return nil, err
  10399. }
  10400. req.Header = reqHeaders
  10401. googleapi.Expand(req.URL, map[string]string{
  10402. "parent": c.parent,
  10403. })
  10404. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10405. }
  10406. // Do executes the "dlp.projects.dlpJobs.create" call.
  10407. // Exactly one of *GooglePrivacyDlpV2DlpJob or error will be non-nil.
  10408. // Any non-2xx status code is an error. Response headers are in either
  10409. // *GooglePrivacyDlpV2DlpJob.ServerResponse.Header or (if a response was
  10410. // returned at all) in error.(*googleapi.Error).Header. Use
  10411. // googleapi.IsNotModified to check whether the returned error was
  10412. // because http.StatusNotModified was returned.
  10413. func (c *ProjectsDlpJobsCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DlpJob, error) {
  10414. gensupport.SetOptions(c.urlParams_, opts...)
  10415. res, err := c.doRequest("json")
  10416. if res != nil && res.StatusCode == http.StatusNotModified {
  10417. if res.Body != nil {
  10418. res.Body.Close()
  10419. }
  10420. return nil, &googleapi.Error{
  10421. Code: res.StatusCode,
  10422. Header: res.Header,
  10423. }
  10424. }
  10425. if err != nil {
  10426. return nil, err
  10427. }
  10428. defer googleapi.CloseBody(res)
  10429. if err := googleapi.CheckResponse(res); err != nil {
  10430. return nil, err
  10431. }
  10432. ret := &GooglePrivacyDlpV2DlpJob{
  10433. ServerResponse: googleapi.ServerResponse{
  10434. Header: res.Header,
  10435. HTTPStatusCode: res.StatusCode,
  10436. },
  10437. }
  10438. target := &ret
  10439. if err := gensupport.DecodeResponse(target, res); err != nil {
  10440. return nil, err
  10441. }
  10442. return ret, nil
  10443. // {
  10444. // "description": "Creates a new job to inspect storage or calculate risk metrics.\nSee https://cloud.google.com/dlp/docs/inspecting-storage and\nhttps://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.\n\nWhen no InfoTypes or CustomInfoTypes are specified in inspect jobs, the\nsystem will automatically choose what detectors to run. By default this may\nbe all types, but may change over time as detectors are updated.",
  10445. // "flatPath": "v2/projects/{projectsId}/dlpJobs",
  10446. // "httpMethod": "POST",
  10447. // "id": "dlp.projects.dlpJobs.create",
  10448. // "parameterOrder": [
  10449. // "parent"
  10450. // ],
  10451. // "parameters": {
  10452. // "parent": {
  10453. // "description": "The parent resource name, for example projects/my-project-id.",
  10454. // "location": "path",
  10455. // "pattern": "^projects/[^/]+$",
  10456. // "required": true,
  10457. // "type": "string"
  10458. // }
  10459. // },
  10460. // "path": "v2/{+parent}/dlpJobs",
  10461. // "request": {
  10462. // "$ref": "GooglePrivacyDlpV2CreateDlpJobRequest"
  10463. // },
  10464. // "response": {
  10465. // "$ref": "GooglePrivacyDlpV2DlpJob"
  10466. // },
  10467. // "scopes": [
  10468. // "https://www.googleapis.com/auth/cloud-platform"
  10469. // ]
  10470. // }
  10471. }
  10472. // method id "dlp.projects.dlpJobs.delete":
  10473. type ProjectsDlpJobsDeleteCall struct {
  10474. s *Service
  10475. name string
  10476. urlParams_ gensupport.URLParams
  10477. ctx_ context.Context
  10478. header_ http.Header
  10479. }
  10480. // Delete: Deletes a long-running DlpJob. This method indicates that the
  10481. // client is
  10482. // no longer interested in the DlpJob result. The job will be cancelled
  10483. // if
  10484. // possible.
  10485. // See https://cloud.google.com/dlp/docs/inspecting-storage
  10486. // and
  10487. // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn
  10488. // more.
  10489. func (r *ProjectsDlpJobsService) Delete(name string) *ProjectsDlpJobsDeleteCall {
  10490. c := &ProjectsDlpJobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10491. c.name = name
  10492. return c
  10493. }
  10494. // Fields allows partial responses to be retrieved. See
  10495. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10496. // for more information.
  10497. func (c *ProjectsDlpJobsDeleteCall) Fields(s ...googleapi.Field) *ProjectsDlpJobsDeleteCall {
  10498. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10499. return c
  10500. }
  10501. // Context sets the context to be used in this call's Do method. Any
  10502. // pending HTTP request will be aborted if the provided context is
  10503. // canceled.
  10504. func (c *ProjectsDlpJobsDeleteCall) Context(ctx context.Context) *ProjectsDlpJobsDeleteCall {
  10505. c.ctx_ = ctx
  10506. return c
  10507. }
  10508. // Header returns an http.Header that can be modified by the caller to
  10509. // add HTTP headers to the request.
  10510. func (c *ProjectsDlpJobsDeleteCall) Header() http.Header {
  10511. if c.header_ == nil {
  10512. c.header_ = make(http.Header)
  10513. }
  10514. return c.header_
  10515. }
  10516. func (c *ProjectsDlpJobsDeleteCall) doRequest(alt string) (*http.Response, error) {
  10517. reqHeaders := make(http.Header)
  10518. for k, v := range c.header_ {
  10519. reqHeaders[k] = v
  10520. }
  10521. reqHeaders.Set("User-Agent", c.s.userAgent())
  10522. var body io.Reader = nil
  10523. c.urlParams_.Set("alt", alt)
  10524. c.urlParams_.Set("prettyPrint", "false")
  10525. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  10526. urls += "?" + c.urlParams_.Encode()
  10527. req, err := http.NewRequest("DELETE", urls, body)
  10528. if err != nil {
  10529. return nil, err
  10530. }
  10531. req.Header = reqHeaders
  10532. googleapi.Expand(req.URL, map[string]string{
  10533. "name": c.name,
  10534. })
  10535. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10536. }
  10537. // Do executes the "dlp.projects.dlpJobs.delete" call.
  10538. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  10539. // non-2xx status code is an error. Response headers are in either
  10540. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  10541. // returned at all) in error.(*googleapi.Error).Header. Use
  10542. // googleapi.IsNotModified to check whether the returned error was
  10543. // because http.StatusNotModified was returned.
  10544. func (c *ProjectsDlpJobsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  10545. gensupport.SetOptions(c.urlParams_, opts...)
  10546. res, err := c.doRequest("json")
  10547. if res != nil && res.StatusCode == http.StatusNotModified {
  10548. if res.Body != nil {
  10549. res.Body.Close()
  10550. }
  10551. return nil, &googleapi.Error{
  10552. Code: res.StatusCode,
  10553. Header: res.Header,
  10554. }
  10555. }
  10556. if err != nil {
  10557. return nil, err
  10558. }
  10559. defer googleapi.CloseBody(res)
  10560. if err := googleapi.CheckResponse(res); err != nil {
  10561. return nil, err
  10562. }
  10563. ret := &GoogleProtobufEmpty{
  10564. ServerResponse: googleapi.ServerResponse{
  10565. Header: res.Header,
  10566. HTTPStatusCode: res.StatusCode,
  10567. },
  10568. }
  10569. target := &ret
  10570. if err := gensupport.DecodeResponse(target, res); err != nil {
  10571. return nil, err
  10572. }
  10573. return ret, nil
  10574. // {
  10575. // "description": "Deletes a long-running DlpJob. This method indicates that the client is\nno longer interested in the DlpJob result. The job will be cancelled if\npossible.\nSee https://cloud.google.com/dlp/docs/inspecting-storage and\nhttps://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.",
  10576. // "flatPath": "v2/projects/{projectsId}/dlpJobs/{dlpJobsId}",
  10577. // "httpMethod": "DELETE",
  10578. // "id": "dlp.projects.dlpJobs.delete",
  10579. // "parameterOrder": [
  10580. // "name"
  10581. // ],
  10582. // "parameters": {
  10583. // "name": {
  10584. // "description": "The name of the DlpJob resource to be deleted.",
  10585. // "location": "path",
  10586. // "pattern": "^projects/[^/]+/dlpJobs/[^/]+$",
  10587. // "required": true,
  10588. // "type": "string"
  10589. // }
  10590. // },
  10591. // "path": "v2/{+name}",
  10592. // "response": {
  10593. // "$ref": "GoogleProtobufEmpty"
  10594. // },
  10595. // "scopes": [
  10596. // "https://www.googleapis.com/auth/cloud-platform"
  10597. // ]
  10598. // }
  10599. }
  10600. // method id "dlp.projects.dlpJobs.get":
  10601. type ProjectsDlpJobsGetCall struct {
  10602. s *Service
  10603. name string
  10604. urlParams_ gensupport.URLParams
  10605. ifNoneMatch_ string
  10606. ctx_ context.Context
  10607. header_ http.Header
  10608. }
  10609. // Get: Gets the latest state of a long-running DlpJob.
  10610. // See https://cloud.google.com/dlp/docs/inspecting-storage
  10611. // and
  10612. // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn
  10613. // more.
  10614. func (r *ProjectsDlpJobsService) Get(name string) *ProjectsDlpJobsGetCall {
  10615. c := &ProjectsDlpJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10616. c.name = name
  10617. return c
  10618. }
  10619. // Fields allows partial responses to be retrieved. See
  10620. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10621. // for more information.
  10622. func (c *ProjectsDlpJobsGetCall) Fields(s ...googleapi.Field) *ProjectsDlpJobsGetCall {
  10623. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10624. return c
  10625. }
  10626. // IfNoneMatch sets the optional parameter which makes the operation
  10627. // fail if the object's ETag matches the given value. This is useful for
  10628. // getting updates only after the object has changed since the last
  10629. // request. Use googleapi.IsNotModified to check whether the response
  10630. // error from Do is the result of In-None-Match.
  10631. func (c *ProjectsDlpJobsGetCall) IfNoneMatch(entityTag string) *ProjectsDlpJobsGetCall {
  10632. c.ifNoneMatch_ = entityTag
  10633. return c
  10634. }
  10635. // Context sets the context to be used in this call's Do method. Any
  10636. // pending HTTP request will be aborted if the provided context is
  10637. // canceled.
  10638. func (c *ProjectsDlpJobsGetCall) Context(ctx context.Context) *ProjectsDlpJobsGetCall {
  10639. c.ctx_ = ctx
  10640. return c
  10641. }
  10642. // Header returns an http.Header that can be modified by the caller to
  10643. // add HTTP headers to the request.
  10644. func (c *ProjectsDlpJobsGetCall) Header() http.Header {
  10645. if c.header_ == nil {
  10646. c.header_ = make(http.Header)
  10647. }
  10648. return c.header_
  10649. }
  10650. func (c *ProjectsDlpJobsGetCall) doRequest(alt string) (*http.Response, error) {
  10651. reqHeaders := make(http.Header)
  10652. for k, v := range c.header_ {
  10653. reqHeaders[k] = v
  10654. }
  10655. reqHeaders.Set("User-Agent", c.s.userAgent())
  10656. if c.ifNoneMatch_ != "" {
  10657. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10658. }
  10659. var body io.Reader = nil
  10660. c.urlParams_.Set("alt", alt)
  10661. c.urlParams_.Set("prettyPrint", "false")
  10662. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  10663. urls += "?" + c.urlParams_.Encode()
  10664. req, err := http.NewRequest("GET", urls, body)
  10665. if err != nil {
  10666. return nil, err
  10667. }
  10668. req.Header = reqHeaders
  10669. googleapi.Expand(req.URL, map[string]string{
  10670. "name": c.name,
  10671. })
  10672. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10673. }
  10674. // Do executes the "dlp.projects.dlpJobs.get" call.
  10675. // Exactly one of *GooglePrivacyDlpV2DlpJob or error will be non-nil.
  10676. // Any non-2xx status code is an error. Response headers are in either
  10677. // *GooglePrivacyDlpV2DlpJob.ServerResponse.Header or (if a response was
  10678. // returned at all) in error.(*googleapi.Error).Header. Use
  10679. // googleapi.IsNotModified to check whether the returned error was
  10680. // because http.StatusNotModified was returned.
  10681. func (c *ProjectsDlpJobsGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DlpJob, error) {
  10682. gensupport.SetOptions(c.urlParams_, opts...)
  10683. res, err := c.doRequest("json")
  10684. if res != nil && res.StatusCode == http.StatusNotModified {
  10685. if res.Body != nil {
  10686. res.Body.Close()
  10687. }
  10688. return nil, &googleapi.Error{
  10689. Code: res.StatusCode,
  10690. Header: res.Header,
  10691. }
  10692. }
  10693. if err != nil {
  10694. return nil, err
  10695. }
  10696. defer googleapi.CloseBody(res)
  10697. if err := googleapi.CheckResponse(res); err != nil {
  10698. return nil, err
  10699. }
  10700. ret := &GooglePrivacyDlpV2DlpJob{
  10701. ServerResponse: googleapi.ServerResponse{
  10702. Header: res.Header,
  10703. HTTPStatusCode: res.StatusCode,
  10704. },
  10705. }
  10706. target := &ret
  10707. if err := gensupport.DecodeResponse(target, res); err != nil {
  10708. return nil, err
  10709. }
  10710. return ret, nil
  10711. // {
  10712. // "description": "Gets the latest state of a long-running DlpJob.\nSee https://cloud.google.com/dlp/docs/inspecting-storage and\nhttps://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.",
  10713. // "flatPath": "v2/projects/{projectsId}/dlpJobs/{dlpJobsId}",
  10714. // "httpMethod": "GET",
  10715. // "id": "dlp.projects.dlpJobs.get",
  10716. // "parameterOrder": [
  10717. // "name"
  10718. // ],
  10719. // "parameters": {
  10720. // "name": {
  10721. // "description": "The name of the DlpJob resource.",
  10722. // "location": "path",
  10723. // "pattern": "^projects/[^/]+/dlpJobs/[^/]+$",
  10724. // "required": true,
  10725. // "type": "string"
  10726. // }
  10727. // },
  10728. // "path": "v2/{+name}",
  10729. // "response": {
  10730. // "$ref": "GooglePrivacyDlpV2DlpJob"
  10731. // },
  10732. // "scopes": [
  10733. // "https://www.googleapis.com/auth/cloud-platform"
  10734. // ]
  10735. // }
  10736. }
  10737. // method id "dlp.projects.dlpJobs.list":
  10738. type ProjectsDlpJobsListCall struct {
  10739. s *Service
  10740. parent string
  10741. urlParams_ gensupport.URLParams
  10742. ifNoneMatch_ string
  10743. ctx_ context.Context
  10744. header_ http.Header
  10745. }
  10746. // List: Lists DlpJobs that match the specified filter in the
  10747. // request.
  10748. // See https://cloud.google.com/dlp/docs/inspecting-storage
  10749. // and
  10750. // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn
  10751. // more.
  10752. func (r *ProjectsDlpJobsService) List(parent string) *ProjectsDlpJobsListCall {
  10753. c := &ProjectsDlpJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10754. c.parent = parent
  10755. return c
  10756. }
  10757. // Filter sets the optional parameter "filter": Allows
  10758. // filtering.
  10759. //
  10760. // Supported syntax:
  10761. //
  10762. // * Filter expressions are made up of one or more restrictions.
  10763. // * Restrictions can be combined by `AND` or `OR` logical operators.
  10764. // A
  10765. // sequence of restrictions implicitly uses `AND`.
  10766. // * A restriction has the form of `<field> <operator> <value>`.
  10767. // * Supported fields/values for inspect jobs:
  10768. // - `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED
  10769. // - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY
  10770. // - `trigger_name` - The resource name of the trigger that created
  10771. // job.
  10772. // * Supported fields for risk analysis jobs:
  10773. // - `state` - RUNNING|CANCELED|FINISHED|FAILED
  10774. // * The operator must be `=` or `!=`.
  10775. //
  10776. // Examples:
  10777. //
  10778. // * inspected_storage = cloud_storage AND state = done
  10779. // * inspected_storage = cloud_storage OR inspected_storage = bigquery
  10780. // * inspected_storage = cloud_storage AND (state = done OR state =
  10781. // canceled)
  10782. //
  10783. // The length of this field should be no more than 500 characters.
  10784. func (c *ProjectsDlpJobsListCall) Filter(filter string) *ProjectsDlpJobsListCall {
  10785. c.urlParams_.Set("filter", filter)
  10786. return c
  10787. }
  10788. // OrderBy sets the optional parameter "orderBy": Optional comma
  10789. // separated list of fields to order by,
  10790. // followed by `asc` or `desc` postfix. This list is
  10791. // case-insensitive,
  10792. // default sorting order is ascending, redundant space characters
  10793. // are
  10794. // insignificant.
  10795. //
  10796. // Example: `name asc, end_time asc, create_time desc`
  10797. //
  10798. // Supported fields are:
  10799. //
  10800. // - `create_time`: corresponds to time the job was created.
  10801. // - `end_time`: corresponds to time the job ended.
  10802. // - `name`: corresponds to job's name.
  10803. // - `state`: corresponds to `state`
  10804. func (c *ProjectsDlpJobsListCall) OrderBy(orderBy string) *ProjectsDlpJobsListCall {
  10805. c.urlParams_.Set("orderBy", orderBy)
  10806. return c
  10807. }
  10808. // PageSize sets the optional parameter "pageSize": The standard list
  10809. // page size.
  10810. func (c *ProjectsDlpJobsListCall) PageSize(pageSize int64) *ProjectsDlpJobsListCall {
  10811. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  10812. return c
  10813. }
  10814. // PageToken sets the optional parameter "pageToken": The standard list
  10815. // page token.
  10816. func (c *ProjectsDlpJobsListCall) PageToken(pageToken string) *ProjectsDlpJobsListCall {
  10817. c.urlParams_.Set("pageToken", pageToken)
  10818. return c
  10819. }
  10820. // Type sets the optional parameter "type": The type of job. Defaults to
  10821. // `DlpJobType.INSPECT`
  10822. //
  10823. // Possible values:
  10824. // "DLP_JOB_TYPE_UNSPECIFIED"
  10825. // "INSPECT_JOB"
  10826. // "RISK_ANALYSIS_JOB"
  10827. func (c *ProjectsDlpJobsListCall) Type(type_ string) *ProjectsDlpJobsListCall {
  10828. c.urlParams_.Set("type", type_)
  10829. return c
  10830. }
  10831. // Fields allows partial responses to be retrieved. See
  10832. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10833. // for more information.
  10834. func (c *ProjectsDlpJobsListCall) Fields(s ...googleapi.Field) *ProjectsDlpJobsListCall {
  10835. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10836. return c
  10837. }
  10838. // IfNoneMatch sets the optional parameter which makes the operation
  10839. // fail if the object's ETag matches the given value. This is useful for
  10840. // getting updates only after the object has changed since the last
  10841. // request. Use googleapi.IsNotModified to check whether the response
  10842. // error from Do is the result of In-None-Match.
  10843. func (c *ProjectsDlpJobsListCall) IfNoneMatch(entityTag string) *ProjectsDlpJobsListCall {
  10844. c.ifNoneMatch_ = entityTag
  10845. return c
  10846. }
  10847. // Context sets the context to be used in this call's Do method. Any
  10848. // pending HTTP request will be aborted if the provided context is
  10849. // canceled.
  10850. func (c *ProjectsDlpJobsListCall) Context(ctx context.Context) *ProjectsDlpJobsListCall {
  10851. c.ctx_ = ctx
  10852. return c
  10853. }
  10854. // Header returns an http.Header that can be modified by the caller to
  10855. // add HTTP headers to the request.
  10856. func (c *ProjectsDlpJobsListCall) Header() http.Header {
  10857. if c.header_ == nil {
  10858. c.header_ = make(http.Header)
  10859. }
  10860. return c.header_
  10861. }
  10862. func (c *ProjectsDlpJobsListCall) doRequest(alt string) (*http.Response, error) {
  10863. reqHeaders := make(http.Header)
  10864. for k, v := range c.header_ {
  10865. reqHeaders[k] = v
  10866. }
  10867. reqHeaders.Set("User-Agent", c.s.userAgent())
  10868. if c.ifNoneMatch_ != "" {
  10869. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10870. }
  10871. var body io.Reader = nil
  10872. c.urlParams_.Set("alt", alt)
  10873. c.urlParams_.Set("prettyPrint", "false")
  10874. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/dlpJobs")
  10875. urls += "?" + c.urlParams_.Encode()
  10876. req, err := http.NewRequest("GET", urls, body)
  10877. if err != nil {
  10878. return nil, err
  10879. }
  10880. req.Header = reqHeaders
  10881. googleapi.Expand(req.URL, map[string]string{
  10882. "parent": c.parent,
  10883. })
  10884. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10885. }
  10886. // Do executes the "dlp.projects.dlpJobs.list" call.
  10887. // Exactly one of *GooglePrivacyDlpV2ListDlpJobsResponse or error will
  10888. // be non-nil. Any non-2xx status code is an error. Response headers are
  10889. // in either
  10890. // *GooglePrivacyDlpV2ListDlpJobsResponse.ServerResponse.Header or (if a
  10891. // response was returned at all) in error.(*googleapi.Error).Header. Use
  10892. // googleapi.IsNotModified to check whether the returned error was
  10893. // because http.StatusNotModified was returned.
  10894. func (c *ProjectsDlpJobsListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListDlpJobsResponse, error) {
  10895. gensupport.SetOptions(c.urlParams_, opts...)
  10896. res, err := c.doRequest("json")
  10897. if res != nil && res.StatusCode == http.StatusNotModified {
  10898. if res.Body != nil {
  10899. res.Body.Close()
  10900. }
  10901. return nil, &googleapi.Error{
  10902. Code: res.StatusCode,
  10903. Header: res.Header,
  10904. }
  10905. }
  10906. if err != nil {
  10907. return nil, err
  10908. }
  10909. defer googleapi.CloseBody(res)
  10910. if err := googleapi.CheckResponse(res); err != nil {
  10911. return nil, err
  10912. }
  10913. ret := &GooglePrivacyDlpV2ListDlpJobsResponse{
  10914. ServerResponse: googleapi.ServerResponse{
  10915. Header: res.Header,
  10916. HTTPStatusCode: res.StatusCode,
  10917. },
  10918. }
  10919. target := &ret
  10920. if err := gensupport.DecodeResponse(target, res); err != nil {
  10921. return nil, err
  10922. }
  10923. return ret, nil
  10924. // {
  10925. // "description": "Lists DlpJobs that match the specified filter in the request.\nSee https://cloud.google.com/dlp/docs/inspecting-storage and\nhttps://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.",
  10926. // "flatPath": "v2/projects/{projectsId}/dlpJobs",
  10927. // "httpMethod": "GET",
  10928. // "id": "dlp.projects.dlpJobs.list",
  10929. // "parameterOrder": [
  10930. // "parent"
  10931. // ],
  10932. // "parameters": {
  10933. // "filter": {
  10934. // "description": "Optional. Allows filtering.\n\nSupported syntax:\n\n* Filter expressions are made up of one or more restrictions.\n* Restrictions can be combined by `AND` or `OR` logical operators. A\nsequence of restrictions implicitly uses `AND`.\n* A restriction has the form of `\u003cfield\u003e \u003coperator\u003e \u003cvalue\u003e`.\n* Supported fields/values for inspect jobs:\n - `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED\n - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY\n - `trigger_name` - The resource name of the trigger that created job.\n* Supported fields for risk analysis jobs:\n - `state` - RUNNING|CANCELED|FINISHED|FAILED\n* The operator must be `=` or `!=`.\n\nExamples:\n\n* inspected_storage = cloud_storage AND state = done\n* inspected_storage = cloud_storage OR inspected_storage = bigquery\n* inspected_storage = cloud_storage AND (state = done OR state = canceled)\n\nThe length of this field should be no more than 500 characters.",
  10935. // "location": "query",
  10936. // "type": "string"
  10937. // },
  10938. // "orderBy": {
  10939. // "description": "Optional comma separated list of fields to order by,\nfollowed by `asc` or `desc` postfix. This list is case-insensitive,\ndefault sorting order is ascending, redundant space characters are\ninsignificant.\n\nExample: `name asc, end_time asc, create_time desc`\n\nSupported fields are:\n\n- `create_time`: corresponds to time the job was created.\n- `end_time`: corresponds to time the job ended.\n- `name`: corresponds to job's name.\n- `state`: corresponds to `state`",
  10940. // "location": "query",
  10941. // "type": "string"
  10942. // },
  10943. // "pageSize": {
  10944. // "description": "The standard list page size.",
  10945. // "format": "int32",
  10946. // "location": "query",
  10947. // "type": "integer"
  10948. // },
  10949. // "pageToken": {
  10950. // "description": "The standard list page token.",
  10951. // "location": "query",
  10952. // "type": "string"
  10953. // },
  10954. // "parent": {
  10955. // "description": "The parent resource name, for example projects/my-project-id.",
  10956. // "location": "path",
  10957. // "pattern": "^projects/[^/]+$",
  10958. // "required": true,
  10959. // "type": "string"
  10960. // },
  10961. // "type": {
  10962. // "description": "The type of job. Defaults to `DlpJobType.INSPECT`",
  10963. // "enum": [
  10964. // "DLP_JOB_TYPE_UNSPECIFIED",
  10965. // "INSPECT_JOB",
  10966. // "RISK_ANALYSIS_JOB"
  10967. // ],
  10968. // "location": "query",
  10969. // "type": "string"
  10970. // }
  10971. // },
  10972. // "path": "v2/{+parent}/dlpJobs",
  10973. // "response": {
  10974. // "$ref": "GooglePrivacyDlpV2ListDlpJobsResponse"
  10975. // },
  10976. // "scopes": [
  10977. // "https://www.googleapis.com/auth/cloud-platform"
  10978. // ]
  10979. // }
  10980. }
  10981. // Pages invokes f for each page of results.
  10982. // A non-nil error returned from f will halt the iteration.
  10983. // The provided context supersedes any context provided to the Context method.
  10984. func (c *ProjectsDlpJobsListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListDlpJobsResponse) error) error {
  10985. c.ctx_ = ctx
  10986. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10987. for {
  10988. x, err := c.Do()
  10989. if err != nil {
  10990. return err
  10991. }
  10992. if err := f(x); err != nil {
  10993. return err
  10994. }
  10995. if x.NextPageToken == "" {
  10996. return nil
  10997. }
  10998. c.PageToken(x.NextPageToken)
  10999. }
  11000. }
  11001. // method id "dlp.projects.image.redact":
  11002. type ProjectsImageRedactCall struct {
  11003. s *Service
  11004. parent string
  11005. googleprivacydlpv2redactimagerequest *GooglePrivacyDlpV2RedactImageRequest
  11006. urlParams_ gensupport.URLParams
  11007. ctx_ context.Context
  11008. header_ http.Header
  11009. }
  11010. // Redact: Redacts potentially sensitive info from an image.
  11011. // This method has limits on input size, processing time, and output
  11012. // size.
  11013. // See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images
  11014. // to
  11015. // learn more.
  11016. //
  11017. // When no InfoTypes or CustomInfoTypes are specified in this request,
  11018. // the
  11019. // system will automatically choose what detectors to run. By default
  11020. // this may
  11021. // be all types, but may change over time as detectors are updated.
  11022. func (r *ProjectsImageService) Redact(parent string, googleprivacydlpv2redactimagerequest *GooglePrivacyDlpV2RedactImageRequest) *ProjectsImageRedactCall {
  11023. c := &ProjectsImageRedactCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11024. c.parent = parent
  11025. c.googleprivacydlpv2redactimagerequest = googleprivacydlpv2redactimagerequest
  11026. return c
  11027. }
  11028. // Fields allows partial responses to be retrieved. See
  11029. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11030. // for more information.
  11031. func (c *ProjectsImageRedactCall) Fields(s ...googleapi.Field) *ProjectsImageRedactCall {
  11032. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11033. return c
  11034. }
  11035. // Context sets the context to be used in this call's Do method. Any
  11036. // pending HTTP request will be aborted if the provided context is
  11037. // canceled.
  11038. func (c *ProjectsImageRedactCall) Context(ctx context.Context) *ProjectsImageRedactCall {
  11039. c.ctx_ = ctx
  11040. return c
  11041. }
  11042. // Header returns an http.Header that can be modified by the caller to
  11043. // add HTTP headers to the request.
  11044. func (c *ProjectsImageRedactCall) Header() http.Header {
  11045. if c.header_ == nil {
  11046. c.header_ = make(http.Header)
  11047. }
  11048. return c.header_
  11049. }
  11050. func (c *ProjectsImageRedactCall) doRequest(alt string) (*http.Response, error) {
  11051. reqHeaders := make(http.Header)
  11052. for k, v := range c.header_ {
  11053. reqHeaders[k] = v
  11054. }
  11055. reqHeaders.Set("User-Agent", c.s.userAgent())
  11056. var body io.Reader = nil
  11057. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2redactimagerequest)
  11058. if err != nil {
  11059. return nil, err
  11060. }
  11061. reqHeaders.Set("Content-Type", "application/json")
  11062. c.urlParams_.Set("alt", alt)
  11063. c.urlParams_.Set("prettyPrint", "false")
  11064. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/image:redact")
  11065. urls += "?" + c.urlParams_.Encode()
  11066. req, err := http.NewRequest("POST", urls, body)
  11067. if err != nil {
  11068. return nil, err
  11069. }
  11070. req.Header = reqHeaders
  11071. googleapi.Expand(req.URL, map[string]string{
  11072. "parent": c.parent,
  11073. })
  11074. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11075. }
  11076. // Do executes the "dlp.projects.image.redact" call.
  11077. // Exactly one of *GooglePrivacyDlpV2RedactImageResponse or error will
  11078. // be non-nil. Any non-2xx status code is an error. Response headers are
  11079. // in either
  11080. // *GooglePrivacyDlpV2RedactImageResponse.ServerResponse.Header or (if a
  11081. // response was returned at all) in error.(*googleapi.Error).Header. Use
  11082. // googleapi.IsNotModified to check whether the returned error was
  11083. // because http.StatusNotModified was returned.
  11084. func (c *ProjectsImageRedactCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2RedactImageResponse, error) {
  11085. gensupport.SetOptions(c.urlParams_, opts...)
  11086. res, err := c.doRequest("json")
  11087. if res != nil && res.StatusCode == http.StatusNotModified {
  11088. if res.Body != nil {
  11089. res.Body.Close()
  11090. }
  11091. return nil, &googleapi.Error{
  11092. Code: res.StatusCode,
  11093. Header: res.Header,
  11094. }
  11095. }
  11096. if err != nil {
  11097. return nil, err
  11098. }
  11099. defer googleapi.CloseBody(res)
  11100. if err := googleapi.CheckResponse(res); err != nil {
  11101. return nil, err
  11102. }
  11103. ret := &GooglePrivacyDlpV2RedactImageResponse{
  11104. ServerResponse: googleapi.ServerResponse{
  11105. Header: res.Header,
  11106. HTTPStatusCode: res.StatusCode,
  11107. },
  11108. }
  11109. target := &ret
  11110. if err := gensupport.DecodeResponse(target, res); err != nil {
  11111. return nil, err
  11112. }
  11113. return ret, nil
  11114. // {
  11115. // "description": "Redacts potentially sensitive info from an image.\nThis method has limits on input size, processing time, and output size.\nSee https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to\nlearn more.\n\nWhen no InfoTypes or CustomInfoTypes are specified in this request, the\nsystem will automatically choose what detectors to run. By default this may\nbe all types, but may change over time as detectors are updated.",
  11116. // "flatPath": "v2/projects/{projectsId}/image:redact",
  11117. // "httpMethod": "POST",
  11118. // "id": "dlp.projects.image.redact",
  11119. // "parameterOrder": [
  11120. // "parent"
  11121. // ],
  11122. // "parameters": {
  11123. // "parent": {
  11124. // "description": "The parent resource name, for example projects/my-project-id.",
  11125. // "location": "path",
  11126. // "pattern": "^projects/[^/]+$",
  11127. // "required": true,
  11128. // "type": "string"
  11129. // }
  11130. // },
  11131. // "path": "v2/{+parent}/image:redact",
  11132. // "request": {
  11133. // "$ref": "GooglePrivacyDlpV2RedactImageRequest"
  11134. // },
  11135. // "response": {
  11136. // "$ref": "GooglePrivacyDlpV2RedactImageResponse"
  11137. // },
  11138. // "scopes": [
  11139. // "https://www.googleapis.com/auth/cloud-platform"
  11140. // ]
  11141. // }
  11142. }
  11143. // method id "dlp.projects.inspectTemplates.create":
  11144. type ProjectsInspectTemplatesCreateCall struct {
  11145. s *Service
  11146. parent string
  11147. googleprivacydlpv2createinspecttemplaterequest *GooglePrivacyDlpV2CreateInspectTemplateRequest
  11148. urlParams_ gensupport.URLParams
  11149. ctx_ context.Context
  11150. header_ http.Header
  11151. }
  11152. // Create: Creates an InspectTemplate for re-using frequently used
  11153. // configuration
  11154. // for inspecting content, images, and storage.
  11155. // See https://cloud.google.com/dlp/docs/creating-templates to learn
  11156. // more.
  11157. func (r *ProjectsInspectTemplatesService) Create(parent string, googleprivacydlpv2createinspecttemplaterequest *GooglePrivacyDlpV2CreateInspectTemplateRequest) *ProjectsInspectTemplatesCreateCall {
  11158. c := &ProjectsInspectTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11159. c.parent = parent
  11160. c.googleprivacydlpv2createinspecttemplaterequest = googleprivacydlpv2createinspecttemplaterequest
  11161. return c
  11162. }
  11163. // Fields allows partial responses to be retrieved. See
  11164. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11165. // for more information.
  11166. func (c *ProjectsInspectTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsInspectTemplatesCreateCall {
  11167. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11168. return c
  11169. }
  11170. // Context sets the context to be used in this call's Do method. Any
  11171. // pending HTTP request will be aborted if the provided context is
  11172. // canceled.
  11173. func (c *ProjectsInspectTemplatesCreateCall) Context(ctx context.Context) *ProjectsInspectTemplatesCreateCall {
  11174. c.ctx_ = ctx
  11175. return c
  11176. }
  11177. // Header returns an http.Header that can be modified by the caller to
  11178. // add HTTP headers to the request.
  11179. func (c *ProjectsInspectTemplatesCreateCall) Header() http.Header {
  11180. if c.header_ == nil {
  11181. c.header_ = make(http.Header)
  11182. }
  11183. return c.header_
  11184. }
  11185. func (c *ProjectsInspectTemplatesCreateCall) doRequest(alt string) (*http.Response, error) {
  11186. reqHeaders := make(http.Header)
  11187. for k, v := range c.header_ {
  11188. reqHeaders[k] = v
  11189. }
  11190. reqHeaders.Set("User-Agent", c.s.userAgent())
  11191. var body io.Reader = nil
  11192. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createinspecttemplaterequest)
  11193. if err != nil {
  11194. return nil, err
  11195. }
  11196. reqHeaders.Set("Content-Type", "application/json")
  11197. c.urlParams_.Set("alt", alt)
  11198. c.urlParams_.Set("prettyPrint", "false")
  11199. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/inspectTemplates")
  11200. urls += "?" + c.urlParams_.Encode()
  11201. req, err := http.NewRequest("POST", urls, body)
  11202. if err != nil {
  11203. return nil, err
  11204. }
  11205. req.Header = reqHeaders
  11206. googleapi.Expand(req.URL, map[string]string{
  11207. "parent": c.parent,
  11208. })
  11209. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11210. }
  11211. // Do executes the "dlp.projects.inspectTemplates.create" call.
  11212. // Exactly one of *GooglePrivacyDlpV2InspectTemplate or error will be
  11213. // non-nil. Any non-2xx status code is an error. Response headers are in
  11214. // either *GooglePrivacyDlpV2InspectTemplate.ServerResponse.Header or
  11215. // (if a response was returned at all) in
  11216. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  11217. // whether the returned error was because http.StatusNotModified was
  11218. // returned.
  11219. func (c *ProjectsInspectTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectTemplate, error) {
  11220. gensupport.SetOptions(c.urlParams_, opts...)
  11221. res, err := c.doRequest("json")
  11222. if res != nil && res.StatusCode == http.StatusNotModified {
  11223. if res.Body != nil {
  11224. res.Body.Close()
  11225. }
  11226. return nil, &googleapi.Error{
  11227. Code: res.StatusCode,
  11228. Header: res.Header,
  11229. }
  11230. }
  11231. if err != nil {
  11232. return nil, err
  11233. }
  11234. defer googleapi.CloseBody(res)
  11235. if err := googleapi.CheckResponse(res); err != nil {
  11236. return nil, err
  11237. }
  11238. ret := &GooglePrivacyDlpV2InspectTemplate{
  11239. ServerResponse: googleapi.ServerResponse{
  11240. Header: res.Header,
  11241. HTTPStatusCode: res.StatusCode,
  11242. },
  11243. }
  11244. target := &ret
  11245. if err := gensupport.DecodeResponse(target, res); err != nil {
  11246. return nil, err
  11247. }
  11248. return ret, nil
  11249. // {
  11250. // "description": "Creates an InspectTemplate for re-using frequently used configuration\nfor inspecting content, images, and storage.\nSee https://cloud.google.com/dlp/docs/creating-templates to learn more.",
  11251. // "flatPath": "v2/projects/{projectsId}/inspectTemplates",
  11252. // "httpMethod": "POST",
  11253. // "id": "dlp.projects.inspectTemplates.create",
  11254. // "parameterOrder": [
  11255. // "parent"
  11256. // ],
  11257. // "parameters": {
  11258. // "parent": {
  11259. // "description": "The parent resource name, for example projects/my-project-id or\norganizations/my-org-id.",
  11260. // "location": "path",
  11261. // "pattern": "^projects/[^/]+$",
  11262. // "required": true,
  11263. // "type": "string"
  11264. // }
  11265. // },
  11266. // "path": "v2/{+parent}/inspectTemplates",
  11267. // "request": {
  11268. // "$ref": "GooglePrivacyDlpV2CreateInspectTemplateRequest"
  11269. // },
  11270. // "response": {
  11271. // "$ref": "GooglePrivacyDlpV2InspectTemplate"
  11272. // },
  11273. // "scopes": [
  11274. // "https://www.googleapis.com/auth/cloud-platform"
  11275. // ]
  11276. // }
  11277. }
  11278. // method id "dlp.projects.inspectTemplates.delete":
  11279. type ProjectsInspectTemplatesDeleteCall struct {
  11280. s *Service
  11281. name string
  11282. urlParams_ gensupport.URLParams
  11283. ctx_ context.Context
  11284. header_ http.Header
  11285. }
  11286. // Delete: Deletes an InspectTemplate.
  11287. // See https://cloud.google.com/dlp/docs/creating-templates to learn
  11288. // more.
  11289. func (r *ProjectsInspectTemplatesService) Delete(name string) *ProjectsInspectTemplatesDeleteCall {
  11290. c := &ProjectsInspectTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11291. c.name = name
  11292. return c
  11293. }
  11294. // Fields allows partial responses to be retrieved. See
  11295. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11296. // for more information.
  11297. func (c *ProjectsInspectTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsInspectTemplatesDeleteCall {
  11298. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11299. return c
  11300. }
  11301. // Context sets the context to be used in this call's Do method. Any
  11302. // pending HTTP request will be aborted if the provided context is
  11303. // canceled.
  11304. func (c *ProjectsInspectTemplatesDeleteCall) Context(ctx context.Context) *ProjectsInspectTemplatesDeleteCall {
  11305. c.ctx_ = ctx
  11306. return c
  11307. }
  11308. // Header returns an http.Header that can be modified by the caller to
  11309. // add HTTP headers to the request.
  11310. func (c *ProjectsInspectTemplatesDeleteCall) Header() http.Header {
  11311. if c.header_ == nil {
  11312. c.header_ = make(http.Header)
  11313. }
  11314. return c.header_
  11315. }
  11316. func (c *ProjectsInspectTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  11317. reqHeaders := make(http.Header)
  11318. for k, v := range c.header_ {
  11319. reqHeaders[k] = v
  11320. }
  11321. reqHeaders.Set("User-Agent", c.s.userAgent())
  11322. var body io.Reader = nil
  11323. c.urlParams_.Set("alt", alt)
  11324. c.urlParams_.Set("prettyPrint", "false")
  11325. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  11326. urls += "?" + c.urlParams_.Encode()
  11327. req, err := http.NewRequest("DELETE", urls, body)
  11328. if err != nil {
  11329. return nil, err
  11330. }
  11331. req.Header = reqHeaders
  11332. googleapi.Expand(req.URL, map[string]string{
  11333. "name": c.name,
  11334. })
  11335. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11336. }
  11337. // Do executes the "dlp.projects.inspectTemplates.delete" call.
  11338. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  11339. // non-2xx status code is an error. Response headers are in either
  11340. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  11341. // returned at all) in error.(*googleapi.Error).Header. Use
  11342. // googleapi.IsNotModified to check whether the returned error was
  11343. // because http.StatusNotModified was returned.
  11344. func (c *ProjectsInspectTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  11345. gensupport.SetOptions(c.urlParams_, opts...)
  11346. res, err := c.doRequest("json")
  11347. if res != nil && res.StatusCode == http.StatusNotModified {
  11348. if res.Body != nil {
  11349. res.Body.Close()
  11350. }
  11351. return nil, &googleapi.Error{
  11352. Code: res.StatusCode,
  11353. Header: res.Header,
  11354. }
  11355. }
  11356. if err != nil {
  11357. return nil, err
  11358. }
  11359. defer googleapi.CloseBody(res)
  11360. if err := googleapi.CheckResponse(res); err != nil {
  11361. return nil, err
  11362. }
  11363. ret := &GoogleProtobufEmpty{
  11364. ServerResponse: googleapi.ServerResponse{
  11365. Header: res.Header,
  11366. HTTPStatusCode: res.StatusCode,
  11367. },
  11368. }
  11369. target := &ret
  11370. if err := gensupport.DecodeResponse(target, res); err != nil {
  11371. return nil, err
  11372. }
  11373. return ret, nil
  11374. // {
  11375. // "description": "Deletes an InspectTemplate.\nSee https://cloud.google.com/dlp/docs/creating-templates to learn more.",
  11376. // "flatPath": "v2/projects/{projectsId}/inspectTemplates/{inspectTemplatesId}",
  11377. // "httpMethod": "DELETE",
  11378. // "id": "dlp.projects.inspectTemplates.delete",
  11379. // "parameterOrder": [
  11380. // "name"
  11381. // ],
  11382. // "parameters": {
  11383. // "name": {
  11384. // "description": "Resource name of the organization and inspectTemplate to be deleted, for\nexample `organizations/433245324/inspectTemplates/432452342` or\nprojects/project-id/inspectTemplates/432452342.",
  11385. // "location": "path",
  11386. // "pattern": "^projects/[^/]+/inspectTemplates/[^/]+$",
  11387. // "required": true,
  11388. // "type": "string"
  11389. // }
  11390. // },
  11391. // "path": "v2/{+name}",
  11392. // "response": {
  11393. // "$ref": "GoogleProtobufEmpty"
  11394. // },
  11395. // "scopes": [
  11396. // "https://www.googleapis.com/auth/cloud-platform"
  11397. // ]
  11398. // }
  11399. }
  11400. // method id "dlp.projects.inspectTemplates.get":
  11401. type ProjectsInspectTemplatesGetCall struct {
  11402. s *Service
  11403. name string
  11404. urlParams_ gensupport.URLParams
  11405. ifNoneMatch_ string
  11406. ctx_ context.Context
  11407. header_ http.Header
  11408. }
  11409. // Get: Gets an InspectTemplate.
  11410. // See https://cloud.google.com/dlp/docs/creating-templates to learn
  11411. // more.
  11412. func (r *ProjectsInspectTemplatesService) Get(name string) *ProjectsInspectTemplatesGetCall {
  11413. c := &ProjectsInspectTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11414. c.name = name
  11415. return c
  11416. }
  11417. // Fields allows partial responses to be retrieved. See
  11418. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11419. // for more information.
  11420. func (c *ProjectsInspectTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsInspectTemplatesGetCall {
  11421. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11422. return c
  11423. }
  11424. // IfNoneMatch sets the optional parameter which makes the operation
  11425. // fail if the object's ETag matches the given value. This is useful for
  11426. // getting updates only after the object has changed since the last
  11427. // request. Use googleapi.IsNotModified to check whether the response
  11428. // error from Do is the result of In-None-Match.
  11429. func (c *ProjectsInspectTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsInspectTemplatesGetCall {
  11430. c.ifNoneMatch_ = entityTag
  11431. return c
  11432. }
  11433. // Context sets the context to be used in this call's Do method. Any
  11434. // pending HTTP request will be aborted if the provided context is
  11435. // canceled.
  11436. func (c *ProjectsInspectTemplatesGetCall) Context(ctx context.Context) *ProjectsInspectTemplatesGetCall {
  11437. c.ctx_ = ctx
  11438. return c
  11439. }
  11440. // Header returns an http.Header that can be modified by the caller to
  11441. // add HTTP headers to the request.
  11442. func (c *ProjectsInspectTemplatesGetCall) Header() http.Header {
  11443. if c.header_ == nil {
  11444. c.header_ = make(http.Header)
  11445. }
  11446. return c.header_
  11447. }
  11448. func (c *ProjectsInspectTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  11449. reqHeaders := make(http.Header)
  11450. for k, v := range c.header_ {
  11451. reqHeaders[k] = v
  11452. }
  11453. reqHeaders.Set("User-Agent", c.s.userAgent())
  11454. if c.ifNoneMatch_ != "" {
  11455. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11456. }
  11457. var body io.Reader = nil
  11458. c.urlParams_.Set("alt", alt)
  11459. c.urlParams_.Set("prettyPrint", "false")
  11460. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  11461. urls += "?" + c.urlParams_.Encode()
  11462. req, err := http.NewRequest("GET", urls, body)
  11463. if err != nil {
  11464. return nil, err
  11465. }
  11466. req.Header = reqHeaders
  11467. googleapi.Expand(req.URL, map[string]string{
  11468. "name": c.name,
  11469. })
  11470. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11471. }
  11472. // Do executes the "dlp.projects.inspectTemplates.get" call.
  11473. // Exactly one of *GooglePrivacyDlpV2InspectTemplate or error will be
  11474. // non-nil. Any non-2xx status code is an error. Response headers are in
  11475. // either *GooglePrivacyDlpV2InspectTemplate.ServerResponse.Header or
  11476. // (if a response was returned at all) in
  11477. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  11478. // whether the returned error was because http.StatusNotModified was
  11479. // returned.
  11480. func (c *ProjectsInspectTemplatesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectTemplate, error) {
  11481. gensupport.SetOptions(c.urlParams_, opts...)
  11482. res, err := c.doRequest("json")
  11483. if res != nil && res.StatusCode == http.StatusNotModified {
  11484. if res.Body != nil {
  11485. res.Body.Close()
  11486. }
  11487. return nil, &googleapi.Error{
  11488. Code: res.StatusCode,
  11489. Header: res.Header,
  11490. }
  11491. }
  11492. if err != nil {
  11493. return nil, err
  11494. }
  11495. defer googleapi.CloseBody(res)
  11496. if err := googleapi.CheckResponse(res); err != nil {
  11497. return nil, err
  11498. }
  11499. ret := &GooglePrivacyDlpV2InspectTemplate{
  11500. ServerResponse: googleapi.ServerResponse{
  11501. Header: res.Header,
  11502. HTTPStatusCode: res.StatusCode,
  11503. },
  11504. }
  11505. target := &ret
  11506. if err := gensupport.DecodeResponse(target, res); err != nil {
  11507. return nil, err
  11508. }
  11509. return ret, nil
  11510. // {
  11511. // "description": "Gets an InspectTemplate.\nSee https://cloud.google.com/dlp/docs/creating-templates to learn more.",
  11512. // "flatPath": "v2/projects/{projectsId}/inspectTemplates/{inspectTemplatesId}",
  11513. // "httpMethod": "GET",
  11514. // "id": "dlp.projects.inspectTemplates.get",
  11515. // "parameterOrder": [
  11516. // "name"
  11517. // ],
  11518. // "parameters": {
  11519. // "name": {
  11520. // "description": "Resource name of the organization and inspectTemplate to be read, for\nexample `organizations/433245324/inspectTemplates/432452342` or\nprojects/project-id/inspectTemplates/432452342.",
  11521. // "location": "path",
  11522. // "pattern": "^projects/[^/]+/inspectTemplates/[^/]+$",
  11523. // "required": true,
  11524. // "type": "string"
  11525. // }
  11526. // },
  11527. // "path": "v2/{+name}",
  11528. // "response": {
  11529. // "$ref": "GooglePrivacyDlpV2InspectTemplate"
  11530. // },
  11531. // "scopes": [
  11532. // "https://www.googleapis.com/auth/cloud-platform"
  11533. // ]
  11534. // }
  11535. }
  11536. // method id "dlp.projects.inspectTemplates.list":
  11537. type ProjectsInspectTemplatesListCall struct {
  11538. s *Service
  11539. parent string
  11540. urlParams_ gensupport.URLParams
  11541. ifNoneMatch_ string
  11542. ctx_ context.Context
  11543. header_ http.Header
  11544. }
  11545. // List: Lists InspectTemplates.
  11546. // See https://cloud.google.com/dlp/docs/creating-templates to learn
  11547. // more.
  11548. func (r *ProjectsInspectTemplatesService) List(parent string) *ProjectsInspectTemplatesListCall {
  11549. c := &ProjectsInspectTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11550. c.parent = parent
  11551. return c
  11552. }
  11553. // OrderBy sets the optional parameter "orderBy": Optional comma
  11554. // separated list of fields to order by,
  11555. // followed by `asc` or `desc` postfix. This list is
  11556. // case-insensitive,
  11557. // default sorting order is ascending, redundant space characters
  11558. // are
  11559. // insignificant.
  11560. //
  11561. // Example: `name asc,update_time, create_time desc`
  11562. //
  11563. // Supported fields are:
  11564. //
  11565. // - `create_time`: corresponds to time the template was created.
  11566. // - `update_time`: corresponds to time the template was last updated.
  11567. // - `name`: corresponds to template's name.
  11568. // - `display_name`: corresponds to template's display name.
  11569. func (c *ProjectsInspectTemplatesListCall) OrderBy(orderBy string) *ProjectsInspectTemplatesListCall {
  11570. c.urlParams_.Set("orderBy", orderBy)
  11571. return c
  11572. }
  11573. // PageSize sets the optional parameter "pageSize": Optional size of the
  11574. // page, can be limited by server. If zero server returns
  11575. // a page of max size 100.
  11576. func (c *ProjectsInspectTemplatesListCall) PageSize(pageSize int64) *ProjectsInspectTemplatesListCall {
  11577. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  11578. return c
  11579. }
  11580. // PageToken sets the optional parameter "pageToken": Optional page
  11581. // token to continue retrieval. Comes from previous call
  11582. // to `ListInspectTemplates`.
  11583. func (c *ProjectsInspectTemplatesListCall) PageToken(pageToken string) *ProjectsInspectTemplatesListCall {
  11584. c.urlParams_.Set("pageToken", pageToken)
  11585. return c
  11586. }
  11587. // Fields allows partial responses to be retrieved. See
  11588. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11589. // for more information.
  11590. func (c *ProjectsInspectTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsInspectTemplatesListCall {
  11591. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11592. return c
  11593. }
  11594. // IfNoneMatch sets the optional parameter which makes the operation
  11595. // fail if the object's ETag matches the given value. This is useful for
  11596. // getting updates only after the object has changed since the last
  11597. // request. Use googleapi.IsNotModified to check whether the response
  11598. // error from Do is the result of In-None-Match.
  11599. func (c *ProjectsInspectTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsInspectTemplatesListCall {
  11600. c.ifNoneMatch_ = entityTag
  11601. return c
  11602. }
  11603. // Context sets the context to be used in this call's Do method. Any
  11604. // pending HTTP request will be aborted if the provided context is
  11605. // canceled.
  11606. func (c *ProjectsInspectTemplatesListCall) Context(ctx context.Context) *ProjectsInspectTemplatesListCall {
  11607. c.ctx_ = ctx
  11608. return c
  11609. }
  11610. // Header returns an http.Header that can be modified by the caller to
  11611. // add HTTP headers to the request.
  11612. func (c *ProjectsInspectTemplatesListCall) Header() http.Header {
  11613. if c.header_ == nil {
  11614. c.header_ = make(http.Header)
  11615. }
  11616. return c.header_
  11617. }
  11618. func (c *ProjectsInspectTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  11619. reqHeaders := make(http.Header)
  11620. for k, v := range c.header_ {
  11621. reqHeaders[k] = v
  11622. }
  11623. reqHeaders.Set("User-Agent", c.s.userAgent())
  11624. if c.ifNoneMatch_ != "" {
  11625. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11626. }
  11627. var body io.Reader = nil
  11628. c.urlParams_.Set("alt", alt)
  11629. c.urlParams_.Set("prettyPrint", "false")
  11630. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/inspectTemplates")
  11631. urls += "?" + c.urlParams_.Encode()
  11632. req, err := http.NewRequest("GET", urls, body)
  11633. if err != nil {
  11634. return nil, err
  11635. }
  11636. req.Header = reqHeaders
  11637. googleapi.Expand(req.URL, map[string]string{
  11638. "parent": c.parent,
  11639. })
  11640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11641. }
  11642. // Do executes the "dlp.projects.inspectTemplates.list" call.
  11643. // Exactly one of *GooglePrivacyDlpV2ListInspectTemplatesResponse or
  11644. // error will be non-nil. Any non-2xx status code is an error. Response
  11645. // headers are in either
  11646. // *GooglePrivacyDlpV2ListInspectTemplatesResponse.ServerResponse.Header
  11647. // or (if a response was returned at all) in
  11648. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  11649. // whether the returned error was because http.StatusNotModified was
  11650. // returned.
  11651. func (c *ProjectsInspectTemplatesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListInspectTemplatesResponse, error) {
  11652. gensupport.SetOptions(c.urlParams_, opts...)
  11653. res, err := c.doRequest("json")
  11654. if res != nil && res.StatusCode == http.StatusNotModified {
  11655. if res.Body != nil {
  11656. res.Body.Close()
  11657. }
  11658. return nil, &googleapi.Error{
  11659. Code: res.StatusCode,
  11660. Header: res.Header,
  11661. }
  11662. }
  11663. if err != nil {
  11664. return nil, err
  11665. }
  11666. defer googleapi.CloseBody(res)
  11667. if err := googleapi.CheckResponse(res); err != nil {
  11668. return nil, err
  11669. }
  11670. ret := &GooglePrivacyDlpV2ListInspectTemplatesResponse{
  11671. ServerResponse: googleapi.ServerResponse{
  11672. Header: res.Header,
  11673. HTTPStatusCode: res.StatusCode,
  11674. },
  11675. }
  11676. target := &ret
  11677. if err := gensupport.DecodeResponse(target, res); err != nil {
  11678. return nil, err
  11679. }
  11680. return ret, nil
  11681. // {
  11682. // "description": "Lists InspectTemplates.\nSee https://cloud.google.com/dlp/docs/creating-templates to learn more.",
  11683. // "flatPath": "v2/projects/{projectsId}/inspectTemplates",
  11684. // "httpMethod": "GET",
  11685. // "id": "dlp.projects.inspectTemplates.list",
  11686. // "parameterOrder": [
  11687. // "parent"
  11688. // ],
  11689. // "parameters": {
  11690. // "orderBy": {
  11691. // "description": "Optional comma separated list of fields to order by,\nfollowed by `asc` or `desc` postfix. This list is case-insensitive,\ndefault sorting order is ascending, redundant space characters are\ninsignificant.\n\nExample: `name asc,update_time, create_time desc`\n\nSupported fields are:\n\n- `create_time`: corresponds to time the template was created.\n- `update_time`: corresponds to time the template was last updated.\n- `name`: corresponds to template's name.\n- `display_name`: corresponds to template's display name.",
  11692. // "location": "query",
  11693. // "type": "string"
  11694. // },
  11695. // "pageSize": {
  11696. // "description": "Optional size of the page, can be limited by server. If zero server returns\na page of max size 100.",
  11697. // "format": "int32",
  11698. // "location": "query",
  11699. // "type": "integer"
  11700. // },
  11701. // "pageToken": {
  11702. // "description": "Optional page token to continue retrieval. Comes from previous call\nto `ListInspectTemplates`.",
  11703. // "location": "query",
  11704. // "type": "string"
  11705. // },
  11706. // "parent": {
  11707. // "description": "The parent resource name, for example projects/my-project-id or\norganizations/my-org-id.",
  11708. // "location": "path",
  11709. // "pattern": "^projects/[^/]+$",
  11710. // "required": true,
  11711. // "type": "string"
  11712. // }
  11713. // },
  11714. // "path": "v2/{+parent}/inspectTemplates",
  11715. // "response": {
  11716. // "$ref": "GooglePrivacyDlpV2ListInspectTemplatesResponse"
  11717. // },
  11718. // "scopes": [
  11719. // "https://www.googleapis.com/auth/cloud-platform"
  11720. // ]
  11721. // }
  11722. }
  11723. // Pages invokes f for each page of results.
  11724. // A non-nil error returned from f will halt the iteration.
  11725. // The provided context supersedes any context provided to the Context method.
  11726. func (c *ProjectsInspectTemplatesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListInspectTemplatesResponse) error) error {
  11727. c.ctx_ = ctx
  11728. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11729. for {
  11730. x, err := c.Do()
  11731. if err != nil {
  11732. return err
  11733. }
  11734. if err := f(x); err != nil {
  11735. return err
  11736. }
  11737. if x.NextPageToken == "" {
  11738. return nil
  11739. }
  11740. c.PageToken(x.NextPageToken)
  11741. }
  11742. }
  11743. // method id "dlp.projects.inspectTemplates.patch":
  11744. type ProjectsInspectTemplatesPatchCall struct {
  11745. s *Service
  11746. name string
  11747. googleprivacydlpv2updateinspecttemplaterequest *GooglePrivacyDlpV2UpdateInspectTemplateRequest
  11748. urlParams_ gensupport.URLParams
  11749. ctx_ context.Context
  11750. header_ http.Header
  11751. }
  11752. // Patch: Updates the InspectTemplate.
  11753. // See https://cloud.google.com/dlp/docs/creating-templates to learn
  11754. // more.
  11755. func (r *ProjectsInspectTemplatesService) Patch(name string, googleprivacydlpv2updateinspecttemplaterequest *GooglePrivacyDlpV2UpdateInspectTemplateRequest) *ProjectsInspectTemplatesPatchCall {
  11756. c := &ProjectsInspectTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11757. c.name = name
  11758. c.googleprivacydlpv2updateinspecttemplaterequest = googleprivacydlpv2updateinspecttemplaterequest
  11759. return c
  11760. }
  11761. // Fields allows partial responses to be retrieved. See
  11762. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11763. // for more information.
  11764. func (c *ProjectsInspectTemplatesPatchCall) Fields(s ...googleapi.Field) *ProjectsInspectTemplatesPatchCall {
  11765. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11766. return c
  11767. }
  11768. // Context sets the context to be used in this call's Do method. Any
  11769. // pending HTTP request will be aborted if the provided context is
  11770. // canceled.
  11771. func (c *ProjectsInspectTemplatesPatchCall) Context(ctx context.Context) *ProjectsInspectTemplatesPatchCall {
  11772. c.ctx_ = ctx
  11773. return c
  11774. }
  11775. // Header returns an http.Header that can be modified by the caller to
  11776. // add HTTP headers to the request.
  11777. func (c *ProjectsInspectTemplatesPatchCall) Header() http.Header {
  11778. if c.header_ == nil {
  11779. c.header_ = make(http.Header)
  11780. }
  11781. return c.header_
  11782. }
  11783. func (c *ProjectsInspectTemplatesPatchCall) doRequest(alt string) (*http.Response, error) {
  11784. reqHeaders := make(http.Header)
  11785. for k, v := range c.header_ {
  11786. reqHeaders[k] = v
  11787. }
  11788. reqHeaders.Set("User-Agent", c.s.userAgent())
  11789. var body io.Reader = nil
  11790. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updateinspecttemplaterequest)
  11791. if err != nil {
  11792. return nil, err
  11793. }
  11794. reqHeaders.Set("Content-Type", "application/json")
  11795. c.urlParams_.Set("alt", alt)
  11796. c.urlParams_.Set("prettyPrint", "false")
  11797. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  11798. urls += "?" + c.urlParams_.Encode()
  11799. req, err := http.NewRequest("PATCH", urls, body)
  11800. if err != nil {
  11801. return nil, err
  11802. }
  11803. req.Header = reqHeaders
  11804. googleapi.Expand(req.URL, map[string]string{
  11805. "name": c.name,
  11806. })
  11807. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11808. }
  11809. // Do executes the "dlp.projects.inspectTemplates.patch" call.
  11810. // Exactly one of *GooglePrivacyDlpV2InspectTemplate or error will be
  11811. // non-nil. Any non-2xx status code is an error. Response headers are in
  11812. // either *GooglePrivacyDlpV2InspectTemplate.ServerResponse.Header or
  11813. // (if a response was returned at all) in
  11814. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  11815. // whether the returned error was because http.StatusNotModified was
  11816. // returned.
  11817. func (c *ProjectsInspectTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2InspectTemplate, error) {
  11818. gensupport.SetOptions(c.urlParams_, opts...)
  11819. res, err := c.doRequest("json")
  11820. if res != nil && res.StatusCode == http.StatusNotModified {
  11821. if res.Body != nil {
  11822. res.Body.Close()
  11823. }
  11824. return nil, &googleapi.Error{
  11825. Code: res.StatusCode,
  11826. Header: res.Header,
  11827. }
  11828. }
  11829. if err != nil {
  11830. return nil, err
  11831. }
  11832. defer googleapi.CloseBody(res)
  11833. if err := googleapi.CheckResponse(res); err != nil {
  11834. return nil, err
  11835. }
  11836. ret := &GooglePrivacyDlpV2InspectTemplate{
  11837. ServerResponse: googleapi.ServerResponse{
  11838. Header: res.Header,
  11839. HTTPStatusCode: res.StatusCode,
  11840. },
  11841. }
  11842. target := &ret
  11843. if err := gensupport.DecodeResponse(target, res); err != nil {
  11844. return nil, err
  11845. }
  11846. return ret, nil
  11847. // {
  11848. // "description": "Updates the InspectTemplate.\nSee https://cloud.google.com/dlp/docs/creating-templates to learn more.",
  11849. // "flatPath": "v2/projects/{projectsId}/inspectTemplates/{inspectTemplatesId}",
  11850. // "httpMethod": "PATCH",
  11851. // "id": "dlp.projects.inspectTemplates.patch",
  11852. // "parameterOrder": [
  11853. // "name"
  11854. // ],
  11855. // "parameters": {
  11856. // "name": {
  11857. // "description": "Resource name of organization and inspectTemplate to be updated, for\nexample `organizations/433245324/inspectTemplates/432452342` or\nprojects/project-id/inspectTemplates/432452342.",
  11858. // "location": "path",
  11859. // "pattern": "^projects/[^/]+/inspectTemplates/[^/]+$",
  11860. // "required": true,
  11861. // "type": "string"
  11862. // }
  11863. // },
  11864. // "path": "v2/{+name}",
  11865. // "request": {
  11866. // "$ref": "GooglePrivacyDlpV2UpdateInspectTemplateRequest"
  11867. // },
  11868. // "response": {
  11869. // "$ref": "GooglePrivacyDlpV2InspectTemplate"
  11870. // },
  11871. // "scopes": [
  11872. // "https://www.googleapis.com/auth/cloud-platform"
  11873. // ]
  11874. // }
  11875. }
  11876. // method id "dlp.projects.jobTriggers.activate":
  11877. type ProjectsJobTriggersActivateCall struct {
  11878. s *Service
  11879. name string
  11880. googleprivacydlpv2activatejobtriggerrequest *GooglePrivacyDlpV2ActivateJobTriggerRequest
  11881. urlParams_ gensupport.URLParams
  11882. ctx_ context.Context
  11883. header_ http.Header
  11884. }
  11885. // Activate: Activate a job trigger. Causes the immediate execute of a
  11886. // trigger
  11887. // instead of waiting on the trigger event to occur.
  11888. func (r *ProjectsJobTriggersService) Activate(name string, googleprivacydlpv2activatejobtriggerrequest *GooglePrivacyDlpV2ActivateJobTriggerRequest) *ProjectsJobTriggersActivateCall {
  11889. c := &ProjectsJobTriggersActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11890. c.name = name
  11891. c.googleprivacydlpv2activatejobtriggerrequest = googleprivacydlpv2activatejobtriggerrequest
  11892. return c
  11893. }
  11894. // Fields allows partial responses to be retrieved. See
  11895. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11896. // for more information.
  11897. func (c *ProjectsJobTriggersActivateCall) Fields(s ...googleapi.Field) *ProjectsJobTriggersActivateCall {
  11898. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11899. return c
  11900. }
  11901. // Context sets the context to be used in this call's Do method. Any
  11902. // pending HTTP request will be aborted if the provided context is
  11903. // canceled.
  11904. func (c *ProjectsJobTriggersActivateCall) Context(ctx context.Context) *ProjectsJobTriggersActivateCall {
  11905. c.ctx_ = ctx
  11906. return c
  11907. }
  11908. // Header returns an http.Header that can be modified by the caller to
  11909. // add HTTP headers to the request.
  11910. func (c *ProjectsJobTriggersActivateCall) Header() http.Header {
  11911. if c.header_ == nil {
  11912. c.header_ = make(http.Header)
  11913. }
  11914. return c.header_
  11915. }
  11916. func (c *ProjectsJobTriggersActivateCall) doRequest(alt string) (*http.Response, error) {
  11917. reqHeaders := make(http.Header)
  11918. for k, v := range c.header_ {
  11919. reqHeaders[k] = v
  11920. }
  11921. reqHeaders.Set("User-Agent", c.s.userAgent())
  11922. var body io.Reader = nil
  11923. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2activatejobtriggerrequest)
  11924. if err != nil {
  11925. return nil, err
  11926. }
  11927. reqHeaders.Set("Content-Type", "application/json")
  11928. c.urlParams_.Set("alt", alt)
  11929. c.urlParams_.Set("prettyPrint", "false")
  11930. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:activate")
  11931. urls += "?" + c.urlParams_.Encode()
  11932. req, err := http.NewRequest("POST", urls, body)
  11933. if err != nil {
  11934. return nil, err
  11935. }
  11936. req.Header = reqHeaders
  11937. googleapi.Expand(req.URL, map[string]string{
  11938. "name": c.name,
  11939. })
  11940. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11941. }
  11942. // Do executes the "dlp.projects.jobTriggers.activate" call.
  11943. // Exactly one of *GooglePrivacyDlpV2DlpJob or error will be non-nil.
  11944. // Any non-2xx status code is an error. Response headers are in either
  11945. // *GooglePrivacyDlpV2DlpJob.ServerResponse.Header or (if a response was
  11946. // returned at all) in error.(*googleapi.Error).Header. Use
  11947. // googleapi.IsNotModified to check whether the returned error was
  11948. // because http.StatusNotModified was returned.
  11949. func (c *ProjectsJobTriggersActivateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2DlpJob, error) {
  11950. gensupport.SetOptions(c.urlParams_, opts...)
  11951. res, err := c.doRequest("json")
  11952. if res != nil && res.StatusCode == http.StatusNotModified {
  11953. if res.Body != nil {
  11954. res.Body.Close()
  11955. }
  11956. return nil, &googleapi.Error{
  11957. Code: res.StatusCode,
  11958. Header: res.Header,
  11959. }
  11960. }
  11961. if err != nil {
  11962. return nil, err
  11963. }
  11964. defer googleapi.CloseBody(res)
  11965. if err := googleapi.CheckResponse(res); err != nil {
  11966. return nil, err
  11967. }
  11968. ret := &GooglePrivacyDlpV2DlpJob{
  11969. ServerResponse: googleapi.ServerResponse{
  11970. Header: res.Header,
  11971. HTTPStatusCode: res.StatusCode,
  11972. },
  11973. }
  11974. target := &ret
  11975. if err := gensupport.DecodeResponse(target, res); err != nil {
  11976. return nil, err
  11977. }
  11978. return ret, nil
  11979. // {
  11980. // "description": "Activate a job trigger. Causes the immediate execute of a trigger\ninstead of waiting on the trigger event to occur.",
  11981. // "flatPath": "v2/projects/{projectsId}/jobTriggers/{jobTriggersId}:activate",
  11982. // "httpMethod": "POST",
  11983. // "id": "dlp.projects.jobTriggers.activate",
  11984. // "parameterOrder": [
  11985. // "name"
  11986. // ],
  11987. // "parameters": {
  11988. // "name": {
  11989. // "description": "Resource name of the trigger to activate, for example\n`projects/dlp-test-project/jobTriggers/53234423`.",
  11990. // "location": "path",
  11991. // "pattern": "^projects/[^/]+/jobTriggers/[^/]+$",
  11992. // "required": true,
  11993. // "type": "string"
  11994. // }
  11995. // },
  11996. // "path": "v2/{+name}:activate",
  11997. // "request": {
  11998. // "$ref": "GooglePrivacyDlpV2ActivateJobTriggerRequest"
  11999. // },
  12000. // "response": {
  12001. // "$ref": "GooglePrivacyDlpV2DlpJob"
  12002. // },
  12003. // "scopes": [
  12004. // "https://www.googleapis.com/auth/cloud-platform"
  12005. // ]
  12006. // }
  12007. }
  12008. // method id "dlp.projects.jobTriggers.create":
  12009. type ProjectsJobTriggersCreateCall struct {
  12010. s *Service
  12011. parent string
  12012. googleprivacydlpv2createjobtriggerrequest *GooglePrivacyDlpV2CreateJobTriggerRequest
  12013. urlParams_ gensupport.URLParams
  12014. ctx_ context.Context
  12015. header_ http.Header
  12016. }
  12017. // Create: Creates a job trigger to run DLP actions such as scanning
  12018. // storage for
  12019. // sensitive information on a set schedule.
  12020. // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn
  12021. // more.
  12022. func (r *ProjectsJobTriggersService) Create(parent string, googleprivacydlpv2createjobtriggerrequest *GooglePrivacyDlpV2CreateJobTriggerRequest) *ProjectsJobTriggersCreateCall {
  12023. c := &ProjectsJobTriggersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12024. c.parent = parent
  12025. c.googleprivacydlpv2createjobtriggerrequest = googleprivacydlpv2createjobtriggerrequest
  12026. return c
  12027. }
  12028. // Fields allows partial responses to be retrieved. See
  12029. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12030. // for more information.
  12031. func (c *ProjectsJobTriggersCreateCall) Fields(s ...googleapi.Field) *ProjectsJobTriggersCreateCall {
  12032. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12033. return c
  12034. }
  12035. // Context sets the context to be used in this call's Do method. Any
  12036. // pending HTTP request will be aborted if the provided context is
  12037. // canceled.
  12038. func (c *ProjectsJobTriggersCreateCall) Context(ctx context.Context) *ProjectsJobTriggersCreateCall {
  12039. c.ctx_ = ctx
  12040. return c
  12041. }
  12042. // Header returns an http.Header that can be modified by the caller to
  12043. // add HTTP headers to the request.
  12044. func (c *ProjectsJobTriggersCreateCall) Header() http.Header {
  12045. if c.header_ == nil {
  12046. c.header_ = make(http.Header)
  12047. }
  12048. return c.header_
  12049. }
  12050. func (c *ProjectsJobTriggersCreateCall) doRequest(alt string) (*http.Response, error) {
  12051. reqHeaders := make(http.Header)
  12052. for k, v := range c.header_ {
  12053. reqHeaders[k] = v
  12054. }
  12055. reqHeaders.Set("User-Agent", c.s.userAgent())
  12056. var body io.Reader = nil
  12057. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createjobtriggerrequest)
  12058. if err != nil {
  12059. return nil, err
  12060. }
  12061. reqHeaders.Set("Content-Type", "application/json")
  12062. c.urlParams_.Set("alt", alt)
  12063. c.urlParams_.Set("prettyPrint", "false")
  12064. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/jobTriggers")
  12065. urls += "?" + c.urlParams_.Encode()
  12066. req, err := http.NewRequest("POST", urls, body)
  12067. if err != nil {
  12068. return nil, err
  12069. }
  12070. req.Header = reqHeaders
  12071. googleapi.Expand(req.URL, map[string]string{
  12072. "parent": c.parent,
  12073. })
  12074. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12075. }
  12076. // Do executes the "dlp.projects.jobTriggers.create" call.
  12077. // Exactly one of *GooglePrivacyDlpV2JobTrigger or error will be
  12078. // non-nil. Any non-2xx status code is an error. Response headers are in
  12079. // either *GooglePrivacyDlpV2JobTrigger.ServerResponse.Header or (if a
  12080. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12081. // googleapi.IsNotModified to check whether the returned error was
  12082. // because http.StatusNotModified was returned.
  12083. func (c *ProjectsJobTriggersCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2JobTrigger, error) {
  12084. gensupport.SetOptions(c.urlParams_, opts...)
  12085. res, err := c.doRequest("json")
  12086. if res != nil && res.StatusCode == http.StatusNotModified {
  12087. if res.Body != nil {
  12088. res.Body.Close()
  12089. }
  12090. return nil, &googleapi.Error{
  12091. Code: res.StatusCode,
  12092. Header: res.Header,
  12093. }
  12094. }
  12095. if err != nil {
  12096. return nil, err
  12097. }
  12098. defer googleapi.CloseBody(res)
  12099. if err := googleapi.CheckResponse(res); err != nil {
  12100. return nil, err
  12101. }
  12102. ret := &GooglePrivacyDlpV2JobTrigger{
  12103. ServerResponse: googleapi.ServerResponse{
  12104. Header: res.Header,
  12105. HTTPStatusCode: res.StatusCode,
  12106. },
  12107. }
  12108. target := &ret
  12109. if err := gensupport.DecodeResponse(target, res); err != nil {
  12110. return nil, err
  12111. }
  12112. return ret, nil
  12113. // {
  12114. // "description": "Creates a job trigger to run DLP actions such as scanning storage for\nsensitive information on a set schedule.\nSee https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.",
  12115. // "flatPath": "v2/projects/{projectsId}/jobTriggers",
  12116. // "httpMethod": "POST",
  12117. // "id": "dlp.projects.jobTriggers.create",
  12118. // "parameterOrder": [
  12119. // "parent"
  12120. // ],
  12121. // "parameters": {
  12122. // "parent": {
  12123. // "description": "The parent resource name, for example projects/my-project-id.",
  12124. // "location": "path",
  12125. // "pattern": "^projects/[^/]+$",
  12126. // "required": true,
  12127. // "type": "string"
  12128. // }
  12129. // },
  12130. // "path": "v2/{+parent}/jobTriggers",
  12131. // "request": {
  12132. // "$ref": "GooglePrivacyDlpV2CreateJobTriggerRequest"
  12133. // },
  12134. // "response": {
  12135. // "$ref": "GooglePrivacyDlpV2JobTrigger"
  12136. // },
  12137. // "scopes": [
  12138. // "https://www.googleapis.com/auth/cloud-platform"
  12139. // ]
  12140. // }
  12141. }
  12142. // method id "dlp.projects.jobTriggers.delete":
  12143. type ProjectsJobTriggersDeleteCall struct {
  12144. s *Service
  12145. name string
  12146. urlParams_ gensupport.URLParams
  12147. ctx_ context.Context
  12148. header_ http.Header
  12149. }
  12150. // Delete: Deletes a job trigger.
  12151. // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn
  12152. // more.
  12153. func (r *ProjectsJobTriggersService) Delete(name string) *ProjectsJobTriggersDeleteCall {
  12154. c := &ProjectsJobTriggersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12155. c.name = name
  12156. return c
  12157. }
  12158. // Fields allows partial responses to be retrieved. See
  12159. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12160. // for more information.
  12161. func (c *ProjectsJobTriggersDeleteCall) Fields(s ...googleapi.Field) *ProjectsJobTriggersDeleteCall {
  12162. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12163. return c
  12164. }
  12165. // Context sets the context to be used in this call's Do method. Any
  12166. // pending HTTP request will be aborted if the provided context is
  12167. // canceled.
  12168. func (c *ProjectsJobTriggersDeleteCall) Context(ctx context.Context) *ProjectsJobTriggersDeleteCall {
  12169. c.ctx_ = ctx
  12170. return c
  12171. }
  12172. // Header returns an http.Header that can be modified by the caller to
  12173. // add HTTP headers to the request.
  12174. func (c *ProjectsJobTriggersDeleteCall) Header() http.Header {
  12175. if c.header_ == nil {
  12176. c.header_ = make(http.Header)
  12177. }
  12178. return c.header_
  12179. }
  12180. func (c *ProjectsJobTriggersDeleteCall) doRequest(alt string) (*http.Response, error) {
  12181. reqHeaders := make(http.Header)
  12182. for k, v := range c.header_ {
  12183. reqHeaders[k] = v
  12184. }
  12185. reqHeaders.Set("User-Agent", c.s.userAgent())
  12186. var body io.Reader = nil
  12187. c.urlParams_.Set("alt", alt)
  12188. c.urlParams_.Set("prettyPrint", "false")
  12189. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  12190. urls += "?" + c.urlParams_.Encode()
  12191. req, err := http.NewRequest("DELETE", urls, body)
  12192. if err != nil {
  12193. return nil, err
  12194. }
  12195. req.Header = reqHeaders
  12196. googleapi.Expand(req.URL, map[string]string{
  12197. "name": c.name,
  12198. })
  12199. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12200. }
  12201. // Do executes the "dlp.projects.jobTriggers.delete" call.
  12202. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  12203. // non-2xx status code is an error. Response headers are in either
  12204. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  12205. // returned at all) in error.(*googleapi.Error).Header. Use
  12206. // googleapi.IsNotModified to check whether the returned error was
  12207. // because http.StatusNotModified was returned.
  12208. func (c *ProjectsJobTriggersDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  12209. gensupport.SetOptions(c.urlParams_, opts...)
  12210. res, err := c.doRequest("json")
  12211. if res != nil && res.StatusCode == http.StatusNotModified {
  12212. if res.Body != nil {
  12213. res.Body.Close()
  12214. }
  12215. return nil, &googleapi.Error{
  12216. Code: res.StatusCode,
  12217. Header: res.Header,
  12218. }
  12219. }
  12220. if err != nil {
  12221. return nil, err
  12222. }
  12223. defer googleapi.CloseBody(res)
  12224. if err := googleapi.CheckResponse(res); err != nil {
  12225. return nil, err
  12226. }
  12227. ret := &GoogleProtobufEmpty{
  12228. ServerResponse: googleapi.ServerResponse{
  12229. Header: res.Header,
  12230. HTTPStatusCode: res.StatusCode,
  12231. },
  12232. }
  12233. target := &ret
  12234. if err := gensupport.DecodeResponse(target, res); err != nil {
  12235. return nil, err
  12236. }
  12237. return ret, nil
  12238. // {
  12239. // "description": "Deletes a job trigger.\nSee https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.",
  12240. // "flatPath": "v2/projects/{projectsId}/jobTriggers/{jobTriggersId}",
  12241. // "httpMethod": "DELETE",
  12242. // "id": "dlp.projects.jobTriggers.delete",
  12243. // "parameterOrder": [
  12244. // "name"
  12245. // ],
  12246. // "parameters": {
  12247. // "name": {
  12248. // "description": "Resource name of the project and the triggeredJob, for example\n`projects/dlp-test-project/jobTriggers/53234423`.",
  12249. // "location": "path",
  12250. // "pattern": "^projects/[^/]+/jobTriggers/[^/]+$",
  12251. // "required": true,
  12252. // "type": "string"
  12253. // }
  12254. // },
  12255. // "path": "v2/{+name}",
  12256. // "response": {
  12257. // "$ref": "GoogleProtobufEmpty"
  12258. // },
  12259. // "scopes": [
  12260. // "https://www.googleapis.com/auth/cloud-platform"
  12261. // ]
  12262. // }
  12263. }
  12264. // method id "dlp.projects.jobTriggers.get":
  12265. type ProjectsJobTriggersGetCall struct {
  12266. s *Service
  12267. name string
  12268. urlParams_ gensupport.URLParams
  12269. ifNoneMatch_ string
  12270. ctx_ context.Context
  12271. header_ http.Header
  12272. }
  12273. // Get: Gets a job trigger.
  12274. // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn
  12275. // more.
  12276. func (r *ProjectsJobTriggersService) Get(name string) *ProjectsJobTriggersGetCall {
  12277. c := &ProjectsJobTriggersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12278. c.name = name
  12279. return c
  12280. }
  12281. // Fields allows partial responses to be retrieved. See
  12282. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12283. // for more information.
  12284. func (c *ProjectsJobTriggersGetCall) Fields(s ...googleapi.Field) *ProjectsJobTriggersGetCall {
  12285. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12286. return c
  12287. }
  12288. // IfNoneMatch sets the optional parameter which makes the operation
  12289. // fail if the object's ETag matches the given value. This is useful for
  12290. // getting updates only after the object has changed since the last
  12291. // request. Use googleapi.IsNotModified to check whether the response
  12292. // error from Do is the result of In-None-Match.
  12293. func (c *ProjectsJobTriggersGetCall) IfNoneMatch(entityTag string) *ProjectsJobTriggersGetCall {
  12294. c.ifNoneMatch_ = entityTag
  12295. return c
  12296. }
  12297. // Context sets the context to be used in this call's Do method. Any
  12298. // pending HTTP request will be aborted if the provided context is
  12299. // canceled.
  12300. func (c *ProjectsJobTriggersGetCall) Context(ctx context.Context) *ProjectsJobTriggersGetCall {
  12301. c.ctx_ = ctx
  12302. return c
  12303. }
  12304. // Header returns an http.Header that can be modified by the caller to
  12305. // add HTTP headers to the request.
  12306. func (c *ProjectsJobTriggersGetCall) Header() http.Header {
  12307. if c.header_ == nil {
  12308. c.header_ = make(http.Header)
  12309. }
  12310. return c.header_
  12311. }
  12312. func (c *ProjectsJobTriggersGetCall) doRequest(alt string) (*http.Response, error) {
  12313. reqHeaders := make(http.Header)
  12314. for k, v := range c.header_ {
  12315. reqHeaders[k] = v
  12316. }
  12317. reqHeaders.Set("User-Agent", c.s.userAgent())
  12318. if c.ifNoneMatch_ != "" {
  12319. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12320. }
  12321. var body io.Reader = nil
  12322. c.urlParams_.Set("alt", alt)
  12323. c.urlParams_.Set("prettyPrint", "false")
  12324. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  12325. urls += "?" + c.urlParams_.Encode()
  12326. req, err := http.NewRequest("GET", urls, body)
  12327. if err != nil {
  12328. return nil, err
  12329. }
  12330. req.Header = reqHeaders
  12331. googleapi.Expand(req.URL, map[string]string{
  12332. "name": c.name,
  12333. })
  12334. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12335. }
  12336. // Do executes the "dlp.projects.jobTriggers.get" call.
  12337. // Exactly one of *GooglePrivacyDlpV2JobTrigger or error will be
  12338. // non-nil. Any non-2xx status code is an error. Response headers are in
  12339. // either *GooglePrivacyDlpV2JobTrigger.ServerResponse.Header or (if a
  12340. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12341. // googleapi.IsNotModified to check whether the returned error was
  12342. // because http.StatusNotModified was returned.
  12343. func (c *ProjectsJobTriggersGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2JobTrigger, error) {
  12344. gensupport.SetOptions(c.urlParams_, opts...)
  12345. res, err := c.doRequest("json")
  12346. if res != nil && res.StatusCode == http.StatusNotModified {
  12347. if res.Body != nil {
  12348. res.Body.Close()
  12349. }
  12350. return nil, &googleapi.Error{
  12351. Code: res.StatusCode,
  12352. Header: res.Header,
  12353. }
  12354. }
  12355. if err != nil {
  12356. return nil, err
  12357. }
  12358. defer googleapi.CloseBody(res)
  12359. if err := googleapi.CheckResponse(res); err != nil {
  12360. return nil, err
  12361. }
  12362. ret := &GooglePrivacyDlpV2JobTrigger{
  12363. ServerResponse: googleapi.ServerResponse{
  12364. Header: res.Header,
  12365. HTTPStatusCode: res.StatusCode,
  12366. },
  12367. }
  12368. target := &ret
  12369. if err := gensupport.DecodeResponse(target, res); err != nil {
  12370. return nil, err
  12371. }
  12372. return ret, nil
  12373. // {
  12374. // "description": "Gets a job trigger.\nSee https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.",
  12375. // "flatPath": "v2/projects/{projectsId}/jobTriggers/{jobTriggersId}",
  12376. // "httpMethod": "GET",
  12377. // "id": "dlp.projects.jobTriggers.get",
  12378. // "parameterOrder": [
  12379. // "name"
  12380. // ],
  12381. // "parameters": {
  12382. // "name": {
  12383. // "description": "Resource name of the project and the triggeredJob, for example\n`projects/dlp-test-project/jobTriggers/53234423`.",
  12384. // "location": "path",
  12385. // "pattern": "^projects/[^/]+/jobTriggers/[^/]+$",
  12386. // "required": true,
  12387. // "type": "string"
  12388. // }
  12389. // },
  12390. // "path": "v2/{+name}",
  12391. // "response": {
  12392. // "$ref": "GooglePrivacyDlpV2JobTrigger"
  12393. // },
  12394. // "scopes": [
  12395. // "https://www.googleapis.com/auth/cloud-platform"
  12396. // ]
  12397. // }
  12398. }
  12399. // method id "dlp.projects.jobTriggers.list":
  12400. type ProjectsJobTriggersListCall struct {
  12401. s *Service
  12402. parent string
  12403. urlParams_ gensupport.URLParams
  12404. ifNoneMatch_ string
  12405. ctx_ context.Context
  12406. header_ http.Header
  12407. }
  12408. // List: Lists job triggers.
  12409. // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn
  12410. // more.
  12411. func (r *ProjectsJobTriggersService) List(parent string) *ProjectsJobTriggersListCall {
  12412. c := &ProjectsJobTriggersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12413. c.parent = parent
  12414. return c
  12415. }
  12416. // Filter sets the optional parameter "filter": Allows
  12417. // filtering.
  12418. //
  12419. // Supported syntax:
  12420. //
  12421. // * Filter expressions are made up of one or more restrictions.
  12422. // * Restrictions can be combined by `AND` or `OR` logical operators.
  12423. // A
  12424. // sequence of restrictions implicitly uses `AND`.
  12425. // * A restriction has the form of `<field> <operator> <value>`.
  12426. // * Supported fields/values for inspect jobs:
  12427. // - `status` - HEALTHY|PAUSED|CANCELLED
  12428. // - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY
  12429. // - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by
  12430. // quotation marks. Nanoseconds are ignored.
  12431. // - 'error_count' - Number of errors that have occurred while
  12432. // running.
  12433. // * The operator must be `=` or `!=` for status and
  12434. // inspected_storage.
  12435. //
  12436. // Examples:
  12437. //
  12438. // * inspected_storage = cloud_storage AND status = HEALTHY
  12439. // * inspected_storage = cloud_storage OR inspected_storage = bigquery
  12440. // * inspected_storage = cloud_storage AND (state = PAUSED OR state =
  12441. // HEALTHY)
  12442. // * last_run_time > \"2017-12-12T00:00:00+00:00\"
  12443. //
  12444. // The length of this field should be no more than 500 characters.
  12445. func (c *ProjectsJobTriggersListCall) Filter(filter string) *ProjectsJobTriggersListCall {
  12446. c.urlParams_.Set("filter", filter)
  12447. return c
  12448. }
  12449. // OrderBy sets the optional parameter "orderBy": Optional comma
  12450. // separated list of triggeredJob fields to order by,
  12451. // followed by `asc` or `desc` postfix. This list is
  12452. // case-insensitive,
  12453. // default sorting order is ascending, redundant space characters
  12454. // are
  12455. // insignificant.
  12456. //
  12457. // Example: `name asc,update_time, create_time desc`
  12458. //
  12459. // Supported fields are:
  12460. //
  12461. // - `create_time`: corresponds to time the JobTrigger was created.
  12462. // - `update_time`: corresponds to time the JobTrigger was last
  12463. // updated.
  12464. // - `last_run_time`: corresponds to the last time the JobTrigger ran.
  12465. // - `name`: corresponds to JobTrigger's name.
  12466. // - `display_name`: corresponds to JobTrigger's display name.
  12467. // - `status`: corresponds to JobTrigger's status.
  12468. func (c *ProjectsJobTriggersListCall) OrderBy(orderBy string) *ProjectsJobTriggersListCall {
  12469. c.urlParams_.Set("orderBy", orderBy)
  12470. return c
  12471. }
  12472. // PageSize sets the optional parameter "pageSize": Optional size of the
  12473. // page, can be limited by a server.
  12474. func (c *ProjectsJobTriggersListCall) PageSize(pageSize int64) *ProjectsJobTriggersListCall {
  12475. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  12476. return c
  12477. }
  12478. // PageToken sets the optional parameter "pageToken": Optional page
  12479. // token to continue retrieval. Comes from previous call
  12480. // to ListJobTriggers. `order_by` field must not
  12481. // change for subsequent calls.
  12482. func (c *ProjectsJobTriggersListCall) PageToken(pageToken string) *ProjectsJobTriggersListCall {
  12483. c.urlParams_.Set("pageToken", pageToken)
  12484. return c
  12485. }
  12486. // Fields allows partial responses to be retrieved. See
  12487. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12488. // for more information.
  12489. func (c *ProjectsJobTriggersListCall) Fields(s ...googleapi.Field) *ProjectsJobTriggersListCall {
  12490. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12491. return c
  12492. }
  12493. // IfNoneMatch sets the optional parameter which makes the operation
  12494. // fail if the object's ETag matches the given value. This is useful for
  12495. // getting updates only after the object has changed since the last
  12496. // request. Use googleapi.IsNotModified to check whether the response
  12497. // error from Do is the result of In-None-Match.
  12498. func (c *ProjectsJobTriggersListCall) IfNoneMatch(entityTag string) *ProjectsJobTriggersListCall {
  12499. c.ifNoneMatch_ = entityTag
  12500. return c
  12501. }
  12502. // Context sets the context to be used in this call's Do method. Any
  12503. // pending HTTP request will be aborted if the provided context is
  12504. // canceled.
  12505. func (c *ProjectsJobTriggersListCall) Context(ctx context.Context) *ProjectsJobTriggersListCall {
  12506. c.ctx_ = ctx
  12507. return c
  12508. }
  12509. // Header returns an http.Header that can be modified by the caller to
  12510. // add HTTP headers to the request.
  12511. func (c *ProjectsJobTriggersListCall) Header() http.Header {
  12512. if c.header_ == nil {
  12513. c.header_ = make(http.Header)
  12514. }
  12515. return c.header_
  12516. }
  12517. func (c *ProjectsJobTriggersListCall) doRequest(alt string) (*http.Response, error) {
  12518. reqHeaders := make(http.Header)
  12519. for k, v := range c.header_ {
  12520. reqHeaders[k] = v
  12521. }
  12522. reqHeaders.Set("User-Agent", c.s.userAgent())
  12523. if c.ifNoneMatch_ != "" {
  12524. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12525. }
  12526. var body io.Reader = nil
  12527. c.urlParams_.Set("alt", alt)
  12528. c.urlParams_.Set("prettyPrint", "false")
  12529. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/jobTriggers")
  12530. urls += "?" + c.urlParams_.Encode()
  12531. req, err := http.NewRequest("GET", urls, body)
  12532. if err != nil {
  12533. return nil, err
  12534. }
  12535. req.Header = reqHeaders
  12536. googleapi.Expand(req.URL, map[string]string{
  12537. "parent": c.parent,
  12538. })
  12539. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12540. }
  12541. // Do executes the "dlp.projects.jobTriggers.list" call.
  12542. // Exactly one of *GooglePrivacyDlpV2ListJobTriggersResponse or error
  12543. // will be non-nil. Any non-2xx status code is an error. Response
  12544. // headers are in either
  12545. // *GooglePrivacyDlpV2ListJobTriggersResponse.ServerResponse.Header or
  12546. // (if a response was returned at all) in
  12547. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  12548. // whether the returned error was because http.StatusNotModified was
  12549. // returned.
  12550. func (c *ProjectsJobTriggersListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListJobTriggersResponse, error) {
  12551. gensupport.SetOptions(c.urlParams_, opts...)
  12552. res, err := c.doRequest("json")
  12553. if res != nil && res.StatusCode == http.StatusNotModified {
  12554. if res.Body != nil {
  12555. res.Body.Close()
  12556. }
  12557. return nil, &googleapi.Error{
  12558. Code: res.StatusCode,
  12559. Header: res.Header,
  12560. }
  12561. }
  12562. if err != nil {
  12563. return nil, err
  12564. }
  12565. defer googleapi.CloseBody(res)
  12566. if err := googleapi.CheckResponse(res); err != nil {
  12567. return nil, err
  12568. }
  12569. ret := &GooglePrivacyDlpV2ListJobTriggersResponse{
  12570. ServerResponse: googleapi.ServerResponse{
  12571. Header: res.Header,
  12572. HTTPStatusCode: res.StatusCode,
  12573. },
  12574. }
  12575. target := &ret
  12576. if err := gensupport.DecodeResponse(target, res); err != nil {
  12577. return nil, err
  12578. }
  12579. return ret, nil
  12580. // {
  12581. // "description": "Lists job triggers.\nSee https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.",
  12582. // "flatPath": "v2/projects/{projectsId}/jobTriggers",
  12583. // "httpMethod": "GET",
  12584. // "id": "dlp.projects.jobTriggers.list",
  12585. // "parameterOrder": [
  12586. // "parent"
  12587. // ],
  12588. // "parameters": {
  12589. // "filter": {
  12590. // "description": "Optional. Allows filtering.\n\nSupported syntax:\n\n* Filter expressions are made up of one or more restrictions.\n* Restrictions can be combined by `AND` or `OR` logical operators. A\nsequence of restrictions implicitly uses `AND`.\n* A restriction has the form of `\u003cfield\u003e \u003coperator\u003e \u003cvalue\u003e`.\n* Supported fields/values for inspect jobs:\n - `status` - HEALTHY|PAUSED|CANCELLED\n - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY\n - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by\n quotation marks. Nanoseconds are ignored.\n - 'error_count' - Number of errors that have occurred while running.\n* The operator must be `=` or `!=` for status and inspected_storage.\n\nExamples:\n\n* inspected_storage = cloud_storage AND status = HEALTHY\n* inspected_storage = cloud_storage OR inspected_storage = bigquery\n* inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY)\n* last_run_time \u003e \\\"2017-12-12T00:00:00+00:00\\\"\n\nThe length of this field should be no more than 500 characters.",
  12591. // "location": "query",
  12592. // "type": "string"
  12593. // },
  12594. // "orderBy": {
  12595. // "description": "Optional comma separated list of triggeredJob fields to order by,\nfollowed by `asc` or `desc` postfix. This list is case-insensitive,\ndefault sorting order is ascending, redundant space characters are\ninsignificant.\n\nExample: `name asc,update_time, create_time desc`\n\nSupported fields are:\n\n- `create_time`: corresponds to time the JobTrigger was created.\n- `update_time`: corresponds to time the JobTrigger was last updated.\n- `last_run_time`: corresponds to the last time the JobTrigger ran.\n- `name`: corresponds to JobTrigger's name.\n- `display_name`: corresponds to JobTrigger's display name.\n- `status`: corresponds to JobTrigger's status.",
  12596. // "location": "query",
  12597. // "type": "string"
  12598. // },
  12599. // "pageSize": {
  12600. // "description": "Optional size of the page, can be limited by a server.",
  12601. // "format": "int32",
  12602. // "location": "query",
  12603. // "type": "integer"
  12604. // },
  12605. // "pageToken": {
  12606. // "description": "Optional page token to continue retrieval. Comes from previous call\nto ListJobTriggers. `order_by` field must not\nchange for subsequent calls.",
  12607. // "location": "query",
  12608. // "type": "string"
  12609. // },
  12610. // "parent": {
  12611. // "description": "The parent resource name, for example `projects/my-project-id`.",
  12612. // "location": "path",
  12613. // "pattern": "^projects/[^/]+$",
  12614. // "required": true,
  12615. // "type": "string"
  12616. // }
  12617. // },
  12618. // "path": "v2/{+parent}/jobTriggers",
  12619. // "response": {
  12620. // "$ref": "GooglePrivacyDlpV2ListJobTriggersResponse"
  12621. // },
  12622. // "scopes": [
  12623. // "https://www.googleapis.com/auth/cloud-platform"
  12624. // ]
  12625. // }
  12626. }
  12627. // Pages invokes f for each page of results.
  12628. // A non-nil error returned from f will halt the iteration.
  12629. // The provided context supersedes any context provided to the Context method.
  12630. func (c *ProjectsJobTriggersListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListJobTriggersResponse) error) error {
  12631. c.ctx_ = ctx
  12632. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12633. for {
  12634. x, err := c.Do()
  12635. if err != nil {
  12636. return err
  12637. }
  12638. if err := f(x); err != nil {
  12639. return err
  12640. }
  12641. if x.NextPageToken == "" {
  12642. return nil
  12643. }
  12644. c.PageToken(x.NextPageToken)
  12645. }
  12646. }
  12647. // method id "dlp.projects.jobTriggers.patch":
  12648. type ProjectsJobTriggersPatchCall struct {
  12649. s *Service
  12650. name string
  12651. googleprivacydlpv2updatejobtriggerrequest *GooglePrivacyDlpV2UpdateJobTriggerRequest
  12652. urlParams_ gensupport.URLParams
  12653. ctx_ context.Context
  12654. header_ http.Header
  12655. }
  12656. // Patch: Updates a job trigger.
  12657. // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn
  12658. // more.
  12659. func (r *ProjectsJobTriggersService) Patch(name string, googleprivacydlpv2updatejobtriggerrequest *GooglePrivacyDlpV2UpdateJobTriggerRequest) *ProjectsJobTriggersPatchCall {
  12660. c := &ProjectsJobTriggersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12661. c.name = name
  12662. c.googleprivacydlpv2updatejobtriggerrequest = googleprivacydlpv2updatejobtriggerrequest
  12663. return c
  12664. }
  12665. // Fields allows partial responses to be retrieved. See
  12666. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12667. // for more information.
  12668. func (c *ProjectsJobTriggersPatchCall) Fields(s ...googleapi.Field) *ProjectsJobTriggersPatchCall {
  12669. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12670. return c
  12671. }
  12672. // Context sets the context to be used in this call's Do method. Any
  12673. // pending HTTP request will be aborted if the provided context is
  12674. // canceled.
  12675. func (c *ProjectsJobTriggersPatchCall) Context(ctx context.Context) *ProjectsJobTriggersPatchCall {
  12676. c.ctx_ = ctx
  12677. return c
  12678. }
  12679. // Header returns an http.Header that can be modified by the caller to
  12680. // add HTTP headers to the request.
  12681. func (c *ProjectsJobTriggersPatchCall) Header() http.Header {
  12682. if c.header_ == nil {
  12683. c.header_ = make(http.Header)
  12684. }
  12685. return c.header_
  12686. }
  12687. func (c *ProjectsJobTriggersPatchCall) doRequest(alt string) (*http.Response, error) {
  12688. reqHeaders := make(http.Header)
  12689. for k, v := range c.header_ {
  12690. reqHeaders[k] = v
  12691. }
  12692. reqHeaders.Set("User-Agent", c.s.userAgent())
  12693. var body io.Reader = nil
  12694. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatejobtriggerrequest)
  12695. if err != nil {
  12696. return nil, err
  12697. }
  12698. reqHeaders.Set("Content-Type", "application/json")
  12699. c.urlParams_.Set("alt", alt)
  12700. c.urlParams_.Set("prettyPrint", "false")
  12701. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  12702. urls += "?" + c.urlParams_.Encode()
  12703. req, err := http.NewRequest("PATCH", urls, body)
  12704. if err != nil {
  12705. return nil, err
  12706. }
  12707. req.Header = reqHeaders
  12708. googleapi.Expand(req.URL, map[string]string{
  12709. "name": c.name,
  12710. })
  12711. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12712. }
  12713. // Do executes the "dlp.projects.jobTriggers.patch" call.
  12714. // Exactly one of *GooglePrivacyDlpV2JobTrigger or error will be
  12715. // non-nil. Any non-2xx status code is an error. Response headers are in
  12716. // either *GooglePrivacyDlpV2JobTrigger.ServerResponse.Header or (if a
  12717. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12718. // googleapi.IsNotModified to check whether the returned error was
  12719. // because http.StatusNotModified was returned.
  12720. func (c *ProjectsJobTriggersPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2JobTrigger, error) {
  12721. gensupport.SetOptions(c.urlParams_, opts...)
  12722. res, err := c.doRequest("json")
  12723. if res != nil && res.StatusCode == http.StatusNotModified {
  12724. if res.Body != nil {
  12725. res.Body.Close()
  12726. }
  12727. return nil, &googleapi.Error{
  12728. Code: res.StatusCode,
  12729. Header: res.Header,
  12730. }
  12731. }
  12732. if err != nil {
  12733. return nil, err
  12734. }
  12735. defer googleapi.CloseBody(res)
  12736. if err := googleapi.CheckResponse(res); err != nil {
  12737. return nil, err
  12738. }
  12739. ret := &GooglePrivacyDlpV2JobTrigger{
  12740. ServerResponse: googleapi.ServerResponse{
  12741. Header: res.Header,
  12742. HTTPStatusCode: res.StatusCode,
  12743. },
  12744. }
  12745. target := &ret
  12746. if err := gensupport.DecodeResponse(target, res); err != nil {
  12747. return nil, err
  12748. }
  12749. return ret, nil
  12750. // {
  12751. // "description": "Updates a job trigger.\nSee https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.",
  12752. // "flatPath": "v2/projects/{projectsId}/jobTriggers/{jobTriggersId}",
  12753. // "httpMethod": "PATCH",
  12754. // "id": "dlp.projects.jobTriggers.patch",
  12755. // "parameterOrder": [
  12756. // "name"
  12757. // ],
  12758. // "parameters": {
  12759. // "name": {
  12760. // "description": "Resource name of the project and the triggeredJob, for example\n`projects/dlp-test-project/jobTriggers/53234423`.",
  12761. // "location": "path",
  12762. // "pattern": "^projects/[^/]+/jobTriggers/[^/]+$",
  12763. // "required": true,
  12764. // "type": "string"
  12765. // }
  12766. // },
  12767. // "path": "v2/{+name}",
  12768. // "request": {
  12769. // "$ref": "GooglePrivacyDlpV2UpdateJobTriggerRequest"
  12770. // },
  12771. // "response": {
  12772. // "$ref": "GooglePrivacyDlpV2JobTrigger"
  12773. // },
  12774. // "scopes": [
  12775. // "https://www.googleapis.com/auth/cloud-platform"
  12776. // ]
  12777. // }
  12778. }
  12779. // method id "dlp.projects.storedInfoTypes.create":
  12780. type ProjectsStoredInfoTypesCreateCall struct {
  12781. s *Service
  12782. parent string
  12783. googleprivacydlpv2createstoredinfotyperequest *GooglePrivacyDlpV2CreateStoredInfoTypeRequest
  12784. urlParams_ gensupport.URLParams
  12785. ctx_ context.Context
  12786. header_ http.Header
  12787. }
  12788. // Create: Creates a pre-built stored infoType to be used for
  12789. // inspection.
  12790. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes
  12791. // to
  12792. // learn more.
  12793. func (r *ProjectsStoredInfoTypesService) Create(parent string, googleprivacydlpv2createstoredinfotyperequest *GooglePrivacyDlpV2CreateStoredInfoTypeRequest) *ProjectsStoredInfoTypesCreateCall {
  12794. c := &ProjectsStoredInfoTypesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12795. c.parent = parent
  12796. c.googleprivacydlpv2createstoredinfotyperequest = googleprivacydlpv2createstoredinfotyperequest
  12797. return c
  12798. }
  12799. // Fields allows partial responses to be retrieved. See
  12800. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12801. // for more information.
  12802. func (c *ProjectsStoredInfoTypesCreateCall) Fields(s ...googleapi.Field) *ProjectsStoredInfoTypesCreateCall {
  12803. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12804. return c
  12805. }
  12806. // Context sets the context to be used in this call's Do method. Any
  12807. // pending HTTP request will be aborted if the provided context is
  12808. // canceled.
  12809. func (c *ProjectsStoredInfoTypesCreateCall) Context(ctx context.Context) *ProjectsStoredInfoTypesCreateCall {
  12810. c.ctx_ = ctx
  12811. return c
  12812. }
  12813. // Header returns an http.Header that can be modified by the caller to
  12814. // add HTTP headers to the request.
  12815. func (c *ProjectsStoredInfoTypesCreateCall) Header() http.Header {
  12816. if c.header_ == nil {
  12817. c.header_ = make(http.Header)
  12818. }
  12819. return c.header_
  12820. }
  12821. func (c *ProjectsStoredInfoTypesCreateCall) doRequest(alt string) (*http.Response, error) {
  12822. reqHeaders := make(http.Header)
  12823. for k, v := range c.header_ {
  12824. reqHeaders[k] = v
  12825. }
  12826. reqHeaders.Set("User-Agent", c.s.userAgent())
  12827. var body io.Reader = nil
  12828. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2createstoredinfotyperequest)
  12829. if err != nil {
  12830. return nil, err
  12831. }
  12832. reqHeaders.Set("Content-Type", "application/json")
  12833. c.urlParams_.Set("alt", alt)
  12834. c.urlParams_.Set("prettyPrint", "false")
  12835. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/storedInfoTypes")
  12836. urls += "?" + c.urlParams_.Encode()
  12837. req, err := http.NewRequest("POST", urls, body)
  12838. if err != nil {
  12839. return nil, err
  12840. }
  12841. req.Header = reqHeaders
  12842. googleapi.Expand(req.URL, map[string]string{
  12843. "parent": c.parent,
  12844. })
  12845. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12846. }
  12847. // Do executes the "dlp.projects.storedInfoTypes.create" call.
  12848. // Exactly one of *GooglePrivacyDlpV2StoredInfoType or error will be
  12849. // non-nil. Any non-2xx status code is an error. Response headers are in
  12850. // either *GooglePrivacyDlpV2StoredInfoType.ServerResponse.Header or (if
  12851. // a response was returned at all) in error.(*googleapi.Error).Header.
  12852. // Use googleapi.IsNotModified to check whether the returned error was
  12853. // because http.StatusNotModified was returned.
  12854. func (c *ProjectsStoredInfoTypesCreateCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2StoredInfoType, error) {
  12855. gensupport.SetOptions(c.urlParams_, opts...)
  12856. res, err := c.doRequest("json")
  12857. if res != nil && res.StatusCode == http.StatusNotModified {
  12858. if res.Body != nil {
  12859. res.Body.Close()
  12860. }
  12861. return nil, &googleapi.Error{
  12862. Code: res.StatusCode,
  12863. Header: res.Header,
  12864. }
  12865. }
  12866. if err != nil {
  12867. return nil, err
  12868. }
  12869. defer googleapi.CloseBody(res)
  12870. if err := googleapi.CheckResponse(res); err != nil {
  12871. return nil, err
  12872. }
  12873. ret := &GooglePrivacyDlpV2StoredInfoType{
  12874. ServerResponse: googleapi.ServerResponse{
  12875. Header: res.Header,
  12876. HTTPStatusCode: res.StatusCode,
  12877. },
  12878. }
  12879. target := &ret
  12880. if err := gensupport.DecodeResponse(target, res); err != nil {
  12881. return nil, err
  12882. }
  12883. return ret, nil
  12884. // {
  12885. // "description": "Creates a pre-built stored infoType to be used for inspection.\nSee https://cloud.google.com/dlp/docs/creating-stored-infotypes to\nlearn more.",
  12886. // "flatPath": "v2/projects/{projectsId}/storedInfoTypes",
  12887. // "httpMethod": "POST",
  12888. // "id": "dlp.projects.storedInfoTypes.create",
  12889. // "parameterOrder": [
  12890. // "parent"
  12891. // ],
  12892. // "parameters": {
  12893. // "parent": {
  12894. // "description": "The parent resource name, for example projects/my-project-id or\norganizations/my-org-id.",
  12895. // "location": "path",
  12896. // "pattern": "^projects/[^/]+$",
  12897. // "required": true,
  12898. // "type": "string"
  12899. // }
  12900. // },
  12901. // "path": "v2/{+parent}/storedInfoTypes",
  12902. // "request": {
  12903. // "$ref": "GooglePrivacyDlpV2CreateStoredInfoTypeRequest"
  12904. // },
  12905. // "response": {
  12906. // "$ref": "GooglePrivacyDlpV2StoredInfoType"
  12907. // },
  12908. // "scopes": [
  12909. // "https://www.googleapis.com/auth/cloud-platform"
  12910. // ]
  12911. // }
  12912. }
  12913. // method id "dlp.projects.storedInfoTypes.delete":
  12914. type ProjectsStoredInfoTypesDeleteCall struct {
  12915. s *Service
  12916. name string
  12917. urlParams_ gensupport.URLParams
  12918. ctx_ context.Context
  12919. header_ http.Header
  12920. }
  12921. // Delete: Deletes a stored infoType.
  12922. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes
  12923. // to
  12924. // learn more.
  12925. func (r *ProjectsStoredInfoTypesService) Delete(name string) *ProjectsStoredInfoTypesDeleteCall {
  12926. c := &ProjectsStoredInfoTypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12927. c.name = name
  12928. return c
  12929. }
  12930. // Fields allows partial responses to be retrieved. See
  12931. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12932. // for more information.
  12933. func (c *ProjectsStoredInfoTypesDeleteCall) Fields(s ...googleapi.Field) *ProjectsStoredInfoTypesDeleteCall {
  12934. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12935. return c
  12936. }
  12937. // Context sets the context to be used in this call's Do method. Any
  12938. // pending HTTP request will be aborted if the provided context is
  12939. // canceled.
  12940. func (c *ProjectsStoredInfoTypesDeleteCall) Context(ctx context.Context) *ProjectsStoredInfoTypesDeleteCall {
  12941. c.ctx_ = ctx
  12942. return c
  12943. }
  12944. // Header returns an http.Header that can be modified by the caller to
  12945. // add HTTP headers to the request.
  12946. func (c *ProjectsStoredInfoTypesDeleteCall) Header() http.Header {
  12947. if c.header_ == nil {
  12948. c.header_ = make(http.Header)
  12949. }
  12950. return c.header_
  12951. }
  12952. func (c *ProjectsStoredInfoTypesDeleteCall) doRequest(alt string) (*http.Response, error) {
  12953. reqHeaders := make(http.Header)
  12954. for k, v := range c.header_ {
  12955. reqHeaders[k] = v
  12956. }
  12957. reqHeaders.Set("User-Agent", c.s.userAgent())
  12958. var body io.Reader = nil
  12959. c.urlParams_.Set("alt", alt)
  12960. c.urlParams_.Set("prettyPrint", "false")
  12961. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  12962. urls += "?" + c.urlParams_.Encode()
  12963. req, err := http.NewRequest("DELETE", urls, body)
  12964. if err != nil {
  12965. return nil, err
  12966. }
  12967. req.Header = reqHeaders
  12968. googleapi.Expand(req.URL, map[string]string{
  12969. "name": c.name,
  12970. })
  12971. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12972. }
  12973. // Do executes the "dlp.projects.storedInfoTypes.delete" call.
  12974. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  12975. // non-2xx status code is an error. Response headers are in either
  12976. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  12977. // returned at all) in error.(*googleapi.Error).Header. Use
  12978. // googleapi.IsNotModified to check whether the returned error was
  12979. // because http.StatusNotModified was returned.
  12980. func (c *ProjectsStoredInfoTypesDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  12981. gensupport.SetOptions(c.urlParams_, opts...)
  12982. res, err := c.doRequest("json")
  12983. if res != nil && res.StatusCode == http.StatusNotModified {
  12984. if res.Body != nil {
  12985. res.Body.Close()
  12986. }
  12987. return nil, &googleapi.Error{
  12988. Code: res.StatusCode,
  12989. Header: res.Header,
  12990. }
  12991. }
  12992. if err != nil {
  12993. return nil, err
  12994. }
  12995. defer googleapi.CloseBody(res)
  12996. if err := googleapi.CheckResponse(res); err != nil {
  12997. return nil, err
  12998. }
  12999. ret := &GoogleProtobufEmpty{
  13000. ServerResponse: googleapi.ServerResponse{
  13001. Header: res.Header,
  13002. HTTPStatusCode: res.StatusCode,
  13003. },
  13004. }
  13005. target := &ret
  13006. if err := gensupport.DecodeResponse(target, res); err != nil {
  13007. return nil, err
  13008. }
  13009. return ret, nil
  13010. // {
  13011. // "description": "Deletes a stored infoType.\nSee https://cloud.google.com/dlp/docs/creating-stored-infotypes to\nlearn more.",
  13012. // "flatPath": "v2/projects/{projectsId}/storedInfoTypes/{storedInfoTypesId}",
  13013. // "httpMethod": "DELETE",
  13014. // "id": "dlp.projects.storedInfoTypes.delete",
  13015. // "parameterOrder": [
  13016. // "name"
  13017. // ],
  13018. // "parameters": {
  13019. // "name": {
  13020. // "description": "Resource name of the organization and storedInfoType to be deleted, for\nexample `organizations/433245324/storedInfoTypes/432452342` or\nprojects/project-id/storedInfoTypes/432452342.",
  13021. // "location": "path",
  13022. // "pattern": "^projects/[^/]+/storedInfoTypes/[^/]+$",
  13023. // "required": true,
  13024. // "type": "string"
  13025. // }
  13026. // },
  13027. // "path": "v2/{+name}",
  13028. // "response": {
  13029. // "$ref": "GoogleProtobufEmpty"
  13030. // },
  13031. // "scopes": [
  13032. // "https://www.googleapis.com/auth/cloud-platform"
  13033. // ]
  13034. // }
  13035. }
  13036. // method id "dlp.projects.storedInfoTypes.get":
  13037. type ProjectsStoredInfoTypesGetCall struct {
  13038. s *Service
  13039. name string
  13040. urlParams_ gensupport.URLParams
  13041. ifNoneMatch_ string
  13042. ctx_ context.Context
  13043. header_ http.Header
  13044. }
  13045. // Get: Gets a stored infoType.
  13046. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes
  13047. // to
  13048. // learn more.
  13049. func (r *ProjectsStoredInfoTypesService) Get(name string) *ProjectsStoredInfoTypesGetCall {
  13050. c := &ProjectsStoredInfoTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13051. c.name = name
  13052. return c
  13053. }
  13054. // Fields allows partial responses to be retrieved. See
  13055. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13056. // for more information.
  13057. func (c *ProjectsStoredInfoTypesGetCall) Fields(s ...googleapi.Field) *ProjectsStoredInfoTypesGetCall {
  13058. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13059. return c
  13060. }
  13061. // IfNoneMatch sets the optional parameter which makes the operation
  13062. // fail if the object's ETag matches the given value. This is useful for
  13063. // getting updates only after the object has changed since the last
  13064. // request. Use googleapi.IsNotModified to check whether the response
  13065. // error from Do is the result of In-None-Match.
  13066. func (c *ProjectsStoredInfoTypesGetCall) IfNoneMatch(entityTag string) *ProjectsStoredInfoTypesGetCall {
  13067. c.ifNoneMatch_ = entityTag
  13068. return c
  13069. }
  13070. // Context sets the context to be used in this call's Do method. Any
  13071. // pending HTTP request will be aborted if the provided context is
  13072. // canceled.
  13073. func (c *ProjectsStoredInfoTypesGetCall) Context(ctx context.Context) *ProjectsStoredInfoTypesGetCall {
  13074. c.ctx_ = ctx
  13075. return c
  13076. }
  13077. // Header returns an http.Header that can be modified by the caller to
  13078. // add HTTP headers to the request.
  13079. func (c *ProjectsStoredInfoTypesGetCall) Header() http.Header {
  13080. if c.header_ == nil {
  13081. c.header_ = make(http.Header)
  13082. }
  13083. return c.header_
  13084. }
  13085. func (c *ProjectsStoredInfoTypesGetCall) doRequest(alt string) (*http.Response, error) {
  13086. reqHeaders := make(http.Header)
  13087. for k, v := range c.header_ {
  13088. reqHeaders[k] = v
  13089. }
  13090. reqHeaders.Set("User-Agent", c.s.userAgent())
  13091. if c.ifNoneMatch_ != "" {
  13092. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13093. }
  13094. var body io.Reader = nil
  13095. c.urlParams_.Set("alt", alt)
  13096. c.urlParams_.Set("prettyPrint", "false")
  13097. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  13098. urls += "?" + c.urlParams_.Encode()
  13099. req, err := http.NewRequest("GET", urls, body)
  13100. if err != nil {
  13101. return nil, err
  13102. }
  13103. req.Header = reqHeaders
  13104. googleapi.Expand(req.URL, map[string]string{
  13105. "name": c.name,
  13106. })
  13107. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13108. }
  13109. // Do executes the "dlp.projects.storedInfoTypes.get" call.
  13110. // Exactly one of *GooglePrivacyDlpV2StoredInfoType or error will be
  13111. // non-nil. Any non-2xx status code is an error. Response headers are in
  13112. // either *GooglePrivacyDlpV2StoredInfoType.ServerResponse.Header or (if
  13113. // a response was returned at all) in error.(*googleapi.Error).Header.
  13114. // Use googleapi.IsNotModified to check whether the returned error was
  13115. // because http.StatusNotModified was returned.
  13116. func (c *ProjectsStoredInfoTypesGetCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2StoredInfoType, error) {
  13117. gensupport.SetOptions(c.urlParams_, opts...)
  13118. res, err := c.doRequest("json")
  13119. if res != nil && res.StatusCode == http.StatusNotModified {
  13120. if res.Body != nil {
  13121. res.Body.Close()
  13122. }
  13123. return nil, &googleapi.Error{
  13124. Code: res.StatusCode,
  13125. Header: res.Header,
  13126. }
  13127. }
  13128. if err != nil {
  13129. return nil, err
  13130. }
  13131. defer googleapi.CloseBody(res)
  13132. if err := googleapi.CheckResponse(res); err != nil {
  13133. return nil, err
  13134. }
  13135. ret := &GooglePrivacyDlpV2StoredInfoType{
  13136. ServerResponse: googleapi.ServerResponse{
  13137. Header: res.Header,
  13138. HTTPStatusCode: res.StatusCode,
  13139. },
  13140. }
  13141. target := &ret
  13142. if err := gensupport.DecodeResponse(target, res); err != nil {
  13143. return nil, err
  13144. }
  13145. return ret, nil
  13146. // {
  13147. // "description": "Gets a stored infoType.\nSee https://cloud.google.com/dlp/docs/creating-stored-infotypes to\nlearn more.",
  13148. // "flatPath": "v2/projects/{projectsId}/storedInfoTypes/{storedInfoTypesId}",
  13149. // "httpMethod": "GET",
  13150. // "id": "dlp.projects.storedInfoTypes.get",
  13151. // "parameterOrder": [
  13152. // "name"
  13153. // ],
  13154. // "parameters": {
  13155. // "name": {
  13156. // "description": "Resource name of the organization and storedInfoType to be read, for\nexample `organizations/433245324/storedInfoTypes/432452342` or\nprojects/project-id/storedInfoTypes/432452342.",
  13157. // "location": "path",
  13158. // "pattern": "^projects/[^/]+/storedInfoTypes/[^/]+$",
  13159. // "required": true,
  13160. // "type": "string"
  13161. // }
  13162. // },
  13163. // "path": "v2/{+name}",
  13164. // "response": {
  13165. // "$ref": "GooglePrivacyDlpV2StoredInfoType"
  13166. // },
  13167. // "scopes": [
  13168. // "https://www.googleapis.com/auth/cloud-platform"
  13169. // ]
  13170. // }
  13171. }
  13172. // method id "dlp.projects.storedInfoTypes.list":
  13173. type ProjectsStoredInfoTypesListCall struct {
  13174. s *Service
  13175. parent string
  13176. urlParams_ gensupport.URLParams
  13177. ifNoneMatch_ string
  13178. ctx_ context.Context
  13179. header_ http.Header
  13180. }
  13181. // List: Lists stored infoTypes.
  13182. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes
  13183. // to
  13184. // learn more.
  13185. func (r *ProjectsStoredInfoTypesService) List(parent string) *ProjectsStoredInfoTypesListCall {
  13186. c := &ProjectsStoredInfoTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13187. c.parent = parent
  13188. return c
  13189. }
  13190. // OrderBy sets the optional parameter "orderBy": Optional comma
  13191. // separated list of fields to order by,
  13192. // followed by `asc` or `desc` postfix. This list is
  13193. // case-insensitive,
  13194. // default sorting order is ascending, redundant space characters
  13195. // are
  13196. // insignificant.
  13197. //
  13198. // Example: `name asc, display_name, create_time desc`
  13199. //
  13200. // Supported fields are:
  13201. //
  13202. // - `create_time`: corresponds to time the most recent version of
  13203. // the
  13204. // resource was created.
  13205. // - `state`: corresponds to the state of the resource.
  13206. // - `name`: corresponds to resource name.
  13207. // - `display_name`: corresponds to info type's display name.
  13208. func (c *ProjectsStoredInfoTypesListCall) OrderBy(orderBy string) *ProjectsStoredInfoTypesListCall {
  13209. c.urlParams_.Set("orderBy", orderBy)
  13210. return c
  13211. }
  13212. // PageSize sets the optional parameter "pageSize": Optional size of the
  13213. // page, can be limited by server. If zero server returns
  13214. // a page of max size 100.
  13215. func (c *ProjectsStoredInfoTypesListCall) PageSize(pageSize int64) *ProjectsStoredInfoTypesListCall {
  13216. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  13217. return c
  13218. }
  13219. // PageToken sets the optional parameter "pageToken": Optional page
  13220. // token to continue retrieval. Comes from previous call
  13221. // to `ListStoredInfoTypes`.
  13222. func (c *ProjectsStoredInfoTypesListCall) PageToken(pageToken string) *ProjectsStoredInfoTypesListCall {
  13223. c.urlParams_.Set("pageToken", pageToken)
  13224. return c
  13225. }
  13226. // Fields allows partial responses to be retrieved. See
  13227. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13228. // for more information.
  13229. func (c *ProjectsStoredInfoTypesListCall) Fields(s ...googleapi.Field) *ProjectsStoredInfoTypesListCall {
  13230. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13231. return c
  13232. }
  13233. // IfNoneMatch sets the optional parameter which makes the operation
  13234. // fail if the object's ETag matches the given value. This is useful for
  13235. // getting updates only after the object has changed since the last
  13236. // request. Use googleapi.IsNotModified to check whether the response
  13237. // error from Do is the result of In-None-Match.
  13238. func (c *ProjectsStoredInfoTypesListCall) IfNoneMatch(entityTag string) *ProjectsStoredInfoTypesListCall {
  13239. c.ifNoneMatch_ = entityTag
  13240. return c
  13241. }
  13242. // Context sets the context to be used in this call's Do method. Any
  13243. // pending HTTP request will be aborted if the provided context is
  13244. // canceled.
  13245. func (c *ProjectsStoredInfoTypesListCall) Context(ctx context.Context) *ProjectsStoredInfoTypesListCall {
  13246. c.ctx_ = ctx
  13247. return c
  13248. }
  13249. // Header returns an http.Header that can be modified by the caller to
  13250. // add HTTP headers to the request.
  13251. func (c *ProjectsStoredInfoTypesListCall) Header() http.Header {
  13252. if c.header_ == nil {
  13253. c.header_ = make(http.Header)
  13254. }
  13255. return c.header_
  13256. }
  13257. func (c *ProjectsStoredInfoTypesListCall) doRequest(alt string) (*http.Response, error) {
  13258. reqHeaders := make(http.Header)
  13259. for k, v := range c.header_ {
  13260. reqHeaders[k] = v
  13261. }
  13262. reqHeaders.Set("User-Agent", c.s.userAgent())
  13263. if c.ifNoneMatch_ != "" {
  13264. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13265. }
  13266. var body io.Reader = nil
  13267. c.urlParams_.Set("alt", alt)
  13268. c.urlParams_.Set("prettyPrint", "false")
  13269. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/storedInfoTypes")
  13270. urls += "?" + c.urlParams_.Encode()
  13271. req, err := http.NewRequest("GET", urls, body)
  13272. if err != nil {
  13273. return nil, err
  13274. }
  13275. req.Header = reqHeaders
  13276. googleapi.Expand(req.URL, map[string]string{
  13277. "parent": c.parent,
  13278. })
  13279. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13280. }
  13281. // Do executes the "dlp.projects.storedInfoTypes.list" call.
  13282. // Exactly one of *GooglePrivacyDlpV2ListStoredInfoTypesResponse or
  13283. // error will be non-nil. Any non-2xx status code is an error. Response
  13284. // headers are in either
  13285. // *GooglePrivacyDlpV2ListStoredInfoTypesResponse.ServerResponse.Header
  13286. // or (if a response was returned at all) in
  13287. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13288. // whether the returned error was because http.StatusNotModified was
  13289. // returned.
  13290. func (c *ProjectsStoredInfoTypesListCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2ListStoredInfoTypesResponse, error) {
  13291. gensupport.SetOptions(c.urlParams_, opts...)
  13292. res, err := c.doRequest("json")
  13293. if res != nil && res.StatusCode == http.StatusNotModified {
  13294. if res.Body != nil {
  13295. res.Body.Close()
  13296. }
  13297. return nil, &googleapi.Error{
  13298. Code: res.StatusCode,
  13299. Header: res.Header,
  13300. }
  13301. }
  13302. if err != nil {
  13303. return nil, err
  13304. }
  13305. defer googleapi.CloseBody(res)
  13306. if err := googleapi.CheckResponse(res); err != nil {
  13307. return nil, err
  13308. }
  13309. ret := &GooglePrivacyDlpV2ListStoredInfoTypesResponse{
  13310. ServerResponse: googleapi.ServerResponse{
  13311. Header: res.Header,
  13312. HTTPStatusCode: res.StatusCode,
  13313. },
  13314. }
  13315. target := &ret
  13316. if err := gensupport.DecodeResponse(target, res); err != nil {
  13317. return nil, err
  13318. }
  13319. return ret, nil
  13320. // {
  13321. // "description": "Lists stored infoTypes.\nSee https://cloud.google.com/dlp/docs/creating-stored-infotypes to\nlearn more.",
  13322. // "flatPath": "v2/projects/{projectsId}/storedInfoTypes",
  13323. // "httpMethod": "GET",
  13324. // "id": "dlp.projects.storedInfoTypes.list",
  13325. // "parameterOrder": [
  13326. // "parent"
  13327. // ],
  13328. // "parameters": {
  13329. // "orderBy": {
  13330. // "description": "Optional comma separated list of fields to order by,\nfollowed by `asc` or `desc` postfix. This list is case-insensitive,\ndefault sorting order is ascending, redundant space characters are\ninsignificant.\n\nExample: `name asc, display_name, create_time desc`\n\nSupported fields are:\n\n- `create_time`: corresponds to time the most recent version of the\nresource was created.\n- `state`: corresponds to the state of the resource.\n- `name`: corresponds to resource name.\n- `display_name`: corresponds to info type's display name.",
  13331. // "location": "query",
  13332. // "type": "string"
  13333. // },
  13334. // "pageSize": {
  13335. // "description": "Optional size of the page, can be limited by server. If zero server returns\na page of max size 100.",
  13336. // "format": "int32",
  13337. // "location": "query",
  13338. // "type": "integer"
  13339. // },
  13340. // "pageToken": {
  13341. // "description": "Optional page token to continue retrieval. Comes from previous call\nto `ListStoredInfoTypes`.",
  13342. // "location": "query",
  13343. // "type": "string"
  13344. // },
  13345. // "parent": {
  13346. // "description": "The parent resource name, for example projects/my-project-id or\norganizations/my-org-id.",
  13347. // "location": "path",
  13348. // "pattern": "^projects/[^/]+$",
  13349. // "required": true,
  13350. // "type": "string"
  13351. // }
  13352. // },
  13353. // "path": "v2/{+parent}/storedInfoTypes",
  13354. // "response": {
  13355. // "$ref": "GooglePrivacyDlpV2ListStoredInfoTypesResponse"
  13356. // },
  13357. // "scopes": [
  13358. // "https://www.googleapis.com/auth/cloud-platform"
  13359. // ]
  13360. // }
  13361. }
  13362. // Pages invokes f for each page of results.
  13363. // A non-nil error returned from f will halt the iteration.
  13364. // The provided context supersedes any context provided to the Context method.
  13365. func (c *ProjectsStoredInfoTypesListCall) Pages(ctx context.Context, f func(*GooglePrivacyDlpV2ListStoredInfoTypesResponse) error) error {
  13366. c.ctx_ = ctx
  13367. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13368. for {
  13369. x, err := c.Do()
  13370. if err != nil {
  13371. return err
  13372. }
  13373. if err := f(x); err != nil {
  13374. return err
  13375. }
  13376. if x.NextPageToken == "" {
  13377. return nil
  13378. }
  13379. c.PageToken(x.NextPageToken)
  13380. }
  13381. }
  13382. // method id "dlp.projects.storedInfoTypes.patch":
  13383. type ProjectsStoredInfoTypesPatchCall struct {
  13384. s *Service
  13385. name string
  13386. googleprivacydlpv2updatestoredinfotyperequest *GooglePrivacyDlpV2UpdateStoredInfoTypeRequest
  13387. urlParams_ gensupport.URLParams
  13388. ctx_ context.Context
  13389. header_ http.Header
  13390. }
  13391. // Patch: Updates the stored infoType by creating a new version. The
  13392. // existing version
  13393. // will continue to be used until the new version is ready.
  13394. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes
  13395. // to
  13396. // learn more.
  13397. func (r *ProjectsStoredInfoTypesService) Patch(name string, googleprivacydlpv2updatestoredinfotyperequest *GooglePrivacyDlpV2UpdateStoredInfoTypeRequest) *ProjectsStoredInfoTypesPatchCall {
  13398. c := &ProjectsStoredInfoTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13399. c.name = name
  13400. c.googleprivacydlpv2updatestoredinfotyperequest = googleprivacydlpv2updatestoredinfotyperequest
  13401. return c
  13402. }
  13403. // Fields allows partial responses to be retrieved. See
  13404. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13405. // for more information.
  13406. func (c *ProjectsStoredInfoTypesPatchCall) Fields(s ...googleapi.Field) *ProjectsStoredInfoTypesPatchCall {
  13407. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13408. return c
  13409. }
  13410. // Context sets the context to be used in this call's Do method. Any
  13411. // pending HTTP request will be aborted if the provided context is
  13412. // canceled.
  13413. func (c *ProjectsStoredInfoTypesPatchCall) Context(ctx context.Context) *ProjectsStoredInfoTypesPatchCall {
  13414. c.ctx_ = ctx
  13415. return c
  13416. }
  13417. // Header returns an http.Header that can be modified by the caller to
  13418. // add HTTP headers to the request.
  13419. func (c *ProjectsStoredInfoTypesPatchCall) Header() http.Header {
  13420. if c.header_ == nil {
  13421. c.header_ = make(http.Header)
  13422. }
  13423. return c.header_
  13424. }
  13425. func (c *ProjectsStoredInfoTypesPatchCall) doRequest(alt string) (*http.Response, error) {
  13426. reqHeaders := make(http.Header)
  13427. for k, v := range c.header_ {
  13428. reqHeaders[k] = v
  13429. }
  13430. reqHeaders.Set("User-Agent", c.s.userAgent())
  13431. var body io.Reader = nil
  13432. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleprivacydlpv2updatestoredinfotyperequest)
  13433. if err != nil {
  13434. return nil, err
  13435. }
  13436. reqHeaders.Set("Content-Type", "application/json")
  13437. c.urlParams_.Set("alt", alt)
  13438. c.urlParams_.Set("prettyPrint", "false")
  13439. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  13440. urls += "?" + c.urlParams_.Encode()
  13441. req, err := http.NewRequest("PATCH", urls, body)
  13442. if err != nil {
  13443. return nil, err
  13444. }
  13445. req.Header = reqHeaders
  13446. googleapi.Expand(req.URL, map[string]string{
  13447. "name": c.name,
  13448. })
  13449. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13450. }
  13451. // Do executes the "dlp.projects.storedInfoTypes.patch" call.
  13452. // Exactly one of *GooglePrivacyDlpV2StoredInfoType or error will be
  13453. // non-nil. Any non-2xx status code is an error. Response headers are in
  13454. // either *GooglePrivacyDlpV2StoredInfoType.ServerResponse.Header or (if
  13455. // a response was returned at all) in error.(*googleapi.Error).Header.
  13456. // Use googleapi.IsNotModified to check whether the returned error was
  13457. // because http.StatusNotModified was returned.
  13458. func (c *ProjectsStoredInfoTypesPatchCall) Do(opts ...googleapi.CallOption) (*GooglePrivacyDlpV2StoredInfoType, error) {
  13459. gensupport.SetOptions(c.urlParams_, opts...)
  13460. res, err := c.doRequest("json")
  13461. if res != nil && res.StatusCode == http.StatusNotModified {
  13462. if res.Body != nil {
  13463. res.Body.Close()
  13464. }
  13465. return nil, &googleapi.Error{
  13466. Code: res.StatusCode,
  13467. Header: res.Header,
  13468. }
  13469. }
  13470. if err != nil {
  13471. return nil, err
  13472. }
  13473. defer googleapi.CloseBody(res)
  13474. if err := googleapi.CheckResponse(res); err != nil {
  13475. return nil, err
  13476. }
  13477. ret := &GooglePrivacyDlpV2StoredInfoType{
  13478. ServerResponse: googleapi.ServerResponse{
  13479. Header: res.Header,
  13480. HTTPStatusCode: res.StatusCode,
  13481. },
  13482. }
  13483. target := &ret
  13484. if err := gensupport.DecodeResponse(target, res); err != nil {
  13485. return nil, err
  13486. }
  13487. return ret, nil
  13488. // {
  13489. // "description": "Updates the stored infoType by creating a new version. The existing version\nwill continue to be used until the new version is ready.\nSee https://cloud.google.com/dlp/docs/creating-stored-infotypes to\nlearn more.",
  13490. // "flatPath": "v2/projects/{projectsId}/storedInfoTypes/{storedInfoTypesId}",
  13491. // "httpMethod": "PATCH",
  13492. // "id": "dlp.projects.storedInfoTypes.patch",
  13493. // "parameterOrder": [
  13494. // "name"
  13495. // ],
  13496. // "parameters": {
  13497. // "name": {
  13498. // "description": "Resource name of organization and storedInfoType to be updated, for\nexample `organizations/433245324/storedInfoTypes/432452342` or\nprojects/project-id/storedInfoTypes/432452342.",
  13499. // "location": "path",
  13500. // "pattern": "^projects/[^/]+/storedInfoTypes/[^/]+$",
  13501. // "required": true,
  13502. // "type": "string"
  13503. // }
  13504. // },
  13505. // "path": "v2/{+name}",
  13506. // "request": {
  13507. // "$ref": "GooglePrivacyDlpV2UpdateStoredInfoTypeRequest"
  13508. // },
  13509. // "response": {
  13510. // "$ref": "GooglePrivacyDlpV2StoredInfoType"
  13511. // },
  13512. // "scopes": [
  13513. // "https://www.googleapis.com/auth/cloud-platform"
  13514. // ]
  13515. // }
  13516. }