|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +# |
| 3 | +# Copyright 2019 Google LLC |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +"""Wrappers for protocol buffer enum types.""" |
| 17 | + |
| 18 | +import enum |
| 19 | + |
| 20 | + |
| 21 | +class NullValue(enum.IntEnum): |
| 22 | + """ |
| 23 | + ``NullValue`` is a singleton enumeration to represent the null value for |
| 24 | + the ``Value`` type union. |
| 25 | +
|
| 26 | + The JSON representation for ``NullValue`` is JSON ``null``. |
| 27 | +
|
| 28 | + Attributes: |
| 29 | + NULL_VALUE (int): Null value. |
| 30 | + """ |
| 31 | + |
| 32 | + NULL_VALUE = 0 |
| 33 | + |
| 34 | + |
| 35 | +class Finding(object): |
| 36 | + class State(enum.IntEnum): |
| 37 | + """ |
| 38 | + The state of the finding. |
| 39 | +
|
| 40 | + Attributes: |
| 41 | + STATE_UNSPECIFIED (int): Unspecified state. |
| 42 | + ACTIVE (int): The finding requires attention and has not been addressed yet. |
| 43 | + INACTIVE (int): The finding has been fixed, triaged as a non-issue or otherwise addressed |
| 44 | + and is no longer active. |
| 45 | + """ |
| 46 | + |
| 47 | + STATE_UNSPECIFIED = 0 |
| 48 | + ACTIVE = 1 |
| 49 | + INACTIVE = 2 |
| 50 | + |
| 51 | + |
| 52 | +class ListAssetsResponse(object): |
| 53 | + class ListAssetsResult(object): |
| 54 | + class StateChange(enum.IntEnum): |
| 55 | + """ |
| 56 | + The change in state of the asset. |
| 57 | +
|
| 58 | + When querying across two points in time this describes the change |
| 59 | + between the two points: ADDED, REMOVED, or ACTIVE. If there was no |
| 60 | + compare\_duration supplied in the request the state change will be: |
| 61 | + UNUSED |
| 62 | +
|
| 63 | + Attributes: |
| 64 | + UNUSED (int): State change is unused, this is the canonical default for this enum. |
| 65 | + ADDED (int): Asset was added between the points in time. |
| 66 | + REMOVED (int): Asset was removed between the points in time. |
| 67 | + ACTIVE (int): Asset was present at both point(s) in time. |
| 68 | + """ |
| 69 | + |
| 70 | + UNUSED = 0 |
| 71 | + ADDED = 1 |
| 72 | + REMOVED = 2 |
| 73 | + ACTIVE = 3 |
| 74 | + |
| 75 | + |
| 76 | +class ListFindingsResponse(object): |
| 77 | + class ListFindingsResult(object): |
| 78 | + class StateChange(enum.IntEnum): |
| 79 | + """ |
| 80 | + The change in state of the finding. |
| 81 | +
|
| 82 | + When querying across two points in time this describes the change in the |
| 83 | + finding between the two points: CHANGED, UNCHANGED, ADDED, or REMOVED. |
| 84 | + Findings can not be deleted, so REMOVED implies that the finding at |
| 85 | + timestamp does not match the filter specified, but it did at timestamp - |
| 86 | + compare\_duration. If there was no compare\_duration supplied in the |
| 87 | + request the state change will be: UNUSED |
| 88 | +
|
| 89 | + Attributes: |
| 90 | + UNUSED (int): State change is unused, this is the canonical default for this enum. |
| 91 | + CHANGED (int): The finding has changed state in some way between the points in time |
| 92 | + and existed at both points. |
| 93 | + UNCHANGED (int): The finding has not changed state between the points in time and |
| 94 | + existed at both points. |
| 95 | + ADDED (int): The finding was created between the points in time. |
| 96 | + REMOVED (int): The finding at timestamp does not match the filter specified, but it did |
| 97 | + at timestamp - compare\_duration. |
| 98 | + """ |
| 99 | + |
| 100 | + UNUSED = 0 |
| 101 | + CHANGED = 1 |
| 102 | + UNCHANGED = 2 |
| 103 | + ADDED = 3 |
| 104 | + REMOVED = 4 |
| 105 | + |
| 106 | + |
| 107 | +class OrganizationSettings(object): |
| 108 | + class AssetDiscoveryConfig(object): |
| 109 | + class InclusionMode(enum.IntEnum): |
| 110 | + """ |
| 111 | + The mode of inclusion when running Asset Discovery. Asset discovery can |
| 112 | + be limited by explicitly identifying projects to be included or |
| 113 | + excluded. If INCLUDE\_ONLY is set, then only those projects within the |
| 114 | + organization and their children are discovered during asset discovery. |
| 115 | + If EXCLUDE is set, then projects that don't match those projects are |
| 116 | + discovered during asset discovery. If neither are set, then all projects |
| 117 | + within the organization are discovered during asset discovery. |
| 118 | +
|
| 119 | + Attributes: |
| 120 | + INCLUSION_MODE_UNSPECIFIED (int): Unspecified. Setting the mode with this value will disable |
| 121 | + inclusion/exclusion filtering for Asset Discovery. |
| 122 | + INCLUDE_ONLY (int): Asset Discovery will capture only the resources within the projects |
| 123 | + specified. All other resources will be ignored. |
| 124 | + EXCLUDE (int): Asset Discovery will ignore all resources under the projects specified. |
| 125 | + All other resources will be retrieved. |
| 126 | + """ |
| 127 | + |
| 128 | + INCLUSION_MODE_UNSPECIFIED = 0 |
| 129 | + INCLUDE_ONLY = 1 |
| 130 | + EXCLUDE = 2 |
0 commit comments