@maxim_mazurok/gapi.client.cloudasset-v1 0.0.20221021 → 0.0.20221114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/index.d.ts +503 -5
  2. package/package.json +1 -1
  3. package/readme.md +20 -0
  4. package/tests.ts +57 -1
package/index.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
10
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
11
  // Generated from: https://cloudasset.googleapis.com/$discovery/rest?version=v1
12
- // Revision: 20221021
12
+ // Revision: 20221114
13
13
 
14
14
  /// <reference types="gapi.client" />
15
15
 
@@ -61,6 +61,60 @@ declare namespace gapi.client {
61
61
  /** The list of analyses returned from performing the intended resource move analysis. The analysis is grouped by different Cloud services. */
62
62
  moveAnalysis?: MoveAnalysis[];
63
63
  }
64
+ interface AnalyzeOrgPoliciesResponse {
65
+ /** The definition of the constraint in the request. */
66
+ constraint?: AnalyzerOrgPolicyConstraint;
67
+ /** The page token to fetch the next page for AnalyzeOrgPoliciesResponse.org_policy_results. */
68
+ nextPageToken?: string;
69
+ /** The organization policies under the AnalyzeOrgPoliciesRequest.scope with the AnalyzeOrgPoliciesRequest.constraint. */
70
+ orgPolicyResults?: OrgPolicyResult[];
71
+ }
72
+ interface AnalyzeOrgPolicyGovernedAssetsResponse {
73
+ /** The definition of the constraint in the request. */
74
+ constraint?: AnalyzerOrgPolicyConstraint;
75
+ /** The list of the analyzed governed assets. */
76
+ governedAssets?: GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedAsset[];
77
+ /** The page token to fetch the next page for AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets. */
78
+ nextPageToken?: string;
79
+ }
80
+ interface AnalyzeOrgPolicyGovernedContainersResponse {
81
+ /** The definition of the constraint in the request. */
82
+ constraint?: AnalyzerOrgPolicyConstraint;
83
+ /** The list of the analyzed governed containers. */
84
+ governedContainers?: GoogleCloudAssetV1GovernedContainer[];
85
+ /** The page token to fetch the next page for AnalyzeOrgPolicyGovernedContainersResponse.governed_containers. */
86
+ nextPageToken?: string;
87
+ }
88
+ interface AnalyzerOrgPolicy {
89
+ /**
90
+ * The [full resource name] (https://cloud.google.com/asset-inventory/docs/resource-name-format) of an organization/folder/project resource where this organization policy applies to.
91
+ * For any user defined org policies, this field has the same value as the [attached_resource] field. Only for default policy, this field has the different value.
92
+ */
93
+ appliedResource?: string;
94
+ /**
95
+ * The [full resource name] (https://cloud.google.com/asset-inventory/docs/resource-name-format) of an organization/folder/project resource where this organization policy is set.
96
+ * Notice that some type of constraints are defined with default policy. This field will be empty for them.
97
+ */
98
+ attachedResource?: string;
99
+ /**
100
+ * If `inherit_from_parent` is true, Rules set higher up in the hierarchy (up to the closest root) are inherited and present in the effective policy. If it is false, then no rules are
101
+ * inherited, and this policy becomes the effective root for evaluation.
102
+ */
103
+ inheritFromParent?: boolean;
104
+ /**
105
+ * Ignores policies set above this resource and restores the default behavior of the constraint at this resource. This field can be set in policies for either list or boolean
106
+ * constraints. If set, `rules` must be empty and `inherit_from_parent` must be set to false.
107
+ */
108
+ reset?: boolean;
109
+ /** List of rules for this organization policy. */
110
+ rules?: GoogleCloudAssetV1Rule[];
111
+ }
112
+ interface AnalyzerOrgPolicyConstraint {
113
+ /** The definition of the custom constraint. */
114
+ customConstraint?: GoogleCloudAssetV1CustomConstraint;
115
+ /** The definition of the canned constraint defined by Google. */
116
+ googleDefinedConstraint?: GoogleCloudAssetV1Constraint;
117
+ }
64
118
  interface Asset {
65
119
  /** Please also refer to the [access level user guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels). */
66
120
  accessLevel?: GoogleIdentityAccesscontextmanagerV1AccessLevel;
@@ -375,6 +429,64 @@ declare namespace gapi.client {
375
429
  /** The resources that match one of the following conditions: - The resource_selector, if it is specified in request; - Otherwise, resources reachable from the policy attached resource. */
376
430
  resources?: GoogleCloudAssetV1Resource[];
377
431
  }
432
+ interface GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedAsset {
433
+ /**
434
+ * The consolidated policy for the analyzed asset. The consolidated policy is computed by merging and evaluating AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.policy_bundle. The
435
+ * evaluation will respect the organization policy [hierarchy rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy).
436
+ */
437
+ consolidatedPolicy?: AnalyzerOrgPolicy;
438
+ /** An IAM policy governed by the organization policies of the AnalyzeOrgPolicyGovernedAssetsRequest.constraint. */
439
+ governedIamPolicy?: GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedIamPolicy;
440
+ /** A GCP resource governed by the organization policies of the AnalyzeOrgPolicyGovernedAssetsRequest.constraint. */
441
+ governedResource?: GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedResource;
442
+ /**
443
+ * The ordered list of all organization policies from the AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource to the scope specified in the request. If the
444
+ * constraint is defined with default policy, it will also appear in the list.
445
+ */
446
+ policyBundle?: AnalyzerOrgPolicy[];
447
+ }
448
+ interface GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedIamPolicy {
449
+ /**
450
+ * The full resource name of the resource associated with this IAM policy. Example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. See [Cloud Asset
451
+ * Inventory Resource Name Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) for more information.
452
+ */
453
+ attachedResource?: string;
454
+ /**
455
+ * The folder(s) that this IAM policy belongs to, in the form of folders/{FOLDER_NUMBER}. This field is available when the IAM policy belongs(directly or cascadingly) to one or more
456
+ * folders.
457
+ */
458
+ folders?: string[];
459
+ /**
460
+ * The organization that this IAM policy belongs to, in the form of organizations/{ORGANIZATION_NUMBER}. This field is available when the IAM policy belongs(directly or cascadingly) to
461
+ * an organization.
462
+ */
463
+ organization?: string;
464
+ /** The IAM policy directly set on the given resource. */
465
+ policy?: Policy;
466
+ /** The project that this IAM policy belongs to, in the form of projects/{PROJECT_NUMBER}. This field is available when the IAM policy belongs to a project. */
467
+ project?: string;
468
+ }
469
+ interface GoogleCloudAssetV1AnalyzeOrgPolicyGovernedAssetsResponseGovernedResource {
470
+ /**
471
+ * The folder(s) that this resource belongs to, in the form of folders/{FOLDER_NUMBER}. This field is available when the resource belongs(directly or cascadingly) to one or more
472
+ * folders.
473
+ */
474
+ folders?: string[];
475
+ /** The [full resource name] (https://cloud.google.com/asset-inventory/docs/resource-name-format) of the GCP resource. */
476
+ fullResourceName?: string;
477
+ /**
478
+ * The organization that this resource belongs to, in the form of organizations/{ORGANIZATION_NUMBER}. This field is available when the resource belongs(directly or cascadingly) to an
479
+ * organization.
480
+ */
481
+ organization?: string;
482
+ /**
483
+ * The [full resource name] (https://cloud.google.com/asset-inventory/docs/resource-name-format) of the parent of
484
+ * AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name.
485
+ */
486
+ parent?: string;
487
+ /** The project that this resource belongs to, in the form of projects/{PROJECT_NUMBER}. This field is available when the resource belongs to a project. */
488
+ project?: string;
489
+ }
378
490
  interface GoogleCloudAssetV1BigQueryDestination {
379
491
  /**
380
492
  * Required. The BigQuery dataset in format "projects/projectId/datasets/datasetId", to which the analysis results should be exported. If this dataset does not exist, the export call
@@ -397,6 +509,42 @@ declare namespace gapi.client {
397
509
  */
398
510
  writeDisposition?: string;
399
511
  }
512
+ // tslint:disable-next-line:no-empty-interface
513
+ interface GoogleCloudAssetV1BooleanConstraint {
514
+ }
515
+ interface GoogleCloudAssetV1Constraint {
516
+ /** Defines this constraint as being a BooleanConstraint. */
517
+ booleanConstraint?: any;
518
+ /** The evaluation behavior of this constraint in the absence of 'Policy'. */
519
+ constraintDefault?: string;
520
+ /** Detailed description of what this `Constraint` controls as well as how and where it is enforced. */
521
+ description?: string;
522
+ /** The human readable name of the constraint. */
523
+ displayName?: string;
524
+ /** Defines this constraint as being a ListConstraint. */
525
+ listConstraint?: GoogleCloudAssetV1ListConstraint;
526
+ /** The unique name of the constraint. Format of the name should be * `constraints/{constraint_name}` For example, `constraints/compute.disableSerialPortAccess`. */
527
+ name?: string;
528
+ }
529
+ interface GoogleCloudAssetV1CustomConstraint {
530
+ /** Allow or deny type. */
531
+ actionType?: string;
532
+ /** Organization policy condition/expression. For example: `resource.instanceName.matches("[production|test]_.*_(\d)+")'` or, `resource.management.auto_upgrade == true` */
533
+ condition?: string;
534
+ /** Detailed information about this custom policy constraint. */
535
+ description?: string;
536
+ /** One line display name for the UI. */
537
+ displayName?: string;
538
+ /** All the operations being applied for this constraint. */
539
+ methodTypes?: string[];
540
+ /**
541
+ * Name of the constraint. This is unique within the organization. Format of the name should be * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example :
542
+ * "organizations/123/customConstraints/custom.createOnlyE2TypeVms"
543
+ */
544
+ name?: string;
545
+ /** The Resource Instance type on which this policy applies to. Format will be of the form : "/" Example: * `compute.googleapis.com/Instance`. */
546
+ resourceTypes?: string[];
547
+ }
400
548
  interface GoogleCloudAssetV1Edge {
401
549
  /** The source node of the edge. For example, it could be a full resource name for a resource node or an email of an identity. */
402
550
  sourceNode?: string;
@@ -411,6 +559,26 @@ declare namespace gapi.client {
411
559
  */
412
560
  uri?: string;
413
561
  }
562
+ interface GoogleCloudAssetV1GovernedContainer {
563
+ /**
564
+ * The consolidated organization policy for the analyzed resource. The consolidated organization policy is computed by merging and evaluating
565
+ * AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.policy_bundle. The evaluation will respect the organization policy [hierarchy
566
+ * rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy).
567
+ */
568
+ consolidatedPolicy?: AnalyzerOrgPolicy;
569
+ /** The [full resource name] (https://cloud.google.com/asset-inventory/docs/resource-name-format) of an organization/folder/project resource. */
570
+ fullResourceName?: string;
571
+ /**
572
+ * The [full resource name] (https://cloud.google.com/asset-inventory/docs/resource-name-format) of the parent of
573
+ * AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.full_resource_name.
574
+ */
575
+ parent?: string;
576
+ /**
577
+ * The ordered list of all organization policies from the AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource. to the scope specified in the request. If
578
+ * the constraint is defined with default policy, it will also appear in the list.
579
+ */
580
+ policyBundle?: AnalyzerOrgPolicy[];
581
+ }
414
582
  interface GoogleCloudAssetV1Identity {
415
583
  /** The analysis state of this identity. */
416
584
  analysisState?: IamPolicyAnalysisState;
@@ -433,6 +601,18 @@ declare namespace gapi.client {
433
601
  */
434
602
  identities?: GoogleCloudAssetV1Identity[];
435
603
  }
604
+ interface GoogleCloudAssetV1ListConstraint {
605
+ /**
606
+ * Indicates whether values grouped into categories can be used in `Policy.allowed_values` and `Policy.denied_values`. For example, `"in:Python"` would match any value in the 'Python'
607
+ * group.
608
+ */
609
+ supportsIn?: boolean;
610
+ /**
611
+ * Indicates whether subtrees of Cloud Resource Manager resource hierarchy can be used in `Policy.allowed_values` and `Policy.denied_values`. For example, `"under:folders/123"` would
612
+ * match any resource under the 'folders/123' folder.
613
+ */
614
+ supportsUnder?: boolean;
615
+ }
436
616
  interface GoogleCloudAssetV1p7beta1Asset {
437
617
  /** Please also refer to the [access level user guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels). */
438
618
  accessLevel?: GoogleIdentityAccesscontextmanagerV1AccessLevel;
@@ -531,12 +711,42 @@ declare namespace gapi.client {
531
711
  /** The API version. Example: `v1` */
532
712
  version?: string;
533
713
  }
714
+ interface GoogleCloudAssetV1QueryAssetsOutputConfigBigQueryDestination {
715
+ /** Required. The BigQuery dataset where the query results will be saved. It has the format of "projects/{projectId}/datasets/{datasetId}". */
716
+ dataset?: string;
717
+ /** Required. The BigQuery table where the query results will be saved. If this table does not exist, a new table with the given name will be created. */
718
+ table?: string;
719
+ /**
720
+ * Specifies the action that occurs if the destination table or partition already exists. The following values are supported: * WRITE_TRUNCATE: If the table or partition already
721
+ * exists, BigQuery overwrites the entire table or all the partitions data. * WRITE_APPEND: If the table or partition already exists, BigQuery appends the data to the table or the
722
+ * latest partition. * WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY.
723
+ */
724
+ writeDisposition?: string;
725
+ }
534
726
  interface GoogleCloudAssetV1Resource {
535
727
  /** The analysis state of this resource. */
536
728
  analysisState?: IamPolicyAnalysisState;
537
729
  /** The [full resource name](https://cloud.google.com/asset-inventory/docs/resource-name-format) */
538
730
  fullResourceName?: string;
539
731
  }
732
+ interface GoogleCloudAssetV1Rule {
733
+ /** Setting this to true means that all values are allowed. This field can be set only in Policies for list constraints. */
734
+ allowAll?: boolean;
735
+ /** The evaluating condition for this rule. */
736
+ condition?: Expr;
737
+ /** Setting this to true means that all values are denied. This field can be set only in Policies for list constraints. */
738
+ denyAll?: boolean;
739
+ /** If `true`, then the `Policy` is enforced. If `false`, then any configuration is acceptable. This field can be set only in Policies for boolean constraints. */
740
+ enforce?: boolean;
741
+ /** List of values to be used for this PolicyRule. This field can be set only in Policies for list constraints. */
742
+ values?: GoogleCloudAssetV1StringValues;
743
+ }
744
+ interface GoogleCloudAssetV1StringValues {
745
+ /** List of values allowed at this resource. */
746
+ allowedValues?: string[];
747
+ /** List of values denied at this resource. */
748
+ deniedValues?: string[];
749
+ }
540
750
  interface GoogleCloudOrgpolicyV1BooleanPolicy {
541
751
  /**
542
752
  * If `true`, then the `Policy` is enforced. If `false`, then any configuration is acceptable. Suppose you have a `Constraint` `constraints/compute.disableSerialPortAccess` with
@@ -630,8 +840,8 @@ declare namespace gapi.client {
630
840
  /** Description of the `AccessLevel` and its use. Does not affect behavior. */
631
841
  description?: string;
632
842
  /**
633
- * Required. Resource name for the Access Level. The `short_name` component must begin with a letter and only include alphanumeric and '_'. Format:
634
- * `accessPolicies/{access_policy}/accessLevels/{access_level}`. The maximum length of the `access_level` component is 50 characters.
843
+ * Resource name for the `AccessLevel`. Format: `accessPolicies/{access_policy}/accessLevels/{access_level}`. The `access_level` component must begin with a letter, followed by
844
+ * alphanumeric characters or `_`. Its maximum length is 50 characters. After you create an `AccessLevel`, you cannot change its `name`.
635
845
  */
636
846
  name?: string;
637
847
  /** Human readable title. Must be unique within the Policy. */
@@ -819,8 +1029,8 @@ declare namespace gapi.client {
819
1029
  /** Description of the `ServicePerimeter` and its use. Does not affect behavior. */
820
1030
  description?: string;
821
1031
  /**
822
- * Required. Resource name for the ServicePerimeter. The `short_name` component must begin with a letter and only include alphanumeric and '_'. Format:
823
- * `accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}`
1032
+ * Resource name for the `ServicePerimeter`. Format: `accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}`. The `service_perimeter` component must begin with a letter,
1033
+ * followed by alphanumeric characters or `_`. After you create a `ServicePerimeter`, you cannot change its `name`.
824
1034
  */
825
1035
  name?: string;
826
1036
  /**
@@ -1113,6 +1323,18 @@ declare namespace gapi.client {
1113
1323
  /** Optional. If true, the result will output the relevant parent/child relationships between resources. Default is false. */
1114
1324
  outputResourceEdges?: boolean;
1115
1325
  }
1326
+ interface OrgPolicyResult {
1327
+ /**
1328
+ * The consolidated organization policy for the analyzed resource. The consolidated organization policy is computed by merging and evaluating AnalyzeOrgPoliciesResponse.policy_bundle.
1329
+ * The evaluation will respect the organization policy [hierarchy rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy).
1330
+ */
1331
+ consolidatedPolicy?: AnalyzerOrgPolicy;
1332
+ /**
1333
+ * The ordered list of all organization policies from the AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource. to the scope specified in the request. If
1334
+ * the constraint is defined with default policy, it will also appear in the list.
1335
+ */
1336
+ policyBundle?: AnalyzerOrgPolicy[];
1337
+ }
1116
1338
  interface OsInfo {
1117
1339
  /** The system architecture of the operating system. */
1118
1340
  architecture?: string;
@@ -1183,10 +1405,72 @@ declare namespace gapi.client {
1183
1405
  /** The name of the Pub/Sub topic to publish to. Example: `projects/PROJECT_ID/topics/TOPIC_ID`. */
1184
1406
  topic?: string;
1185
1407
  }
1408
+ interface QueryAssetsOutputConfig {
1409
+ /** BigQuery destination where the query results will be saved. */
1410
+ bigqueryDestination?: GoogleCloudAssetV1QueryAssetsOutputConfigBigQueryDestination;
1411
+ }
1412
+ interface QueryAssetsRequest {
1413
+ /** Optional. Reference to the query job, which is from the `QueryAssetsResponse` of previous `QueryAssets` call. */
1414
+ jobReference?: string;
1415
+ /**
1416
+ * Optional. Destination where the query results will be saved. When this field is specified, the query results won't be saved in the [QueryAssetsResponse.query_result]. Instead
1417
+ * [QueryAssetsResponse.output_config] will be set. Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used to check the status of the query job when passed to a
1418
+ * following [QueryAssets] API call.
1419
+ */
1420
+ outputConfig?: QueryAssetsOutputConfig;
1421
+ /**
1422
+ * Optional. The maximum number of rows to return in the results. Responses are limited to 10 MB and 1000 rows. By default, the maximum row count is 1000. When the byte or row count
1423
+ * limit is reached, the rest of the query results will be paginated. The field will be ignored when [output_config] is specified.
1424
+ */
1425
+ pageSize?: number;
1426
+ /** Optional. A page token received from previous `QueryAssets`. The field will be ignored when [output_config] is specified. */
1427
+ pageToken?: string;
1428
+ /** Optional. Queries cloud assets as they appeared at the specified point in time. */
1429
+ readTime?: string;
1430
+ /**
1431
+ * Optional. [start_time] is required. [start_time] must be less than [end_time] Defaults [end_time] to now if [start_time] is set and [end_time] isn't. Maximum permitted time range is
1432
+ * 7 days.
1433
+ */
1434
+ readTimeWindow?: TimeWindow;
1435
+ /** Optional. A SQL statement that's compatible with [BigQuery Standard SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql). */
1436
+ statement?: string;
1437
+ /**
1438
+ * Optional. Specifies the maximum amount of time that the client is willing to wait for the query to complete. By default, this limit is 5 min for the first query, and 1 minute for
1439
+ * the following queries. If the query is complete, the `done` field in the `QueryAssetsResponse` is true, otherwise false. Like BigQuery [jobs.query
1440
+ * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest) The call is not guaranteed to wait for the specified timeout; it typically returns after
1441
+ * around 200 seconds (200,000 milliseconds), even if the query is not complete. The field will be ignored when [output_config] is specified.
1442
+ */
1443
+ timeout?: string;
1444
+ }
1445
+ interface QueryAssetsResponse {
1446
+ /**
1447
+ * The query response, which can be either an `error` or a valid `response`. If `done` == `false` and the query result is being saved in a output, the output_config field will be set.
1448
+ * If `done` == `true`, exactly one of `error`, `query_result` or `output_config` will be set.
1449
+ */
1450
+ done?: boolean;
1451
+ /** Error status. */
1452
+ error?: Status;
1453
+ /** Reference to a query job. */
1454
+ jobReference?: string;
1455
+ /** Output configuration which indicates instead of being returned in API response on the fly, the query result will be saved in a specific output. */
1456
+ outputConfig?: QueryAssetsOutputConfig;
1457
+ /** Result of the query. */
1458
+ queryResult?: QueryResult;
1459
+ }
1186
1460
  interface QueryContent {
1187
1461
  /** An IAM Policy Analysis query, which could be used in the AssetService.AnalyzeIamPolicy rpc or the AssetService.AnalyzeIamPolicyLongrunning rpc. */
1188
1462
  iamPolicyAnalysisQuery?: IamPolicyAnalysisQuery;
1189
1463
  }
1464
+ interface QueryResult {
1465
+ /** Token to retrieve the next page of the results. */
1466
+ nextPageToken?: string;
1467
+ /** Each row hold a query result in the format of `Struct`. */
1468
+ rows?: Array<{ [P in string]: any }>;
1469
+ /** Describes the format of the [rows]. */
1470
+ schema?: TableSchema;
1471
+ /** Total rows of the whole query results. */
1472
+ totalRows?: string;
1473
+ }
1190
1474
  interface RelatedAsset {
1191
1475
  /**
1192
1476
  * The ancestors of an asset in Google Cloud [resource hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as a list of relative
@@ -1474,6 +1758,23 @@ declare namespace gapi.client {
1474
1758
  */
1475
1759
  message?: string;
1476
1760
  }
1761
+ interface TableFieldSchema {
1762
+ /** The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters. */
1763
+ field?: string;
1764
+ /** Describes the nested schema fields if the type property is set to RECORD. */
1765
+ fields?: TableFieldSchema[];
1766
+ /** The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE. */
1767
+ mode?: string;
1768
+ /**
1769
+ * The field data type. Possible values include * STRING * BYTES * INTEGER * FLOAT * BOOLEAN * TIMESTAMP * DATE * TIME * DATETIME * GEOGRAPHY, * NUMERIC, * BIGNUMERIC, * RECORD (where
1770
+ * RECORD indicates that the field contains a nested schema).
1771
+ */
1772
+ type?: string;
1773
+ }
1774
+ interface TableSchema {
1775
+ /** Describes the fields in a table. */
1776
+ fields?: TableFieldSchema[];
1777
+ }
1477
1778
  interface TemporalAsset {
1478
1779
  /** An asset in Google Cloud. */
1479
1780
  asset?: Asset;
@@ -2392,6 +2693,136 @@ declare namespace gapi.client {
2392
2693
  /** Analysis view indicating what information should be included in the analysis response. If unspecified, the default view is FULL. */
2393
2694
  view?: string;
2394
2695
  }): Request<AnalyzeMoveResponse>;
2696
+ /** Analyzes organization policies under a scope. */
2697
+ analyzeOrgPolicies(request?: {
2698
+ /** V1 error format. */
2699
+ "$.xgafv"?: string;
2700
+ /** OAuth access token. */
2701
+ access_token?: string;
2702
+ /** Data format for response. */
2703
+ alt?: string;
2704
+ /** JSONP */
2705
+ callback?: string;
2706
+ /** Required. The name of the constraint to analyze organization policies for. The response only contains analyzed organization policies for the provided constraint. */
2707
+ constraint?: string;
2708
+ /** Selector specifying which fields to include in a partial response. */
2709
+ fields?: string;
2710
+ /**
2711
+ * The expression to filter AnalyzeOrgPoliciesResponse.org_policy_results. The only supported field is `consolidated_policy.attached_resource`, and the only supported operator is
2712
+ * `=`. Example: consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001" will return the org policy results of"folders/001".
2713
+ */
2714
+ filter?: string;
2715
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
2716
+ key?: string;
2717
+ /** OAuth 2.0 token for the current user. */
2718
+ oauth_token?: string;
2719
+ /** The maximum number of items to return per page. If unspecified, AnalyzeOrgPoliciesResponse.org_policy_results will contain 20 items with a maximum of 200. */
2720
+ pageSize?: number;
2721
+ /** The pagination token to retrieve the next page. */
2722
+ pageToken?: string;
2723
+ /** Returns response with indentations and line breaks. */
2724
+ prettyPrint?: boolean;
2725
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
2726
+ quotaUser?: string;
2727
+ /**
2728
+ * Required. The organization to scope the request. Only organization policies within the scope will be analyzed. * organizations/{ORGANIZATION_NUMBER} (e.g.,
2729
+ * "organizations/123456")
2730
+ */
2731
+ scope: string;
2732
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
2733
+ upload_protocol?: string;
2734
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
2735
+ uploadType?: string;
2736
+ }): Request<AnalyzeOrgPoliciesResponse>;
2737
+ /**
2738
+ * Analyzes organization policies governed assets (GCP resources or policies) under a scope. This RPC supports custom constraints and the following 10 canned constraints: *
2739
+ * storage.uniformBucketLevelAccess * iam.disableServiceAccountKeyCreation * iam.allowedPolicyMemberDomains * compute.vmExternalIpAccess * appengine.enforceServiceAccountActAsCheck *
2740
+ * gcp.resourceLocations * compute.trustedImageProjects * compute.skipDefaultNetworkCreation * compute.requireOsLogin * compute.disableNestedVirtualization This RPC only returns
2741
+ * either: * resources of types supported by [searchable asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types), or * IAM policies.
2742
+ */
2743
+ analyzeOrgPolicyGovernedAssets(request?: {
2744
+ /** V1 error format. */
2745
+ "$.xgafv"?: string;
2746
+ /** OAuth access token. */
2747
+ access_token?: string;
2748
+ /** Data format for response. */
2749
+ alt?: string;
2750
+ /** JSONP */
2751
+ callback?: string;
2752
+ /** Required. The name of the constraint to analyze governed assets for. The analysis only contains analyzed organization policies for the provided constraint. */
2753
+ constraint?: string;
2754
+ /** Selector specifying which fields to include in a partial response. */
2755
+ fields?: string;
2756
+ /**
2757
+ * The expression to filter the governed assets in result. The only supported fields for governed resources are `governed_resource.project` and `governed_resource.folders`. The
2758
+ * only supported fields for governed iam policies are `governed_iam_policy.project` and `governed_iam_policy.folders`. The only supported operator is `=`. Example 1:
2759
+ * governed_resource.project="projects/12345678" filter will return all governed resources under projects/12345678 including the project ifself, if applicable. Example 2:
2760
+ * governed_iam_policy.folders="folders/12345678" filter will return all governed iam policies under folders/12345678, if applicable.
2761
+ */
2762
+ filter?: string;
2763
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
2764
+ key?: string;
2765
+ /** OAuth 2.0 token for the current user. */
2766
+ oauth_token?: string;
2767
+ /** The maximum number of items to return per page. If unspecified, AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets will contain 100 items with a maximum of 200. */
2768
+ pageSize?: number;
2769
+ /** The pagination token to retrieve the next page. */
2770
+ pageToken?: string;
2771
+ /** Returns response with indentations and line breaks. */
2772
+ prettyPrint?: boolean;
2773
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
2774
+ quotaUser?: string;
2775
+ /**
2776
+ * Required. The organization to scope the request. Only organization policies within the scope will be analyzed. The output assets will also be limited to the ones governed by
2777
+ * those in-scope organization policies. * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
2778
+ */
2779
+ scope: string;
2780
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
2781
+ upload_protocol?: string;
2782
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
2783
+ uploadType?: string;
2784
+ }): Request<AnalyzeOrgPolicyGovernedAssetsResponse>;
2785
+ /** Analyzes organization policies governed containers (projects, folders or organization) under a scope. */
2786
+ analyzeOrgPolicyGovernedContainers(request?: {
2787
+ /** V1 error format. */
2788
+ "$.xgafv"?: string;
2789
+ /** OAuth access token. */
2790
+ access_token?: string;
2791
+ /** Data format for response. */
2792
+ alt?: string;
2793
+ /** JSONP */
2794
+ callback?: string;
2795
+ /** Required. The name of the constraint to analyze governed containers for. The analysis only contains organization policies for the provided constraint. */
2796
+ constraint?: string;
2797
+ /** Selector specifying which fields to include in a partial response. */
2798
+ fields?: string;
2799
+ /**
2800
+ * The expression to filter the governed containers in result. The only supported field is `parent`, and the only supported operator is `=`. Example:
2801
+ * parent="//cloudresourcemanager.googleapis.com/folders/001" will return all containers under "folders/001".
2802
+ */
2803
+ filter?: string;
2804
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
2805
+ key?: string;
2806
+ /** OAuth 2.0 token for the current user. */
2807
+ oauth_token?: string;
2808
+ /** The maximum number of items to return per page. If unspecified, AnalyzeOrgPolicyGovernedContainersResponse.governed_containers will contain 100 items with a maximum of 200. */
2809
+ pageSize?: number;
2810
+ /** The pagination token to retrieve the next page. */
2811
+ pageToken?: string;
2812
+ /** Returns response with indentations and line breaks. */
2813
+ prettyPrint?: boolean;
2814
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
2815
+ quotaUser?: string;
2816
+ /**
2817
+ * Required. The organization to scope the request. Only organization policies within the scope will be analyzed. The output containers will also be limited to the ones governed by
2818
+ * those in-scope organization policies. * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
2819
+ */
2820
+ scope: string;
2821
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
2822
+ upload_protocol?: string;
2823
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
2824
+ uploadType?: string;
2825
+ }): Request<AnalyzeOrgPolicyGovernedContainersResponse>;
2395
2826
  /**
2396
2827
  * Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can
2397
2828
  * create gaps in the output history. Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset does not exist, this API returns an
@@ -2513,6 +2944,73 @@ declare namespace gapi.client {
2513
2944
  uploadType?: string;
2514
2945
  },
2515
2946
  body: ExportAssetsRequest): Request<Operation>;
2947
+ /**
2948
+ * Issue a job that queries assets using a SQL statement compatible with [BigQuery Standard SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql). If the query
2949
+ * execution finishes within timeout and there's no pagination, the full query results will be returned in the `QueryAssetsResponse`. Otherwise, full query results can be obtained by
2950
+ * issuing extra requests with the `job_reference` from the a previous `QueryAssets` call. Note, the query result has approximately 10 GB limitation enforced by BigQuery
2951
+ * https://cloud.google.com/bigquery/docs/best-practices-performance-output, queries return larger results will result in errors.
2952
+ */
2953
+ queryAssets(request: {
2954
+ /** V1 error format. */
2955
+ "$.xgafv"?: string;
2956
+ /** OAuth access token. */
2957
+ access_token?: string;
2958
+ /** Data format for response. */
2959
+ alt?: string;
2960
+ /** JSONP */
2961
+ callback?: string;
2962
+ /** Selector specifying which fields to include in a partial response. */
2963
+ fields?: string;
2964
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
2965
+ key?: string;
2966
+ /** OAuth 2.0 token for the current user. */
2967
+ oauth_token?: string;
2968
+ /**
2969
+ * Required. The relative name of the root asset. This can only be an organization number (such as "organizations/123"), a project ID (such as "projects/my-project-id"), or a
2970
+ * project number (such as "projects/12345"), or a folder number (such as "folders/123"). Only assets belonging to the `parent` will be returned.
2971
+ */
2972
+ parent: string;
2973
+ /** Returns response with indentations and line breaks. */
2974
+ prettyPrint?: boolean;
2975
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
2976
+ quotaUser?: string;
2977
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
2978
+ upload_protocol?: string;
2979
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
2980
+ uploadType?: string;
2981
+ /** Request body */
2982
+ resource: QueryAssetsRequest;
2983
+ }): Request<QueryAssetsResponse>;
2984
+ queryAssets(request: {
2985
+ /** V1 error format. */
2986
+ "$.xgafv"?: string;
2987
+ /** OAuth access token. */
2988
+ access_token?: string;
2989
+ /** Data format for response. */
2990
+ alt?: string;
2991
+ /** JSONP */
2992
+ callback?: string;
2993
+ /** Selector specifying which fields to include in a partial response. */
2994
+ fields?: string;
2995
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
2996
+ key?: string;
2997
+ /** OAuth 2.0 token for the current user. */
2998
+ oauth_token?: string;
2999
+ /**
3000
+ * Required. The relative name of the root asset. This can only be an organization number (such as "organizations/123"), a project ID (such as "projects/my-project-id"), or a
3001
+ * project number (such as "projects/12345"), or a folder number (such as "folders/123"). Only assets belonging to the `parent` will be returned.
3002
+ */
3003
+ parent: string;
3004
+ /** Returns response with indentations and line breaks. */
3005
+ prettyPrint?: boolean;
3006
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
3007
+ quotaUser?: string;
3008
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
3009
+ upload_protocol?: string;
3010
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
3011
+ uploadType?: string;
3012
+ },
3013
+ body: QueryAssetsRequest): Request<QueryAssetsResponse>;
2516
3014
  /**
2517
3015
  * Searches all IAM policies within the specified scope, such as a project, folder, or organization. The caller must be granted the `cloudasset.assets.searchAllIamPolicies` permission
2518
3016
  * on the desired scope, otherwise the request will be rejected.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxim_mazurok/gapi.client.cloudasset-v1",
3
- "version": "0.0.20221021",
3
+ "version": "0.0.20221114",
4
4
  "description": "TypeScript typings for Cloud Asset API v1",
5
5
  "license": "MIT",
6
6
  "author": {
package/readme.md CHANGED
@@ -146,6 +146,21 @@ Analyze moving a resource to a specified destination without kicking off the act
146
146
  */
147
147
  await gapi.client.cloudasset.analyzeMove({ resource: "resource", });
148
148
 
149
+ /*
150
+ Analyzes organization policies under a scope.
151
+ */
152
+ await gapi.client.cloudasset.analyzeOrgPolicies({ scope: "scope", });
153
+
154
+ /*
155
+ Analyzes organization policies governed assets (GCP resources or policies) under a scope. This RPC supports custom constraints and the following 10 canned constraints: * storage.uniformBucketLevelAccess * iam.disableServiceAccountKeyCreation * iam.allowedPolicyMemberDomains * compute.vmExternalIpAccess * appengine.enforceServiceAccountActAsCheck * gcp.resourceLocations * compute.trustedImageProjects * compute.skipDefaultNetworkCreation * compute.requireOsLogin * compute.disableNestedVirtualization This RPC only returns either: * resources of types supported by [searchable asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types), or * IAM policies.
156
+ */
157
+ await gapi.client.cloudasset.analyzeOrgPolicyGovernedAssets({ scope: "scope", });
158
+
159
+ /*
160
+ Analyzes organization policies governed containers (projects, folders or organization) under a scope.
161
+ */
162
+ await gapi.client.cloudasset.analyzeOrgPolicyGovernedContainers({ scope: "scope", });
163
+
149
164
  /*
150
165
  Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error.
151
166
  */
@@ -156,6 +171,11 @@ Exports assets with time and resource types to a given Cloud Storage location/Bi
156
171
  */
157
172
  await gapi.client.cloudasset.exportAssets({ parent: "parent", });
158
173
 
174
+ /*
175
+ Issue a job that queries assets using a SQL statement compatible with [BigQuery Standard SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql). If the query execution finishes within timeout and there's no pagination, the full query results will be returned in the `QueryAssetsResponse`. Otherwise, full query results can be obtained by issuing extra requests with the `job_reference` from the a previous `QueryAssets` call. Note, the query result has approximately 10 GB limitation enforced by BigQuery https://cloud.google.com/bigquery/docs/best-practices-performance-output, queries return larger results will result in errors.
176
+ */
177
+ await gapi.client.cloudasset.queryAssets({ parent: "parent", });
178
+
159
179
  /*
160
180
  Searches all IAM policies within the specified scope, such as a project, folder, or organization. The caller must be granted the `cloudasset.assets.searchAllIamPolicies` permission on the desired scope, otherwise the request will be rejected.
161
181
  */
package/tests.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
4
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
5
 
6
- // Revision: 20221021
6
+ // Revision: 20221114
7
7
 
8
8
  gapi.load('client', async () => {
9
9
  /** now we can use gapi.client */
@@ -301,6 +301,35 @@ gapi.load('client', async () => {
301
301
  resource: "Test string",
302
302
  view: "Test string",
303
303
  });
304
+ /** Analyzes organization policies under a scope. */
305
+ await gapi.client.cloudasset.v1.analyzeOrgPolicies({
306
+ constraint: "Test string",
307
+ filter: "Test string",
308
+ pageSize: 42,
309
+ pageToken: "Test string",
310
+ scope: "Test string",
311
+ });
312
+ /**
313
+ * Analyzes organization policies governed assets (GCP resources or policies) under a scope. This RPC supports custom constraints and the following 10 canned constraints: *
314
+ * storage.uniformBucketLevelAccess * iam.disableServiceAccountKeyCreation * iam.allowedPolicyMemberDomains * compute.vmExternalIpAccess * appengine.enforceServiceAccountActAsCheck *
315
+ * gcp.resourceLocations * compute.trustedImageProjects * compute.skipDefaultNetworkCreation * compute.requireOsLogin * compute.disableNestedVirtualization This RPC only returns either: *
316
+ * resources of types supported by [searchable asset types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types), or * IAM policies.
317
+ */
318
+ await gapi.client.cloudasset.v1.analyzeOrgPolicyGovernedAssets({
319
+ constraint: "Test string",
320
+ filter: "Test string",
321
+ pageSize: 42,
322
+ pageToken: "Test string",
323
+ scope: "Test string",
324
+ });
325
+ /** Analyzes organization policies governed containers (projects, folders or organization) under a scope. */
326
+ await gapi.client.cloudasset.v1.analyzeOrgPolicyGovernedContainers({
327
+ constraint: "Test string",
328
+ filter: "Test string",
329
+ pageSize: 42,
330
+ pageToken: "Test string",
331
+ scope: "Test string",
332
+ });
304
333
  /**
305
334
  * Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can
306
335
  * create gaps in the output history. Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset does not exist, this API returns an
@@ -347,6 +376,33 @@ gapi.load('client', async () => {
347
376
  "Test string"
348
377
  ],
349
378
  });
379
+ /**
380
+ * Issue a job that queries assets using a SQL statement compatible with [BigQuery Standard SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql). If the query
381
+ * execution finishes within timeout and there's no pagination, the full query results will be returned in the `QueryAssetsResponse`. Otherwise, full query results can be obtained by
382
+ * issuing extra requests with the `job_reference` from the a previous `QueryAssets` call. Note, the query result has approximately 10 GB limitation enforced by BigQuery
383
+ * https://cloud.google.com/bigquery/docs/best-practices-performance-output, queries return larger results will result in errors.
384
+ */
385
+ await gapi.client.cloudasset.v1.queryAssets({
386
+ parent: "Test string",
387
+ }, {
388
+ jobReference: "Test string",
389
+ outputConfig: {
390
+ bigqueryDestination: {
391
+ dataset: "Test string",
392
+ table: "Test string",
393
+ writeDisposition: "Test string",
394
+ },
395
+ },
396
+ pageSize: 42,
397
+ pageToken: "Test string",
398
+ readTime: "Test string",
399
+ readTimeWindow: {
400
+ endTime: "Test string",
401
+ startTime: "Test string",
402
+ },
403
+ statement: "Test string",
404
+ timeout: "Test string",
405
+ });
350
406
  /**
351
407
  * Searches all IAM policies within the specified scope, such as a project, folder, or organization. The caller must be granted the `cloudasset.assets.searchAllIamPolicies` permission on
352
408
  * the desired scope, otherwise the request will be rejected.