Skip to content

Commit d1a5391

Browse files
yoshi-automationbusunkim96
authored andcommitted
DLP: Add nox session docs, reorder methods (via synth). (googleapis#7769)
1 parent d1bc346 commit d1a5391

5 files changed

Lines changed: 66 additions & 36 deletions

File tree

dlp/docs/README.rst

Whitespace-only changes.

dlp/docs/index.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. include:: /../dlp/README.rst
1+
.. include:: README.rst
22

33
Api Reference
44
-------------
@@ -8,3 +8,13 @@ Api Reference
88
gapic/v2/api
99
gapic/v2/types
1010
changelog
11+
12+
Changelog
13+
---------
14+
15+
For a list of all ``google-cloud-dlp`` releases:
16+
17+
.. toctree::
18+
:maxdepth: 2
19+
20+
changelog

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

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8181

8282
from_service_account_json = from_service_account_file
8383

84+
@classmethod
85+
def dlp_job_path(cls, project, dlp_job):
86+
"""Return a fully-qualified dlp_job string."""
87+
return google.api_core.path_template.expand(
88+
"projects/{project}/dlpJobs/{dlp_job}", project=project, dlp_job=dlp_job
89+
)
90+
8491
@classmethod
8592
def organization_path(cls, organization):
8693
"""Return a fully-qualified organization string."""
@@ -97,15 +104,6 @@ def organization_deidentify_template_path(cls, organization, deidentify_template
97104
deidentify_template=deidentify_template,
98105
)
99106

100-
@classmethod
101-
def project_deidentify_template_path(cls, project, deidentify_template):
102-
"""Return a fully-qualified project_deidentify_template string."""
103-
return google.api_core.path_template.expand(
104-
"projects/{project}/deidentifyTemplates/{deidentify_template}",
105-
project=project,
106-
deidentify_template=deidentify_template,
107-
)
108-
109107
@classmethod
110108
def organization_inspect_template_path(cls, organization, inspect_template):
111109
"""Return a fully-qualified organization_inspect_template string."""
@@ -116,44 +114,46 @@ def organization_inspect_template_path(cls, organization, inspect_template):
116114
)
117115

118116
@classmethod
119-
def project_inspect_template_path(cls, project, inspect_template):
120-
"""Return a fully-qualified project_inspect_template string."""
117+
def organization_stored_info_type_path(cls, organization, stored_info_type):
118+
"""Return a fully-qualified organization_stored_info_type string."""
121119
return google.api_core.path_template.expand(
122-
"projects/{project}/inspectTemplates/{inspect_template}",
123-
project=project,
124-
inspect_template=inspect_template,
120+
"organizations/{organization}/storedInfoTypes/{stored_info_type}",
121+
organization=organization,
122+
stored_info_type=stored_info_type,
125123
)
126124

127125
@classmethod
128-
def project_job_trigger_path(cls, project, job_trigger):
129-
"""Return a fully-qualified project_job_trigger string."""
126+
def project_path(cls, project):
127+
"""Return a fully-qualified project string."""
130128
return google.api_core.path_template.expand(
131-
"projects/{project}/jobTriggers/{job_trigger}",
132-
project=project,
133-
job_trigger=job_trigger,
129+
"projects/{project}", project=project
134130
)
135131

136132
@classmethod
137-
def project_path(cls, project):
138-
"""Return a fully-qualified project string."""
133+
def project_deidentify_template_path(cls, project, deidentify_template):
134+
"""Return a fully-qualified project_deidentify_template string."""
139135
return google.api_core.path_template.expand(
140-
"projects/{project}", project=project
136+
"projects/{project}/deidentifyTemplates/{deidentify_template}",
137+
project=project,
138+
deidentify_template=deidentify_template,
141139
)
142140

143141
@classmethod
144-
def dlp_job_path(cls, project, dlp_job):
145-
"""Return a fully-qualified dlp_job string."""
142+
def project_inspect_template_path(cls, project, inspect_template):
143+
"""Return a fully-qualified project_inspect_template string."""
146144
return google.api_core.path_template.expand(
147-
"projects/{project}/dlpJobs/{dlp_job}", project=project, dlp_job=dlp_job
145+
"projects/{project}/inspectTemplates/{inspect_template}",
146+
project=project,
147+
inspect_template=inspect_template,
148148
)
149149

150150
@classmethod
151-
def organization_stored_info_type_path(cls, organization, stored_info_type):
152-
"""Return a fully-qualified organization_stored_info_type string."""
151+
def project_job_trigger_path(cls, project, job_trigger):
152+
"""Return a fully-qualified project_job_trigger string."""
153153
return google.api_core.path_template.expand(
154-
"organizations/{organization}/storedInfoTypes/{stored_info_type}",
155-
organization=organization,
156-
stored_info_type=stored_info_type,
154+
"projects/{project}/jobTriggers/{job_trigger}",
155+
project=project,
156+
job_trigger=job_trigger,
157157
)
158158

159159
@classmethod

dlp/noxfile.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
from __future__ import absolute_import
1818
import os
19+
import shutil
1920

2021
import nox
2122

@@ -138,3 +139,22 @@ def cover(session):
138139
session.run("coverage", "report", "--show-missing", "--fail-under=100")
139140

140141
session.run("coverage", "erase")
142+
143+
@nox.session(python="3.7")
144+
def docs(session):
145+
"""Build the docs for this library."""
146+
147+
session.install('-e', '.')
148+
session.install('sphinx', 'alabaster', 'recommonmark')
149+
150+
shutil.rmtree(os.path.join('docs', '_build'), ignore_errors=True)
151+
session.run(
152+
'sphinx-build',
153+
'-W', # warnings as errors
154+
'-T', # show full traceback on exception
155+
'-N', # no colors
156+
'-b', 'html',
157+
'-d', os.path.join('docs', '_build', 'doctrees', ''),
158+
os.path.join('docs', ''),
159+
os.path.join('docs', '_build', 'html', ''),
160+
)

dlp/synth.metadata

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2019-04-15T20:10:34.308957Z",
2+
"updateTime": "2019-04-23T12:15:31.082893Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.16.25",
8-
"dockerImage": "googleapis/artman@sha256:d9597f983d1d4e61272c63cb97b7d8f8234da9999526c35d357de3d781f0ec1b"
7+
"version": "0.17.0",
8+
"dockerImage": "googleapis/artman@sha256:c58f4ec3838eb4e0718eb1bccc6512bd6850feaa85a360a9e38f6f848ec73bc2"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "1a479920eb4f6c2bc4c8d8acd9280720540709e4",
16-
"internalRef": "243633969"
15+
"sha": "547e19e7df398e9290e8e3674d7351efc500f9b0",
16+
"internalRef": "244712781"
1717
}
1818
},
1919
{

0 commit comments

Comments
 (0)