google-apis-policysimulator_v1alpha 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,6 +22,329 @@ module Google
22
22
  module Apis
23
23
  module PolicysimulatorV1alpha
24
24
 
25
+ # Similar to PolicySpec but with an extra 'launch' field for launch reference.
26
+ # The PolicySpec here is specific for dry-run/darklaunch.
27
+ class GoogleCloudOrgpolicyV2AlternatePolicySpec
28
+ include Google::Apis::Core::Hashable
29
+
30
+ # Reference to the launch that will be used while audit logging and to control
31
+ # the launch. Should be set only in the alternate policy.
32
+ # Corresponds to the JSON property `launch`
33
+ # @return [String]
34
+ attr_accessor :launch
35
+
36
+ # Defines a Google Cloud policy specification which is used to specify
37
+ # constraints for configurations of Google Cloud resources.
38
+ # Corresponds to the JSON property `spec`
39
+ # @return [Google::Apis::PolicysimulatorV1alpha::GoogleCloudOrgpolicyV2PolicySpec]
40
+ attr_accessor :spec
41
+
42
+ def initialize(**args)
43
+ update!(**args)
44
+ end
45
+
46
+ # Update properties of this object
47
+ def update!(**args)
48
+ @launch = args[:launch] if args.key?(:launch)
49
+ @spec = args[:spec] if args.key?(:spec)
50
+ end
51
+ end
52
+
53
+ # A custom constraint defined by customers which can *only* be applied to the
54
+ # given resource types and organization. By creating a custom constraint,
55
+ # customers can apply policies of this custom constraint. *Creating a custom
56
+ # constraint itself does NOT apply any policy enforcement*.
57
+ class GoogleCloudOrgpolicyV2CustomConstraint
58
+ include Google::Apis::Core::Hashable
59
+
60
+ # Allow or deny type.
61
+ # Corresponds to the JSON property `actionType`
62
+ # @return [String]
63
+ attr_accessor :action_type
64
+
65
+ # Org policy condition/expression. For example: `resource.instanceName.matches("[
66
+ # production|test]_.*_(\d)+")'` or, `resource.management.auto_upgrade == true`
67
+ # The max length of the condition is 1000 characters.
68
+ # Corresponds to the JSON property `condition`
69
+ # @return [String]
70
+ attr_accessor :condition
71
+
72
+ # Detailed information about this custom policy constraint. The max length of
73
+ # the description is 2000 characters.
74
+ # Corresponds to the JSON property `description`
75
+ # @return [String]
76
+ attr_accessor :description
77
+
78
+ # One line display name for the UI. The max length of the display_name is 200
79
+ # characters.
80
+ # Corresponds to the JSON property `displayName`
81
+ # @return [String]
82
+ attr_accessor :display_name
83
+
84
+ # All the operations being applied for this constraint.
85
+ # Corresponds to the JSON property `methodTypes`
86
+ # @return [Array<String>]
87
+ attr_accessor :method_types
88
+
89
+ # Immutable. Name of the constraint. This is unique within the organization.
90
+ # Format of the name should be * `organizations/`organization_id`/
91
+ # customConstraints/`custom_constraint_id`` Example: `organizations/123/
92
+ # customConstraints/custom.createOnlyE2TypeVms` The max length is 70 characters
93
+ # and the minimum length is 1. Note that the prefix `organizations/`
94
+ # organization_id`/customConstraints/` is not counted.
95
+ # Corresponds to the JSON property `name`
96
+ # @return [String]
97
+ attr_accessor :name
98
+
99
+ # Immutable. The resource instance type on which this policy applies. Format
100
+ # will be of the form : `/` Example: * `compute.googleapis.com/Instance`.
101
+ # Corresponds to the JSON property `resourceTypes`
102
+ # @return [Array<String>]
103
+ attr_accessor :resource_types
104
+
105
+ # Output only. The last time this custom constraint was updated. This represents
106
+ # the last time that the `CreateCustomConstraint` or `UpdateCustomConstraint`
107
+ # RPC was called
108
+ # Corresponds to the JSON property `updateTime`
109
+ # @return [String]
110
+ attr_accessor :update_time
111
+
112
+ def initialize(**args)
113
+ update!(**args)
114
+ end
115
+
116
+ # Update properties of this object
117
+ def update!(**args)
118
+ @action_type = args[:action_type] if args.key?(:action_type)
119
+ @condition = args[:condition] if args.key?(:condition)
120
+ @description = args[:description] if args.key?(:description)
121
+ @display_name = args[:display_name] if args.key?(:display_name)
122
+ @method_types = args[:method_types] if args.key?(:method_types)
123
+ @name = args[:name] if args.key?(:name)
124
+ @resource_types = args[:resource_types] if args.key?(:resource_types)
125
+ @update_time = args[:update_time] if args.key?(:update_time)
126
+ end
127
+ end
128
+
129
+ # Defines an organization policy which is used to specify constraints for
130
+ # configurations of Google Cloud resources.
131
+ class GoogleCloudOrgpolicyV2Policy
132
+ include Google::Apis::Core::Hashable
133
+
134
+ # Similar to PolicySpec but with an extra 'launch' field for launch reference.
135
+ # The PolicySpec here is specific for dry-run/darklaunch.
136
+ # Corresponds to the JSON property `alternate`
137
+ # @return [Google::Apis::PolicysimulatorV1alpha::GoogleCloudOrgpolicyV2AlternatePolicySpec]
138
+ attr_accessor :alternate
139
+
140
+ # Defines a Google Cloud policy specification which is used to specify
141
+ # constraints for configurations of Google Cloud resources.
142
+ # Corresponds to the JSON property `dryRunSpec`
143
+ # @return [Google::Apis::PolicysimulatorV1alpha::GoogleCloudOrgpolicyV2PolicySpec]
144
+ attr_accessor :dry_run_spec
145
+
146
+ # Immutable. The resource name of the policy. Must be one of the following forms,
147
+ # where constraint_name is the name of the constraint which this policy
148
+ # configures: * `projects/`project_number`/policies/`constraint_name`` * `
149
+ # folders/`folder_id`/policies/`constraint_name`` * `organizations/`
150
+ # organization_id`/policies/`constraint_name`` For example, "projects/123/
151
+ # policies/compute.disableSerialPortAccess". Note: `projects/`project_id`/
152
+ # policies/`constraint_name`` is also an acceptable name for API requests, but
153
+ # responses will return the name using the equivalent project number.
154
+ # Corresponds to the JSON property `name`
155
+ # @return [String]
156
+ attr_accessor :name
157
+
158
+ # Defines a Google Cloud policy specification which is used to specify
159
+ # constraints for configurations of Google Cloud resources.
160
+ # Corresponds to the JSON property `spec`
161
+ # @return [Google::Apis::PolicysimulatorV1alpha::GoogleCloudOrgpolicyV2PolicySpec]
162
+ attr_accessor :spec
163
+
164
+ def initialize(**args)
165
+ update!(**args)
166
+ end
167
+
168
+ # Update properties of this object
169
+ def update!(**args)
170
+ @alternate = args[:alternate] if args.key?(:alternate)
171
+ @dry_run_spec = args[:dry_run_spec] if args.key?(:dry_run_spec)
172
+ @name = args[:name] if args.key?(:name)
173
+ @spec = args[:spec] if args.key?(:spec)
174
+ end
175
+ end
176
+
177
+ # Defines a Google Cloud policy specification which is used to specify
178
+ # constraints for configurations of Google Cloud resources.
179
+ class GoogleCloudOrgpolicyV2PolicySpec
180
+ include Google::Apis::Core::Hashable
181
+
182
+ # An opaque tag indicating the current version of the policy, used for
183
+ # concurrency control. This field is ignored if used in a `CreatePolicy` request.
184
+ # When the policy` is returned from either a `GetPolicy` or a `ListPolicies`
185
+ # request, this `etag` indicates the version of the current policy to use when
186
+ # executing a read-modify-write loop. When the policy is returned from a `
187
+ # GetEffectivePolicy` request, the `etag` will be unset.
188
+ # Corresponds to the JSON property `etag`
189
+ # @return [String]
190
+ attr_accessor :etag
191
+
192
+ # Determines the inheritance behavior for this policy. If `inherit_from_parent`
193
+ # is true, policy rules set higher up in the hierarchy (up to the closest root)
194
+ # are inherited and present in the effective policy. If it is false, then no
195
+ # rules are inherited, and this policy becomes the new root for evaluation. This
196
+ # field can be set only for policies which configure list constraints.
197
+ # Corresponds to the JSON property `inheritFromParent`
198
+ # @return [Boolean]
199
+ attr_accessor :inherit_from_parent
200
+ alias_method :inherit_from_parent?, :inherit_from_parent
201
+
202
+ # Ignores policies set above this resource and restores the `constraint_default`
203
+ # enforcement behavior of the specific constraint at this resource. This field
204
+ # can be set in policies for either list or boolean constraints. If set, `rules`
205
+ # must be empty and `inherit_from_parent` must be set to false.
206
+ # Corresponds to the JSON property `reset`
207
+ # @return [Boolean]
208
+ attr_accessor :reset
209
+ alias_method :reset?, :reset
210
+
211
+ # In policies for boolean constraints, the following requirements apply: - There
212
+ # must be one and only one policy rule where condition is unset. - Boolean
213
+ # policy rules with conditions must set `enforced` to the opposite of the policy
214
+ # rule without a condition. - During policy evaluation, policy rules with
215
+ # conditions that are true for a target resource take precedence.
216
+ # Corresponds to the JSON property `rules`
217
+ # @return [Array<Google::Apis::PolicysimulatorV1alpha::GoogleCloudOrgpolicyV2PolicySpecPolicyRule>]
218
+ attr_accessor :rules
219
+
220
+ # Output only. The time stamp this was previously updated. This represents the
221
+ # last time a call to `CreatePolicy` or `UpdatePolicy` was made for that policy.
222
+ # Corresponds to the JSON property `updateTime`
223
+ # @return [String]
224
+ attr_accessor :update_time
225
+
226
+ def initialize(**args)
227
+ update!(**args)
228
+ end
229
+
230
+ # Update properties of this object
231
+ def update!(**args)
232
+ @etag = args[:etag] if args.key?(:etag)
233
+ @inherit_from_parent = args[:inherit_from_parent] if args.key?(:inherit_from_parent)
234
+ @reset = args[:reset] if args.key?(:reset)
235
+ @rules = args[:rules] if args.key?(:rules)
236
+ @update_time = args[:update_time] if args.key?(:update_time)
237
+ end
238
+ end
239
+
240
+ # A rule used to express this policy.
241
+ class GoogleCloudOrgpolicyV2PolicySpecPolicyRule
242
+ include Google::Apis::Core::Hashable
243
+
244
+ # Setting this to true means that all values are allowed. This field can be set
245
+ # only in policies for list constraints.
246
+ # Corresponds to the JSON property `allowAll`
247
+ # @return [Boolean]
248
+ attr_accessor :allow_all
249
+ alias_method :allow_all?, :allow_all
250
+
251
+ # Represents a textual expression in the Common Expression Language (CEL) syntax.
252
+ # CEL is a C-like expression language. The syntax and semantics of CEL are
253
+ # documented at https://github.com/google/cel-spec. Example (Comparison): title:
254
+ # "Summary size limit" description: "Determines if a summary is less than 100
255
+ # chars" expression: "document.summary.size() < 100" Example (Equality): title: "
256
+ # Requestor is owner" description: "Determines if requestor is the document
257
+ # owner" expression: "document.owner == request.auth.claims.email" Example (
258
+ # Logic): title: "Public documents" description: "Determine whether the document
259
+ # should be publicly visible" expression: "document.type != 'private' &&
260
+ # document.type != 'internal'" Example (Data Manipulation): title: "Notification
261
+ # string" description: "Create a notification string with a timestamp."
262
+ # expression: "'New message received at ' + string(document.create_time)" The
263
+ # exact variables and functions that may be referenced within an expression are
264
+ # determined by the service that evaluates it. See the service documentation for
265
+ # additional information.
266
+ # Corresponds to the JSON property `condition`
267
+ # @return [Google::Apis::PolicysimulatorV1alpha::GoogleTypeExpr]
268
+ attr_accessor :condition
269
+
270
+ # Setting this to true means that all values are denied. This field can be set
271
+ # only in policies for list constraints.
272
+ # Corresponds to the JSON property `denyAll`
273
+ # @return [Boolean]
274
+ attr_accessor :deny_all
275
+ alias_method :deny_all?, :deny_all
276
+
277
+ # If `true`, then the policy is enforced. If `false`, then any configuration is
278
+ # acceptable. This field can be set only in policies for boolean constraints.
279
+ # Corresponds to the JSON property `enforce`
280
+ # @return [Boolean]
281
+ attr_accessor :enforce
282
+ alias_method :enforce?, :enforce
283
+
284
+ # A message that holds specific allowed and denied values. This message can
285
+ # define specific values and subtrees of the Resource Manager resource hierarchy
286
+ # (`Organizations`, `Folders`, `Projects`) that are allowed or denied. This is
287
+ # achieved by using the `under:` and optional `is:` prefixes. The `under:`
288
+ # prefix is used to denote resource subtree values. The `is:` prefix is used to
289
+ # denote specific values, and is required only if the value contains a ":".
290
+ # Values prefixed with "is:" are treated the same as values with no prefix.
291
+ # Ancestry subtrees must be in one of the following formats: - "projects/", e.g.
292
+ # "projects/tokyo-rain-123" - "folders/", e.g. "folders/1234" - "organizations/",
293
+ # e.g. "organizations/1234" The `supports_under` field of the associated `
294
+ # Constraint` defines whether ancestry prefixes can be used.
295
+ # Corresponds to the JSON property `values`
296
+ # @return [Google::Apis::PolicysimulatorV1alpha::GoogleCloudOrgpolicyV2PolicySpecPolicyRuleStringValues]
297
+ attr_accessor :values
298
+
299
+ def initialize(**args)
300
+ update!(**args)
301
+ end
302
+
303
+ # Update properties of this object
304
+ def update!(**args)
305
+ @allow_all = args[:allow_all] if args.key?(:allow_all)
306
+ @condition = args[:condition] if args.key?(:condition)
307
+ @deny_all = args[:deny_all] if args.key?(:deny_all)
308
+ @enforce = args[:enforce] if args.key?(:enforce)
309
+ @values = args[:values] if args.key?(:values)
310
+ end
311
+ end
312
+
313
+ # A message that holds specific allowed and denied values. This message can
314
+ # define specific values and subtrees of the Resource Manager resource hierarchy
315
+ # (`Organizations`, `Folders`, `Projects`) that are allowed or denied. This is
316
+ # achieved by using the `under:` and optional `is:` prefixes. The `under:`
317
+ # prefix is used to denote resource subtree values. The `is:` prefix is used to
318
+ # denote specific values, and is required only if the value contains a ":".
319
+ # Values prefixed with "is:" are treated the same as values with no prefix.
320
+ # Ancestry subtrees must be in one of the following formats: - "projects/", e.g.
321
+ # "projects/tokyo-rain-123" - "folders/", e.g. "folders/1234" - "organizations/",
322
+ # e.g. "organizations/1234" The `supports_under` field of the associated `
323
+ # Constraint` defines whether ancestry prefixes can be used.
324
+ class GoogleCloudOrgpolicyV2PolicySpecPolicyRuleStringValues
325
+ include Google::Apis::Core::Hashable
326
+
327
+ # List of values allowed at this resource.
328
+ # Corresponds to the JSON property `allowedValues`
329
+ # @return [Array<String>]
330
+ attr_accessor :allowed_values
331
+
332
+ # List of values denied at this resource.
333
+ # Corresponds to the JSON property `deniedValues`
334
+ # @return [Array<String>]
335
+ attr_accessor :denied_values
336
+
337
+ def initialize(**args)
338
+ update!(**args)
339
+ end
340
+
341
+ # Update properties of this object
342
+ def update!(**args)
343
+ @allowed_values = args[:allowed_values] if args.key?(:allowed_values)
344
+ @denied_values = args[:denied_values] if args.key?(:denied_values)
345
+ end
346
+ end
347
+
25
348
  # A resource describing a `Replay`, or simulation.
26
349
  class GoogleCloudPolicysimulatorV1Replay
27
350
  include Google::Apis::Core::Hashable
@@ -180,6 +503,630 @@ module Google
180
503
  end
181
504
  end
182
505
 
506
+ # GenerateOrgPolicyViolationsPreviewOperationMetadata is metadata about an
507
+ # OrgPolicyViolationsPreview generations operation.
508
+ class GoogleCloudPolicysimulatorV1alphaGenerateOrgPolicyViolationsPreviewOperationMetadata
509
+ include Google::Apis::Core::Hashable
510
+
511
+ # Time when the request was received.
512
+ # Corresponds to the JSON property `requestTime`
513
+ # @return [String]
514
+ attr_accessor :request_time
515
+
516
+ # Total number of resources that need scanning. Should equal resource_scanned +
517
+ # resources_pending
518
+ # Corresponds to the JSON property `resourcesFound`
519
+ # @return [Fixnum]
520
+ attr_accessor :resources_found
521
+
522
+ # Number of resources still to scan.
523
+ # Corresponds to the JSON property `resourcesPending`
524
+ # @return [Fixnum]
525
+ attr_accessor :resources_pending
526
+
527
+ # Number of resources already scanned.
528
+ # Corresponds to the JSON property `resourcesScanned`
529
+ # @return [Fixnum]
530
+ attr_accessor :resources_scanned
531
+
532
+ # Time when the request started processing, i.e. when the state was set to
533
+ # RUNNING.
534
+ # Corresponds to the JSON property `startTime`
535
+ # @return [String]
536
+ attr_accessor :start_time
537
+
538
+ # The current state of the operation.
539
+ # Corresponds to the JSON property `state`
540
+ # @return [String]
541
+ attr_accessor :state
542
+
543
+ def initialize(**args)
544
+ update!(**args)
545
+ end
546
+
547
+ # Update properties of this object
548
+ def update!(**args)
549
+ @request_time = args[:request_time] if args.key?(:request_time)
550
+ @resources_found = args[:resources_found] if args.key?(:resources_found)
551
+ @resources_pending = args[:resources_pending] if args.key?(:resources_pending)
552
+ @resources_scanned = args[:resources_scanned] if args.key?(:resources_scanned)
553
+ @start_time = args[:start_time] if args.key?(:start_time)
554
+ @state = args[:state] if args.key?(:state)
555
+ end
556
+ end
557
+
558
+ # ListOrgPolicyViolationsPreviewsResponse is the response message for
559
+ # OrgPolicyViolationsPreviewService.ListOrgPolicyViolationsPreviews.
560
+ class GoogleCloudPolicysimulatorV1alphaListOrgPolicyViolationsPreviewsResponse
561
+ include Google::Apis::Core::Hashable
562
+
563
+ # A token that you can use to retrieve the next page of results. If this field
564
+ # is omitted, there are no subsequent pages.
565
+ # Corresponds to the JSON property `nextPageToken`
566
+ # @return [String]
567
+ attr_accessor :next_page_token
568
+
569
+ # The list of OrgPolicyViolationsPreview
570
+ # Corresponds to the JSON property `orgPolicyViolationsPreviews`
571
+ # @return [Array<Google::Apis::PolicysimulatorV1alpha::GoogleCloudPolicysimulatorV1alphaOrgPolicyViolationsPreview>]
572
+ attr_accessor :org_policy_violations_previews
573
+
574
+ def initialize(**args)
575
+ update!(**args)
576
+ end
577
+
578
+ # Update properties of this object
579
+ def update!(**args)
580
+ @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
581
+ @org_policy_violations_previews = args[:org_policy_violations_previews] if args.key?(:org_policy_violations_previews)
582
+ end
583
+ end
584
+
585
+ # ListOrgPolicyViolationsResponse is the response message for
586
+ # OrgPolicyViolationsPreviewService.ListOrgPolicyViolations
587
+ class GoogleCloudPolicysimulatorV1alphaListOrgPolicyViolationsResponse
588
+ include Google::Apis::Core::Hashable
589
+
590
+ # A token that you can use to retrieve the next page of results. If this field
591
+ # is omitted, there are no subsequent pages.
592
+ # Corresponds to the JSON property `nextPageToken`
593
+ # @return [String]
594
+ attr_accessor :next_page_token
595
+
596
+ # The list of OrgPolicyViolations
597
+ # Corresponds to the JSON property `orgPolicyViolations`
598
+ # @return [Array<Google::Apis::PolicysimulatorV1alpha::GoogleCloudPolicysimulatorV1alphaOrgPolicyViolation>]
599
+ attr_accessor :org_policy_violations
600
+
601
+ def initialize(**args)
602
+ update!(**args)
603
+ end
604
+
605
+ # Update properties of this object
606
+ def update!(**args)
607
+ @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
608
+ @org_policy_violations = args[:org_policy_violations] if args.key?(:org_policy_violations)
609
+ end
610
+ end
611
+
612
+ # The proposed changes to OrgPolicy.
613
+ class GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlay
614
+ include Google::Apis::Core::Hashable
615
+
616
+ # The OrgPolicy CustomConstraint changes to preview violations for. Any existing
617
+ # CustomConstraints with the same name will be overridden in the simulation.
618
+ # That is, violations will be determined as if all custom constraints in the
619
+ # overlay were instantiated.
620
+ # Corresponds to the JSON property `customConstraints`
621
+ # @return [Array<Google::Apis::PolicysimulatorV1alpha::GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlayCustomConstraintOverlay>]
622
+ attr_accessor :custom_constraints
623
+
624
+ # The OrgPolicy changes to preview violations for. Any existing OrgPolicies with
625
+ # the same name will be overridden in the simulation. That is, violations will
626
+ # be determined as if all policies in the overlay were created or updated.
627
+ # Corresponds to the JSON property `policies`
628
+ # @return [Array<Google::Apis::PolicysimulatorV1alpha::GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlayPolicyOverlay>]
629
+ attr_accessor :policies
630
+
631
+ def initialize(**args)
632
+ update!(**args)
633
+ end
634
+
635
+ # Update properties of this object
636
+ def update!(**args)
637
+ @custom_constraints = args[:custom_constraints] if args.key?(:custom_constraints)
638
+ @policies = args[:policies] if args.key?(:policies)
639
+ end
640
+ end
641
+
642
+ # A change to an OrgPolicy custom constraint.
643
+ class GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlayCustomConstraintOverlay
644
+ include Google::Apis::Core::Hashable
645
+
646
+ # A custom constraint defined by customers which can *only* be applied to the
647
+ # given resource types and organization. By creating a custom constraint,
648
+ # customers can apply policies of this custom constraint. *Creating a custom
649
+ # constraint itself does NOT apply any policy enforcement*.
650
+ # Corresponds to the JSON property `customConstraint`
651
+ # @return [Google::Apis::PolicysimulatorV1alpha::GoogleCloudOrgpolicyV2CustomConstraint]
652
+ attr_accessor :custom_constraint
653
+
654
+ # Resource the constraint is attached to. Example: "organization/987654"
655
+ # Corresponds to the JSON property `customConstraintParent`
656
+ # @return [String]
657
+ attr_accessor :custom_constraint_parent
658
+
659
+ def initialize(**args)
660
+ update!(**args)
661
+ end
662
+
663
+ # Update properties of this object
664
+ def update!(**args)
665
+ @custom_constraint = args[:custom_constraint] if args.key?(:custom_constraint)
666
+ @custom_constraint_parent = args[:custom_constraint_parent] if args.key?(:custom_constraint_parent)
667
+ end
668
+ end
669
+
670
+ # A change to an OrgPolicy.
671
+ class GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlayPolicyOverlay
672
+ include Google::Apis::Core::Hashable
673
+
674
+ # Defines an organization policy which is used to specify constraints for
675
+ # configurations of Google Cloud resources.
676
+ # Corresponds to the JSON property `policy`
677
+ # @return [Google::Apis::PolicysimulatorV1alpha::GoogleCloudOrgpolicyV2Policy]
678
+ attr_accessor :policy
679
+
680
+ # The parent of the policy we are attaching to. Example: "projects/123456"
681
+ # Corresponds to the JSON property `policyParent`
682
+ # @return [String]
683
+ attr_accessor :policy_parent
684
+
685
+ def initialize(**args)
686
+ update!(**args)
687
+ end
688
+
689
+ # Update properties of this object
690
+ def update!(**args)
691
+ @policy = args[:policy] if args.key?(:policy)
692
+ @policy_parent = args[:policy_parent] if args.key?(:policy_parent)
693
+ end
694
+ end
695
+
696
+ # OrgPolicyViolation is a resource representing a single resource violating a
697
+ # single OrgPolicy constraint.
698
+ class GoogleCloudPolicysimulatorV1alphaOrgPolicyViolation
699
+ include Google::Apis::Core::Hashable
700
+
701
+ # A custom constraint defined by customers which can *only* be applied to the
702
+ # given resource types and organization. By creating a custom constraint,
703
+ # customers can apply policies of this custom constraint. *Creating a custom
704
+ # constraint itself does NOT apply any policy enforcement*.
705
+ # Corresponds to the JSON property `customConstraint`
706
+ # @return [Google::Apis::PolicysimulatorV1alpha::GoogleCloudOrgpolicyV2CustomConstraint]
707
+ attr_accessor :custom_constraint
708
+
709
+ # The `Status` type defines a logical error model that is suitable for different
710
+ # programming environments, including REST APIs and RPC APIs. It is used by [
711
+ # gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
712
+ # data: error code, error message, and error details. You can find out more
713
+ # about this error model and how to work with it in the [API Design Guide](https:
714
+ # //cloud.google.com/apis/design/errors).
715
+ # Corresponds to the JSON property `error`
716
+ # @return [Google::Apis::PolicysimulatorV1alpha::GoogleRpcStatus]
717
+ attr_accessor :error
718
+
719
+ # The name of the `OrgPolicyViolation`. Example: organizations/my-example-org/
720
+ # locations/global/orgPolicyViolationsPreviews/506a5f7f/orgPolicyViolations/38ce`
721
+ # Corresponds to the JSON property `name`
722
+ # @return [String]
723
+ attr_accessor :name
724
+
725
+ # ResourceContext provides the context we know about a resource. It is similar
726
+ # in concept to google.cloud.asset.v1.Resource, but focuses on the information
727
+ # specifically used by Simulator.
728
+ # Corresponds to the JSON property `resource`
729
+ # @return [Google::Apis::PolicysimulatorV1alpha::GoogleCloudPolicysimulatorV1alphaResourceContext]
730
+ attr_accessor :resource
731
+
732
+ def initialize(**args)
733
+ update!(**args)
734
+ end
735
+
736
+ # Update properties of this object
737
+ def update!(**args)
738
+ @custom_constraint = args[:custom_constraint] if args.key?(:custom_constraint)
739
+ @error = args[:error] if args.key?(:error)
740
+ @name = args[:name] if args.key?(:name)
741
+ @resource = args[:resource] if args.key?(:resource)
742
+ end
743
+ end
744
+
745
+ # OrgPolicyViolationsPreview is a resource providing a preview of the violations
746
+ # that will exist if an OrgPolicy change is made. The list of violations are
747
+ # modeled as child resources and retrieved via a ListOrgPolicyViolations API
748
+ # call. There are potentially more OrgPolicyViolations than could fit in an
749
+ # embedded field. Thus, the use of a child resource instead of a field.
750
+ class GoogleCloudPolicysimulatorV1alphaOrgPolicyViolationsPreview
751
+ include Google::Apis::Core::Hashable
752
+
753
+ # Output only. The resource name of the `OrgPolicyViolationsPreview`. It has the
754
+ # following format: `organizations/`organization`/locations/`location`/
755
+ # orgPolicyViolationsPreviews/`orgPolicyViolationsPreview`` Example: `
756
+ # organizations/my-example-org/locations/global/orgPolicyViolationsPreviews/
757
+ # 506a5f7f`
758
+ # Corresponds to the JSON property `name`
759
+ # @return [String]
760
+ attr_accessor :name
761
+
762
+ # The proposed changes to OrgPolicy.
763
+ # Corresponds to the JSON property `overlay`
764
+ # @return [Google::Apis::PolicysimulatorV1alpha::GoogleCloudPolicysimulatorV1alphaOrgPolicyOverlay]
765
+ attr_accessor :overlay
766
+
767
+ # A summary of the state of all resources scanned for compliance with the
768
+ # changed OrgPolicy.
769
+ # Corresponds to the JSON property `resourceCounts`
770
+ # @return [Google::Apis::PolicysimulatorV1alpha::GoogleCloudPolicysimulatorV1alphaOrgPolicyViolationsPreviewResourceCounts]
771
+ attr_accessor :resource_counts
772
+
773
+ # Output only. The state of the `OrgPolicyViolationsPreview`.
774
+ # Corresponds to the JSON property `state`
775
+ # @return [String]
776
+ attr_accessor :state
777
+
778
+ # Output only. The number of OrgPolicyViolations in this `
779
+ # OrgPolicyViolationsPreview`. This count may differ from `resource_summary.
780
+ # noncompliant_count` because each OrgPolicyViolation is specific to a resource *
781
+ # *and** constraint. If there are multiple constraints being evaluated (i.e.
782
+ # multiple policies in the overlay), a single resource may violate multiple
783
+ # constraints.
784
+ # Corresponds to the JSON property `violationsCount`
785
+ # @return [Fixnum]
786
+ attr_accessor :violations_count
787
+
788
+ def initialize(**args)
789
+ update!(**args)
790
+ end
791
+
792
+ # Update properties of this object
793
+ def update!(**args)
794
+ @name = args[:name] if args.key?(:name)
795
+ @overlay = args[:overlay] if args.key?(:overlay)
796
+ @resource_counts = args[:resource_counts] if args.key?(:resource_counts)
797
+ @state = args[:state] if args.key?(:state)
798
+ @violations_count = args[:violations_count] if args.key?(:violations_count)
799
+ end
800
+ end
801
+
802
+ # A summary of the state of all resources scanned for compliance with the
803
+ # changed OrgPolicy.
804
+ class GoogleCloudPolicysimulatorV1alphaOrgPolicyViolationsPreviewResourceCounts
805
+ include Google::Apis::Core::Hashable
806
+
807
+ # Number of scanned resources with zero violations.
808
+ # Corresponds to the JSON property `compliant`
809
+ # @return [Fixnum]
810
+ attr_accessor :compliant
811
+
812
+ # Number of resources that returned an error when scanned.
813
+ # Corresponds to the JSON property `errors`
814
+ # @return [Fixnum]
815
+ attr_accessor :errors
816
+
817
+ # Number of scanned resources with at least one violation.
818
+ # Corresponds to the JSON property `noncompliant`
819
+ # @return [Fixnum]
820
+ attr_accessor :noncompliant
821
+
822
+ # Number of resources checked for compliance. Must equal: unenforced +
823
+ # noncompliant + compliant + error
824
+ # Corresponds to the JSON property `scanned`
825
+ # @return [Fixnum]
826
+ attr_accessor :scanned
827
+
828
+ # Number of resources where the constraint was not enforced, i.e. the Policy set
829
+ # `enforced: false` for that resource.
830
+ # Corresponds to the JSON property `unenforced`
831
+ # @return [Fixnum]
832
+ attr_accessor :unenforced
833
+
834
+ def initialize(**args)
835
+ update!(**args)
836
+ end
837
+
838
+ # Update properties of this object
839
+ def update!(**args)
840
+ @compliant = args[:compliant] if args.key?(:compliant)
841
+ @errors = args[:errors] if args.key?(:errors)
842
+ @noncompliant = args[:noncompliant] if args.key?(:noncompliant)
843
+ @scanned = args[:scanned] if args.key?(:scanned)
844
+ @unenforced = args[:unenforced] if args.key?(:unenforced)
845
+ end
846
+ end
847
+
848
+ # ResourceContext provides the context we know about a resource. It is similar
849
+ # in concept to google.cloud.asset.v1.Resource, but focuses on the information
850
+ # specifically used by Simulator.
851
+ class GoogleCloudPolicysimulatorV1alphaResourceContext
852
+ include Google::Apis::Core::Hashable
853
+
854
+ # The ancestry path of the resource in Google Cloud [resource hierarchy](https://
855
+ # cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
856
+ # represented as a list of relative resource names. An ancestry path starts with
857
+ # the closest ancestor in the hierarchy and ends at root. If the resource is a
858
+ # project, folder, or organization, the ancestry path starts from the resource
859
+ # itself. Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
860
+ # Corresponds to the JSON property `ancestors`
861
+ # @return [Array<String>]
862
+ attr_accessor :ancestors
863
+
864
+ # The asset type of the resource as defined by CAIS. Example: `compute.
865
+ # googleapis.com/Firewall` See [Supported asset types](https://cloud.google.com/
866
+ # asset-inventory/docs/supported-asset-types) for more information.
867
+ # Corresponds to the JSON property `assetType`
868
+ # @return [String]
869
+ attr_accessor :asset_type
870
+
871
+ # The full name of the resource. Example: `//compute.googleapis.com/projects/
872
+ # my_project_123/zones/zone1/instances/instance1` See [Resource names](https://
873
+ # cloud.google.com/apis/design/resource_names#full_resource_name) for more
874
+ # information.
875
+ # Corresponds to the JSON property `resource`
876
+ # @return [String]
877
+ attr_accessor :resource
878
+
879
+ def initialize(**args)
880
+ update!(**args)
881
+ end
882
+
883
+ # Update properties of this object
884
+ def update!(**args)
885
+ @ancestors = args[:ancestors] if args.key?(:ancestors)
886
+ @asset_type = args[:asset_type] if args.key?(:asset_type)
887
+ @resource = args[:resource] if args.key?(:resource)
888
+ end
889
+ end
890
+
891
+ # GenerateOrgPolicyViolationsPreviewOperationMetadata is metadata about an
892
+ # OrgPolicyViolationsPreview generations operation.
893
+ class GoogleCloudPolicysimulatorV1betaGenerateOrgPolicyViolationsPreviewOperationMetadata
894
+ include Google::Apis::Core::Hashable
895
+
896
+ # Time when the request was received.
897
+ # Corresponds to the JSON property `requestTime`
898
+ # @return [String]
899
+ attr_accessor :request_time
900
+
901
+ # Total number of resources that need scanning. Should equal resource_scanned +
902
+ # resources_pending
903
+ # Corresponds to the JSON property `resourcesFound`
904
+ # @return [Fixnum]
905
+ attr_accessor :resources_found
906
+
907
+ # Number of resources still to scan.
908
+ # Corresponds to the JSON property `resourcesPending`
909
+ # @return [Fixnum]
910
+ attr_accessor :resources_pending
911
+
912
+ # Number of resources already scanned.
913
+ # Corresponds to the JSON property `resourcesScanned`
914
+ # @return [Fixnum]
915
+ attr_accessor :resources_scanned
916
+
917
+ # Time when the request started processing, i.e. when the state was set to
918
+ # RUNNING.
919
+ # Corresponds to the JSON property `startTime`
920
+ # @return [String]
921
+ attr_accessor :start_time
922
+
923
+ # The current state of the operation.
924
+ # Corresponds to the JSON property `state`
925
+ # @return [String]
926
+ attr_accessor :state
927
+
928
+ def initialize(**args)
929
+ update!(**args)
930
+ end
931
+
932
+ # Update properties of this object
933
+ def update!(**args)
934
+ @request_time = args[:request_time] if args.key?(:request_time)
935
+ @resources_found = args[:resources_found] if args.key?(:resources_found)
936
+ @resources_pending = args[:resources_pending] if args.key?(:resources_pending)
937
+ @resources_scanned = args[:resources_scanned] if args.key?(:resources_scanned)
938
+ @start_time = args[:start_time] if args.key?(:start_time)
939
+ @state = args[:state] if args.key?(:state)
940
+ end
941
+ end
942
+
943
+ # The proposed changes to OrgPolicy.
944
+ class GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay
945
+ include Google::Apis::Core::Hashable
946
+
947
+ # The OrgPolicy CustomConstraint changes to preview violations for. Any existing
948
+ # CustomConstraints with the same name will be overridden in the simulation.
949
+ # That is, violations will be determined as if all custom constraints in the
950
+ # overlay were instantiated.
951
+ # Corresponds to the JSON property `customConstraints`
952
+ # @return [Array<Google::Apis::PolicysimulatorV1alpha::GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay>]
953
+ attr_accessor :custom_constraints
954
+
955
+ # The OrgPolicy changes to preview violations for. Any existing OrgPolicies with
956
+ # the same name will be overridden in the simulation. That is, violations will
957
+ # be determined as if all policies in the overlay were created or updated.
958
+ # Corresponds to the JSON property `policies`
959
+ # @return [Array<Google::Apis::PolicysimulatorV1alpha::GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay>]
960
+ attr_accessor :policies
961
+
962
+ def initialize(**args)
963
+ update!(**args)
964
+ end
965
+
966
+ # Update properties of this object
967
+ def update!(**args)
968
+ @custom_constraints = args[:custom_constraints] if args.key?(:custom_constraints)
969
+ @policies = args[:policies] if args.key?(:policies)
970
+ end
971
+ end
972
+
973
+ # A change to an OrgPolicy custom constraint.
974
+ class GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay
975
+ include Google::Apis::Core::Hashable
976
+
977
+ # A custom constraint defined by customers which can *only* be applied to the
978
+ # given resource types and organization. By creating a custom constraint,
979
+ # customers can apply policies of this custom constraint. *Creating a custom
980
+ # constraint itself does NOT apply any policy enforcement*.
981
+ # Corresponds to the JSON property `customConstraint`
982
+ # @return [Google::Apis::PolicysimulatorV1alpha::GoogleCloudOrgpolicyV2CustomConstraint]
983
+ attr_accessor :custom_constraint
984
+
985
+ # Resource the constraint is attached to. Example: "organization/987654"
986
+ # Corresponds to the JSON property `customConstraintParent`
987
+ # @return [String]
988
+ attr_accessor :custom_constraint_parent
989
+
990
+ def initialize(**args)
991
+ update!(**args)
992
+ end
993
+
994
+ # Update properties of this object
995
+ def update!(**args)
996
+ @custom_constraint = args[:custom_constraint] if args.key?(:custom_constraint)
997
+ @custom_constraint_parent = args[:custom_constraint_parent] if args.key?(:custom_constraint_parent)
998
+ end
999
+ end
1000
+
1001
+ # A change to an OrgPolicy.
1002
+ class GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay
1003
+ include Google::Apis::Core::Hashable
1004
+
1005
+ # Defines an organization policy which is used to specify constraints for
1006
+ # configurations of Google Cloud resources.
1007
+ # Corresponds to the JSON property `policy`
1008
+ # @return [Google::Apis::PolicysimulatorV1alpha::GoogleCloudOrgpolicyV2Policy]
1009
+ attr_accessor :policy
1010
+
1011
+ # The parent of the policy we are attaching to. Example: "projects/123456"
1012
+ # Corresponds to the JSON property `policyParent`
1013
+ # @return [String]
1014
+ attr_accessor :policy_parent
1015
+
1016
+ def initialize(**args)
1017
+ update!(**args)
1018
+ end
1019
+
1020
+ # Update properties of this object
1021
+ def update!(**args)
1022
+ @policy = args[:policy] if args.key?(:policy)
1023
+ @policy_parent = args[:policy_parent] if args.key?(:policy_parent)
1024
+ end
1025
+ end
1026
+
1027
+ # OrgPolicyViolationsPreview is a resource providing a preview of the violations
1028
+ # that will exist if an OrgPolicy change is made. The list of violations are
1029
+ # modeled as child resources and retrieved via a ListOrgPolicyViolations API
1030
+ # call. There are potentially more OrgPolicyViolations than could fit in an
1031
+ # embedded field. Thus, the use of a child resource instead of a field.
1032
+ class GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview
1033
+ include Google::Apis::Core::Hashable
1034
+
1035
+ # Output only. The resource name of the `OrgPolicyViolationsPreview`. It has the
1036
+ # following format: `organizations/`organization`/locations/`location`/
1037
+ # orgPolicyViolationsPreviews/`orgPolicyViolationsPreview`` Example: `
1038
+ # organizations/my-example-org/locations/global/orgPolicyViolationsPreviews/
1039
+ # 506a5f7f`
1040
+ # Corresponds to the JSON property `name`
1041
+ # @return [String]
1042
+ attr_accessor :name
1043
+
1044
+ # The proposed changes to OrgPolicy.
1045
+ # Corresponds to the JSON property `overlay`
1046
+ # @return [Google::Apis::PolicysimulatorV1alpha::GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay]
1047
+ attr_accessor :overlay
1048
+
1049
+ # A summary of the state of all resources scanned for compliance with the
1050
+ # changed OrgPolicy.
1051
+ # Corresponds to the JSON property `resourceCounts`
1052
+ # @return [Google::Apis::PolicysimulatorV1alpha::GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts]
1053
+ attr_accessor :resource_counts
1054
+
1055
+ # Output only. The state of the `OrgPolicyViolationsPreview`.
1056
+ # Corresponds to the JSON property `state`
1057
+ # @return [String]
1058
+ attr_accessor :state
1059
+
1060
+ # Output only. The number of OrgPolicyViolations in this `
1061
+ # OrgPolicyViolationsPreview`. This count may differ from `resource_summary.
1062
+ # noncompliant_count` because each OrgPolicyViolation is specific to a resource *
1063
+ # *and** constraint. If there are multiple constraints being evaluated (i.e.
1064
+ # multiple policies in the overlay), a single resource may violate multiple
1065
+ # constraints.
1066
+ # Corresponds to the JSON property `violationsCount`
1067
+ # @return [Fixnum]
1068
+ attr_accessor :violations_count
1069
+
1070
+ def initialize(**args)
1071
+ update!(**args)
1072
+ end
1073
+
1074
+ # Update properties of this object
1075
+ def update!(**args)
1076
+ @name = args[:name] if args.key?(:name)
1077
+ @overlay = args[:overlay] if args.key?(:overlay)
1078
+ @resource_counts = args[:resource_counts] if args.key?(:resource_counts)
1079
+ @state = args[:state] if args.key?(:state)
1080
+ @violations_count = args[:violations_count] if args.key?(:violations_count)
1081
+ end
1082
+ end
1083
+
1084
+ # A summary of the state of all resources scanned for compliance with the
1085
+ # changed OrgPolicy.
1086
+ class GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts
1087
+ include Google::Apis::Core::Hashable
1088
+
1089
+ # Number of scanned resources with zero violations.
1090
+ # Corresponds to the JSON property `compliant`
1091
+ # @return [Fixnum]
1092
+ attr_accessor :compliant
1093
+
1094
+ # Number of resources that returned an error when scanned.
1095
+ # Corresponds to the JSON property `errors`
1096
+ # @return [Fixnum]
1097
+ attr_accessor :errors
1098
+
1099
+ # Number of scanned resources with at least one violation.
1100
+ # Corresponds to the JSON property `noncompliant`
1101
+ # @return [Fixnum]
1102
+ attr_accessor :noncompliant
1103
+
1104
+ # Number of resources checked for compliance. Must equal: unenforced +
1105
+ # noncompliant + compliant + error
1106
+ # Corresponds to the JSON property `scanned`
1107
+ # @return [Fixnum]
1108
+ attr_accessor :scanned
1109
+
1110
+ # Number of resources where the constraint was not enforced, i.e. the Policy set
1111
+ # `enforced: false` for that resource.
1112
+ # Corresponds to the JSON property `unenforced`
1113
+ # @return [Fixnum]
1114
+ attr_accessor :unenforced
1115
+
1116
+ def initialize(**args)
1117
+ update!(**args)
1118
+ end
1119
+
1120
+ # Update properties of this object
1121
+ def update!(**args)
1122
+ @compliant = args[:compliant] if args.key?(:compliant)
1123
+ @errors = args[:errors] if args.key?(:errors)
1124
+ @noncompliant = args[:noncompliant] if args.key?(:noncompliant)
1125
+ @scanned = args[:scanned] if args.key?(:scanned)
1126
+ @unenforced = args[:unenforced] if args.key?(:unenforced)
1127
+ end
1128
+ end
1129
+
183
1130
  # Specifies the audit configuration for a service. The configuration determines
184
1131
  # which permission types are logged, and what identities, if any, are exempted
185
1132
  # from logging. An AuditConfig must have one or more AuditLogConfigs. If there