Skip to content

Commit 40c1473

Browse files
docs(dlp): standardize use of 'required', 'optional' in docstrings; add descriptions to enums (via synth) (#10103)
1 parent 211f8c7 commit 40c1473

File tree

5 files changed

+1297
-4326
lines changed

5 files changed

+1297
-4326
lines changed

dlp/google/cloud/dlp_v2/gapic/dlp_service_client.py

+48-46
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,11 @@ def inspect_content(
323323
324324
If a dict is provided, it must be of the same form as the protobuf
325325
message :class:`~google.cloud.dlp_v2.types.ContentItem`
326-
inspect_template_name (str): Optional template to use. Any configuration directly specified in
327-
inspect\_config will override those set in the template. Singular fields
328-
that are set in this request will replace their corresponding fields in
329-
the template. Repeated fields are appended. Singular sub-messages and
330-
groups are recursively merged.
326+
inspect_template_name (str): Template to use. Any configuration directly specified in inspect\_config
327+
will override those set in the template. Singular fields that are set in
328+
this request will replace their corresponding fields in the template.
329+
Repeated fields are appended. Singular sub-messages and groups are
330+
recursively merged.
331331
location_id (str): The geographic location to process content inspection. Reserved for future
332332
extensions.
333333
retry (Optional[google.api_core.retry.Retry]): A retry object used
@@ -537,12 +537,12 @@ def deidentify_content(
537537
538538
If a dict is provided, it must be of the same form as the protobuf
539539
message :class:`~google.cloud.dlp_v2.types.ContentItem`
540-
inspect_template_name (str): Optional template to use. Any configuration directly specified in
541-
inspect\_config will override those set in the template. Singular fields
542-
that are set in this request will replace their corresponding fields in
543-
the template. Repeated fields are appended. Singular sub-messages and
544-
groups are recursively merged.
545-
deidentify_template_name (str): Optional template to use. Any configuration directly specified in
540+
inspect_template_name (str): Template to use. Any configuration directly specified in inspect\_config
541+
will override those set in the template. Singular fields that are set in
542+
this request will replace their corresponding fields in the template.
543+
Repeated fields are appended. Singular sub-messages and groups are
544+
recursively merged.
545+
deidentify_template_name (str): Template to use. Any configuration directly specified in
546546
deidentify\_config will override those set in the template. Singular
547547
fields that are set in this request will replace their corresponding
548548
fields in the template. Repeated fields are appended. Singular
@@ -655,17 +655,17 @@ def reidentify_content(
655655
656656
If a dict is provided, it must be of the same form as the protobuf
657657
message :class:`~google.cloud.dlp_v2.types.ContentItem`
658-
inspect_template_name (str): Optional template to use. Any configuration directly specified in
658+
inspect_template_name (str): Template to use. Any configuration directly specified in
659+
``inspect_config`` will override those set in the template. Singular
660+
fields that are set in this request will replace their corresponding
661+
fields in the template. Repeated fields are appended. Singular
662+
sub-messages and groups are recursively merged.
663+
reidentify_template_name (str): Template to use. References an instance of ``DeidentifyTemplate``. Any
664+
configuration directly specified in ``reidentify_config`` or
659665
``inspect_config`` will override those set in the template. Singular
660666
fields that are set in this request will replace their corresponding
661667
fields in the template. Repeated fields are appended. Singular
662668
sub-messages and groups are recursively merged.
663-
reidentify_template_name (str): Optional template to use. References an instance of
664-
``DeidentifyTemplate``. Any configuration directly specified in
665-
``reidentify_config`` or ``inspect_config`` will override those set in
666-
the template. Singular fields that are set in this request will replace
667-
their corresponding fields in the template. Repeated fields are
668-
appended. Singular sub-messages and groups are recursively merged.
669669
location_id (str): The geographic location to process content reidentification. Reserved for
670670
future extensions.
671671
retry (Optional[google.api_core.retry.Retry]): A retry object used
@@ -746,11 +746,11 @@ def list_info_types(
746746
>>> response = client.list_info_types()
747747
748748
Args:
749-
language_code (str): Optional BCP-47 language code for localized infoType friendly
749+
language_code (str): BCP-47 language code for localized infoType friendly
750750
names. If omitted, or if localized strings are not available,
751751
en-US strings will be returned.
752-
filter_ (str): Optional filter to only return infoTypes supported by certain parts of
753-
the API. Defaults to supported\_by=INSPECT.
752+
filter_ (str): filter to only return infoTypes supported by certain parts of the API.
753+
Defaults to supported\_by=INSPECT.
754754
location_id (str): The geographic location to list info types. Reserved for future
755755
extensions.
756756
retry (Optional[google.api_core.retry.Retry]): A retry object used
@@ -830,7 +830,7 @@ def create_inspect_template(
830830
Args:
831831
parent (str): Required. The parent resource name, for example projects/my-project-id or
832832
organizations/my-org-id.
833-
inspect_template (Union[dict, ~google.cloud.dlp_v2.types.InspectTemplate]): The InspectTemplate to create.
833+
inspect_template (Union[dict, ~google.cloud.dlp_v2.types.InspectTemplate]): Required. The InspectTemplate to create.
834834
835835
If a dict is provided, it must be of the same form as the protobuf
836836
message :class:`~google.cloud.dlp_v2.types.InspectTemplate`
@@ -1091,9 +1091,9 @@ def list_inspect_templates(
10911091
resource, this parameter does not affect the return value. If page
10921092
streaming is performed per-page, this determines the maximum number
10931093
of resources in a page.
1094-
order_by (str): Optional comma separated list of fields to order by, followed by ``asc``
1095-
or ``desc`` postfix. This list is case-insensitive, default sorting
1096-
order is ascending, redundant space characters are insignificant.
1094+
order_by (str): Comma separated list of fields to order by, followed by ``asc`` or
1095+
``desc`` postfix. This list is case-insensitive, default sorting order
1096+
is ascending, redundant space characters are insignificant.
10971097
10981098
Example: ``name asc,update_time, create_time desc``
10991099
@@ -1270,7 +1270,7 @@ def create_deidentify_template(
12701270
Args:
12711271
parent (str): Required. The parent resource name, for example projects/my-project-id or
12721272
organizations/my-org-id.
1273-
deidentify_template (Union[dict, ~google.cloud.dlp_v2.types.DeidentifyTemplate]): The DeidentifyTemplate to create.
1273+
deidentify_template (Union[dict, ~google.cloud.dlp_v2.types.DeidentifyTemplate]): Required. The DeidentifyTemplate to create.
12741274
12751275
If a dict is provided, it must be of the same form as the protobuf
12761276
message :class:`~google.cloud.dlp_v2.types.DeidentifyTemplate`
@@ -1541,9 +1541,9 @@ def list_deidentify_templates(
15411541
resource, this parameter does not affect the return value. If page
15421542
streaming is performed per-page, this determines the maximum number
15431543
of resources in a page.
1544-
order_by (str): Optional comma separated list of fields to order by, followed by ``asc``
1545-
or ``desc`` postfix. This list is case-insensitive, default sorting
1546-
order is ascending, redundant space characters are insignificant.
1544+
order_by (str): Comma separated list of fields to order by, followed by ``asc`` or
1545+
``desc`` postfix. This list is case-insensitive, default sorting order
1546+
is ascending, redundant space characters are insignificant.
15471547
15481548
Example: ``name asc,update_time, create_time desc``
15491549
@@ -1727,10 +1727,12 @@ def create_dlp_job(
17271727
17281728
Args:
17291729
parent (str): Required. The parent resource name, for example projects/my-project-id.
1730-
inspect_job (Union[dict, ~google.cloud.dlp_v2.types.InspectJobConfig]):
1730+
inspect_job (Union[dict, ~google.cloud.dlp_v2.types.InspectJobConfig]): Set to control what and how to inspect.
1731+
17311732
If a dict is provided, it must be of the same form as the protobuf
17321733
message :class:`~google.cloud.dlp_v2.types.InspectJobConfig`
1733-
risk_job (Union[dict, ~google.cloud.dlp_v2.types.RiskAnalysisJobConfig]):
1734+
risk_job (Union[dict, ~google.cloud.dlp_v2.types.RiskAnalysisJobConfig]): Set to choose what metric to calculate.
1735+
17341736
If a dict is provided, it must be of the same form as the protobuf
17351737
message :class:`~google.cloud.dlp_v2.types.RiskAnalysisJobConfig`
17361738
job_id (str): The job id can contain uppercase and lowercase letters, numbers, and
@@ -1839,14 +1841,14 @@ def list_dlp_jobs(
18391841
18401842
Args:
18411843
parent (str): Required. The parent resource name, for example projects/my-project-id.
1842-
filter_ (str): Optional. Allows filtering.
1844+
filter_ (str): Allows filtering.
18431845
18441846
Supported syntax:
18451847
18461848
- Filter expressions are made up of one or more restrictions.
18471849
- Restrictions can be combined by ``AND`` or ``OR`` logical operators.
18481850
A sequence of restrictions implicitly uses ``AND``.
1849-
- A restriction has the form of ``<field> <operator> <value>``.
1851+
- A restriction has the form of ``{field} {operator} {value}``.
18501852
- Supported fields/values for inspect jobs:
18511853
18521854
- ``state`` - PENDING\|RUNNING\|CANCELED\|FINISHED\|FAILED
@@ -1879,9 +1881,9 @@ def list_dlp_jobs(
18791881
streaming is performed per-page, this determines the maximum number
18801882
of resources in a page.
18811883
type_ (~google.cloud.dlp_v2.types.DlpJobType): The type of job. Defaults to ``DlpJobType.INSPECT``
1882-
order_by (str): Optional comma separated list of fields to order by, followed by ``asc``
1883-
or ``desc`` postfix. This list is case-insensitive, default sorting
1884-
order is ascending, redundant space characters are insignificant.
1884+
order_by (str): Comma separated list of fields to order by, followed by ``asc`` or
1885+
``desc`` postfix. This list is case-insensitive, default sorting order
1886+
is ascending, redundant space characters are insignificant.
18851887
18861888
Example: ``name asc, end_time asc, create_time desc``
18871889
@@ -2217,9 +2219,9 @@ def list_job_triggers(
22172219
resource, this parameter does not affect the return value. If page
22182220
streaming is performed per-page, this determines the maximum number
22192221
of resources in a page.
2220-
order_by (str): Optional comma separated list of triggeredJob fields to order by,
2221-
followed by ``asc`` or ``desc`` postfix. This list is case-insensitive,
2222-
default sorting order is ascending, redundant space characters are
2222+
order_by (str): Comma separated list of triggeredJob fields to order by, followed by
2223+
``asc`` or ``desc`` postfix. This list is case-insensitive, default
2224+
sorting order is ascending, redundant space characters are
22232225
insignificant.
22242226
22252227
Example: ``name asc,update_time, create_time desc``
@@ -2232,14 +2234,14 @@ def list_job_triggers(
22322234
- ``name``: corresponds to JobTrigger's name.
22332235
- ``display_name``: corresponds to JobTrigger's display name.
22342236
- ``status``: corresponds to JobTrigger's status.
2235-
filter_ (str): Optional. Allows filtering.
2237+
filter_ (str): Allows filtering.
22362238
22372239
Supported syntax:
22382240
22392241
- Filter expressions are made up of one or more restrictions.
22402242
- Restrictions can be combined by ``AND`` or ``OR`` logical operators.
22412243
A sequence of restrictions implicitly uses ``AND``.
2242-
- A restriction has the form of ``<field> <operator> <value>``.
2244+
- A restriction has the form of ``{field} {operator} {value}``.
22432245
- Supported fields/values for inspect jobs:
22442246
22452247
- ``status`` - HEALTHY\|PAUSED\|CANCELLED
@@ -2580,7 +2582,7 @@ def create_job_trigger(
25802582
25812583
Args:
25822584
parent (str): Required. The parent resource name, for example projects/my-project-id.
2583-
job_trigger (Union[dict, ~google.cloud.dlp_v2.types.JobTrigger]): The JobTrigger to create.
2585+
job_trigger (Union[dict, ~google.cloud.dlp_v2.types.JobTrigger]): Required. The JobTrigger to create.
25842586
25852587
If a dict is provided, it must be of the same form as the protobuf
25862588
message :class:`~google.cloud.dlp_v2.types.JobTrigger`
@@ -2670,7 +2672,7 @@ def create_stored_info_type(
26702672
Args:
26712673
parent (str): Required. The parent resource name, for example projects/my-project-id or
26722674
organizations/my-org-id.
2673-
config (Union[dict, ~google.cloud.dlp_v2.types.StoredInfoTypeConfig]): Configuration of the storedInfoType to create.
2675+
config (Union[dict, ~google.cloud.dlp_v2.types.StoredInfoTypeConfig]): Required. Configuration of the storedInfoType to create.
26742676
26752677
If a dict is provided, it must be of the same form as the protobuf
26762678
message :class:`~google.cloud.dlp_v2.types.StoredInfoTypeConfig`
@@ -2939,9 +2941,9 @@ def list_stored_info_types(
29392941
resource, this parameter does not affect the return value. If page
29402942
streaming is performed per-page, this determines the maximum number
29412943
of resources in a page.
2942-
order_by (str): Optional comma separated list of fields to order by, followed by ``asc``
2943-
or ``desc`` postfix. This list is case-insensitive, default sorting
2944-
order is ascending, redundant space characters are insignificant.
2944+
order_by (str): Comma separated list of fields to order by, followed by ``asc`` or
2945+
``desc`` postfix. This list is case-insensitive, default sorting order
2946+
is ascending, redundant space characters are insignificant.
29452947
29462948
Example: ``name asc, display_name, create_time desc``
29472949

0 commit comments

Comments
 (0)