Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit 97b46fa

Browse files
docs: Add documentation for enums (#259)
* docs: Add documentation for enums fix: Add context manager return types chore: Update gapic-generator-python to v1.8.1 PiperOrigin-RevId: 503210727 Source-Link: googleapis/googleapis@a391fd1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/0080f830dec37c3384157082bce279e37079ea58 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent c2abd3f commit 97b46fa

File tree

18 files changed

+837
-41
lines changed

18 files changed

+837
-41
lines changed

google/cloud/osconfig_v1/services/os_config_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1802,7 +1802,7 @@ def sample_resume_patch_deployment():
18021802
# Done; return the response.
18031803
return response
18041804

1805-
def __enter__(self):
1805+
def __enter__(self) -> "OsConfigServiceClient":
18061806
return self
18071807

18081808
def __exit__(self, type, value, traceback):

google/cloud/osconfig_v1/services/os_config_zonal_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2179,7 +2179,7 @@ def sample_list_vulnerability_reports():
21792179
# Done; return the response.
21802180
return response
21812181

2182-
def __enter__(self):
2182+
def __enter__(self) -> "OsConfigZonalServiceClient":
21832183
return self
21842184

21852185
def __exit__(self, type, value, traceback):

google/cloud/osconfig_v1/types/inventory.py

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,18 @@
3232

3333

3434
class InventoryView(proto.Enum):
35-
r"""The view for inventory objects."""
35+
r"""The view for inventory objects.
36+
37+
Values:
38+
INVENTORY_VIEW_UNSPECIFIED (0):
39+
The default value.
40+
The API defaults to the BASIC view.
41+
BASIC (1):
42+
Returns the basic inventory information that includes
43+
``os_info``.
44+
FULL (2):
45+
Returns all fields.
46+
"""
3647
INVENTORY_VIEW_UNSPECIFIED = 0
3748
BASIC = 1
3849
FULL = 2
@@ -164,12 +175,32 @@ class Item(proto.Message):
164175
"""
165176

166177
class OriginType(proto.Enum):
167-
r"""The origin of a specific inventory item."""
178+
r"""The origin of a specific inventory item.
179+
180+
Values:
181+
ORIGIN_TYPE_UNSPECIFIED (0):
182+
Invalid. An origin type must be specified.
183+
INVENTORY_REPORT (1):
184+
This inventory item was discovered as the
185+
result of the agent reporting inventory via the
186+
reporting API.
187+
"""
168188
ORIGIN_TYPE_UNSPECIFIED = 0
169189
INVENTORY_REPORT = 1
170190

171191
class Type(proto.Enum):
172-
r"""The different types of inventory that are tracked on a VM."""
192+
r"""The different types of inventory that are tracked on a VM.
193+
194+
Values:
195+
TYPE_UNSPECIFIED (0):
196+
Invalid. An type must be specified.
197+
INSTALLED_PACKAGE (1):
198+
This represents a package that is installed
199+
on the VM.
200+
AVAILABLE_PACKAGE (2):
201+
This represents an update that is available
202+
for a package.
203+
"""
173204
TYPE_UNSPECIFIED = 0
174205
INSTALLED_PACKAGE = 1
175206
AVAILABLE_PACKAGE = 2

google/cloud/osconfig_v1/types/os_policy.py

Lines changed: 69 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,22 @@ class OSPolicy(proto.Message):
6565
"""
6666

6767
class Mode(proto.Enum):
68-
r"""Policy mode"""
68+
r"""Policy mode
69+
70+
Values:
71+
MODE_UNSPECIFIED (0):
72+
Invalid mode
73+
VALIDATION (1):
74+
This mode checks if the configuration
75+
resources in the policy are in their desired
76+
state. No actions are performed if they are not
77+
in the desired state. This mode is used for
78+
reporting purposes.
79+
ENFORCEMENT (2):
80+
This mode checks if the configuration
81+
resources in the policy are in their desired
82+
state, and if not, enforces the desired state.
83+
"""
6984
MODE_UNSPECIFIED = 0
7085
VALIDATION = 1
7186
ENFORCEMENT = 2
@@ -288,6 +303,15 @@ class PackageResource(proto.Message):
288303
class DesiredState(proto.Enum):
289304
r"""The desired state that the OS Config agent maintains on the
290305
VM.
306+
307+
Values:
308+
DESIRED_STATE_UNSPECIFIED (0):
309+
Unspecified is invalid.
310+
INSTALLED (1):
311+
Ensure that the package is installed.
312+
REMOVED (2):
313+
The agent ensures that the package is not
314+
installed and uninstalls it if detected.
291315
"""
292316
DESIRED_STATE_UNSPECIFIED = 0
293317
INSTALLED = 1
@@ -532,7 +556,18 @@ class AptRepository(proto.Message):
532556
"""
533557

534558
class ArchiveType(proto.Enum):
535-
r"""Type of archive."""
559+
r"""Type of archive.
560+
561+
Values:
562+
ARCHIVE_TYPE_UNSPECIFIED (0):
563+
Unspecified is invalid.
564+
DEB (1):
565+
Deb indicates that the archive contains
566+
binary files.
567+
DEB_SRC (2):
568+
Deb-src indicates that the archive contains
569+
source files.
570+
"""
536571
ARCHIVE_TYPE_UNSPECIFIED = 0
537572
DEB = 1
538573
DEB_SRC = 2
@@ -764,7 +799,24 @@ class Exec(proto.Message):
764799
"""
765800

766801
class Interpreter(proto.Enum):
767-
r"""The interpreter to use."""
802+
r"""The interpreter to use.
803+
804+
Values:
805+
INTERPRETER_UNSPECIFIED (0):
806+
Invalid value, the request will return
807+
validation error.
808+
NONE (1):
809+
If an interpreter is not specified, the source is executed
810+
directly. This execution, without an interpreter, only
811+
succeeds for executables and scripts that have shebang
812+
lines.
813+
SHELL (2):
814+
Indicates that the script runs with ``/bin/sh`` on Linux and
815+
``cmd.exe`` on Windows.
816+
POWERSHELL (3):
817+
Indicates that the script runs with
818+
PowerShell.
819+
"""
768820
INTERPRETER_UNSPECIFIED = 0
769821
NONE = 1
770822
SHELL = 2
@@ -853,7 +905,20 @@ class FileResource(proto.Message):
853905
"""
854906

855907
class DesiredState(proto.Enum):
856-
r"""Desired state of the file."""
908+
r"""Desired state of the file.
909+
910+
Values:
911+
DESIRED_STATE_UNSPECIFIED (0):
912+
Unspecified is invalid.
913+
PRESENT (1):
914+
Ensure file at path is present.
915+
ABSENT (2):
916+
Ensure file at path is absent.
917+
CONTENTS_MATCH (3):
918+
Ensure the contents of the file at path
919+
matches. If the file does not exist it will be
920+
created.
921+
"""
857922
DESIRED_STATE_UNSPECIFIED = 0
858923
PRESENT = 1
859924
ABSENT = 2

google/cloud/osconfig_v1/types/os_policy_assignment_reports.py

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,23 @@ class OSPolicyCompliance(proto.Message):
220220
"""
221221

222222
class ComplianceState(proto.Enum):
223-
r"""Possible compliance states for an os policy."""
223+
r"""Possible compliance states for an os policy.
224+
225+
Values:
226+
UNKNOWN (0):
227+
The policy is in an unknown compliance state.
228+
229+
Refer to the field ``compliance_state_reason`` to learn the
230+
exact reason for the policy to be in this compliance state.
231+
COMPLIANT (1):
232+
Policy is compliant.
233+
The policy is compliant if all the underlying
234+
resources are also compliant.
235+
NON_COMPLIANT (2):
236+
Policy is non-compliant.
237+
The policy is non-compliant if one or more
238+
underlying resources are non-compliant.
239+
"""
224240
UNKNOWN = 0
225241
COMPLIANT = 1
226242
NON_COMPLIANT = 2
@@ -262,7 +278,19 @@ class OSPolicyResourceCompliance(proto.Message):
262278
"""
263279

264280
class ComplianceState(proto.Enum):
265-
r"""Possible compliance states for a resource."""
281+
r"""Possible compliance states for a resource.
282+
283+
Values:
284+
UNKNOWN (0):
285+
The resource is in an unknown compliance state.
286+
287+
To get more details about why the policy is in this state,
288+
review the output of the ``compliance_state_reason`` field.
289+
COMPLIANT (1):
290+
Resource is compliant.
291+
NON_COMPLIANT (2):
292+
Resource is non-compliant.
293+
"""
266294
UNKNOWN = 0
267295
COMPLIANT = 1
268296
NON_COMPLIANT = 2
@@ -281,7 +309,30 @@ class OSPolicyResourceConfigStep(proto.Message):
281309
"""
282310

283311
class Type(proto.Enum):
284-
r"""Supported configuration step types"""
312+
r"""Supported configuration step types
313+
314+
Values:
315+
TYPE_UNSPECIFIED (0):
316+
Default value. This value is unused.
317+
VALIDATION (1):
318+
Checks for resource conflicts such as schema
319+
errors.
320+
DESIRED_STATE_CHECK (2):
321+
Checks the current status of the desired
322+
state for a resource.
323+
DESIRED_STATE_ENFORCEMENT (3):
324+
Enforces the desired state for a resource
325+
that is not in desired state.
326+
DESIRED_STATE_CHECK_POST_ENFORCEMENT (4):
327+
Re-checks the status of the desired state.
328+
This check is done for a resource after the
329+
enforcement of all OS policies.
330+
This step is used to determine the final desired
331+
state status for the resource. It accounts for
332+
any resources that might have drifted from their
333+
desired state due to side effects from executing
334+
other resources.
335+
"""
285336
TYPE_UNSPECIFIED = 0
286337
VALIDATION = 1
287338
DESIRED_STATE_CHECK = 2

google/cloud/osconfig_v1/types/os_policy_assignments.py

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,20 @@ class OSPolicyAssignment(proto.Message):
119119
"""
120120

121121
class RolloutState(proto.Enum):
122-
r"""OS policy assignment rollout state"""
122+
r"""OS policy assignment rollout state
123+
124+
Values:
125+
ROLLOUT_STATE_UNSPECIFIED (0):
126+
Invalid value
127+
IN_PROGRESS (1):
128+
The rollout is in progress.
129+
CANCELLING (2):
130+
The rollout is being cancelled.
131+
CANCELLED (3):
132+
The rollout is cancelled.
133+
SUCCEEDED (4):
134+
The rollout has completed successfully.
135+
"""
123136
ROLLOUT_STATE_UNSPECIFIED = 0
124137
IN_PROGRESS = 1
125138
CANCELLING = 2
@@ -335,14 +348,38 @@ class OSPolicyAssignmentOperationMetadata(proto.Message):
335348
"""
336349

337350
class APIMethod(proto.Enum):
338-
r"""The OS policy assignment API method."""
351+
r"""The OS policy assignment API method.
352+
353+
Values:
354+
API_METHOD_UNSPECIFIED (0):
355+
Invalid value
356+
CREATE (1):
357+
Create OS policy assignment API method
358+
UPDATE (2):
359+
Update OS policy assignment API method
360+
DELETE (3):
361+
Delete OS policy assignment API method
362+
"""
339363
API_METHOD_UNSPECIFIED = 0
340364
CREATE = 1
341365
UPDATE = 2
342366
DELETE = 3
343367

344368
class RolloutState(proto.Enum):
345-
r"""State of the rollout"""
369+
r"""State of the rollout
370+
371+
Values:
372+
ROLLOUT_STATE_UNSPECIFIED (0):
373+
Invalid value
374+
IN_PROGRESS (1):
375+
The rollout is in progress.
376+
CANCELLING (2):
377+
The rollout is being cancelled.
378+
CANCELLED (3):
379+
The rollout is cancelled.
380+
SUCCEEDED (4):
381+
The rollout has completed successfully.
382+
"""
346383
ROLLOUT_STATE_UNSPECIFIED = 0
347384
IN_PROGRESS = 1
348385
CANCELLING = 2

google/cloud/osconfig_v1/types/patch_deployments.py

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,20 @@ class PatchDeployment(proto.Message):
110110
"""
111111

112112
class State(proto.Enum):
113-
r"""Represents state of patch peployment."""
113+
r"""Represents state of patch peployment.
114+
115+
Values:
116+
STATE_UNSPECIFIED (0):
117+
The default value. This value is used if the
118+
state is omitted.
119+
ACTIVE (1):
120+
Active value means that patch deployment
121+
generates Patch Jobs.
122+
PAUSED (2):
123+
Paused value means that patch deployment does
124+
not generate Patch jobs. Requires user action to
125+
move in and out from this state.
126+
"""
114127
STATE_UNSPECIFIED = 0
115128
ACTIVE = 1
116129
PAUSED = 2
@@ -239,7 +252,21 @@ class RecurringSchedule(proto.Message):
239252
"""
240253

241254
class Frequency(proto.Enum):
242-
r"""Specifies the frequency of the recurring patch deployments."""
255+
r"""Specifies the frequency of the recurring patch deployments.
256+
257+
Values:
258+
FREQUENCY_UNSPECIFIED (0):
259+
Invalid. A frequency must be specified.
260+
WEEKLY (1):
261+
Indicates that the frequency of recurrence
262+
should be expressed in terms of weeks.
263+
MONTHLY (2):
264+
Indicates that the frequency of recurrence
265+
should be expressed in terms of months.
266+
DAILY (3):
267+
Indicates that the frequency of recurrence
268+
should be expressed in terms of days.
269+
"""
243270
FREQUENCY_UNSPECIFIED = 0
244271
WEEKLY = 1
245272
MONTHLY = 2

0 commit comments

Comments
 (0)