Skip to content

Commit 0f64a76

Browse files
committed
Remove None from param types and add (Optional).
This runs a script to remove None from the types for parameters, and added (Optional) to the description. Does not pass lint due to some too-long lines. I will clean those up manually. See: googleapis/google-cloud-python#2580 (review)
1 parent b30e955 commit 0f64a76

File tree

3 files changed

+34
-34
lines changed

3 files changed

+34
-34
lines changed

google/cloud/dns/changes.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ def delete_record_set(self, record_set):
169169
def _require_client(self, client):
170170
"""Check client or verify over-ride.
171171
172-
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
173-
:param client: the client to use. If not passed, falls back to the
172+
:type client: :class:`google.cloud.dns.client.Client`
173+
:param client: (Optional) the client to use. If not passed, falls back to the
174174
``client`` stored on the current zone.
175175
176176
:rtype: :class:`google.cloud.dns.client.Client`
@@ -207,8 +207,8 @@ def create(self, client=None):
207207
See:
208208
https://cloud.google.com/dns/api/v1/changes/create
209209
210-
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
211-
:param client: the client to use. If not passed, falls back to the
210+
:type client: :class:`google.cloud.dns.client.Client`
211+
:param client: (Optional) the client to use. If not passed, falls back to the
212212
``client`` stored on the current zone.
213213
"""
214214
if len(self.additions) == 0 and len(self.deletions) == 0:
@@ -226,8 +226,8 @@ def exists(self, client=None):
226226
See
227227
https://cloud.google.com/dns/api/v1/changes/get
228228
229-
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
230-
:param client: the client to use. If not passed, falls back to the
229+
:type client: :class:`google.cloud.dns.client.Client`
230+
:param client: (Optional) the client to use. If not passed, falls back to the
231231
``client`` stored on the current zone.
232232
233233
:rtype: bool
@@ -248,8 +248,8 @@ def reload(self, client=None):
248248
See
249249
https://cloud.google.com/dns/api/v1/changes/get
250250
251-
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
252-
:param client: the client to use. If not passed, falls back to the
251+
:type client: :class:`google.cloud.dns.client.Client`
252+
:param client: (Optional) the client to use. If not passed, falls back to the
253253
``client`` stored on the current zone.
254254
"""
255255
client = self._require_client(client)

google/cloud/dns/client.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ def zone(self, name, dns_name=None, description=None):
9191
:type name: str
9292
:param name: Name of the zone.
9393
94-
:type dns_name: str or :class:`NoneType`
95-
:param dns_name: DNS name of the zone. If not passed, then calls
94+
:type dns_name: str
95+
:param dns_name: (Optional) DNS name of the zone. If not passed, then calls
9696
to :meth:`zone.create` will fail.
9797
98-
:type description: str or :class:`NoneType`
99-
:param description: the description for the zone. If not passed,
98+
:type description: str
99+
:param description: (Optional) the description for the zone. If not passed,
100100
defaults to the value of 'dns_name'.
101101
102102
:rtype: :class:`google.cloud.dns.zone.ManagedZone`

google/cloud/dns/zone.py

+22-22
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ class ManagedZone(object):
3232
:type name: str
3333
:param name: the name of the zone
3434
35-
:type dns_name: str or :class:`NoneType`
36-
:param dns_name: the DNS name of the zone. If not passed, then calls
35+
:type dns_name: str
36+
:param dns_name: (Optional) the DNS name of the zone. If not passed, then calls
3737
to :meth:`create` will fail.
3838
3939
:type client: :class:`google.cloud.dns.client.Client`
4040
:param client: A client which holds credentials and project configuration
4141
for the zone (which requires a project).
4242
43-
:type description: str or :class:`NoneType`
44-
:param description: the description for the zone. If not passed, defaults
43+
:type description: str
44+
:param description: (Optional) the description for the zone. If not passed, defaults
4545
to the value of 'dns_name'.
4646
"""
4747

@@ -135,8 +135,8 @@ def description(self):
135135
def description(self, value):
136136
"""Update description of the zone.
137137
138-
:type value: str, or ``NoneType``
139-
:param value: new description
138+
:type value: str
139+
:param value: (Optional) new description
140140
141141
:raises: ValueError for invalid value types.
142142
"""
@@ -162,8 +162,8 @@ def name_server_set(self):
162162
def name_server_set(self, value):
163163
"""Update named set of DNS name servers.
164164
165-
:type value: str, or ``NoneType``
166-
:param value: new title
165+
:type value: str
166+
:param value: (Optional) new title
167167
168168
:raises: ValueError for invalid value types.
169169
"""
@@ -202,8 +202,8 @@ def changes(self):
202202
def _require_client(self, client):
203203
"""Check client or verify over-ride.
204204
205-
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
206-
:param client: the client to use. If not passed, falls back to the
205+
:type client: :class:`google.cloud.dns.client.Client`
206+
:param client: (Optional) the client to use. If not passed, falls back to the
207207
``client`` stored on the current zone.
208208
209209
:rtype: :class:`google.cloud.dns.client.Client`
@@ -250,8 +250,8 @@ def create(self, client=None):
250250
See:
251251
https://cloud.google.com/dns/api/v1/managedZones/create
252252
253-
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
254-
:param client: the client to use. If not passed, falls back to the
253+
:type client: :class:`google.cloud.dns.client.Client`
254+
:param client: (Optional) the client to use. If not passed, falls back to the
255255
``client`` stored on the current zone.
256256
"""
257257
client = self._require_client(client)
@@ -266,8 +266,8 @@ def exists(self, client=None):
266266
See
267267
https://cloud.google.com/dns/api/v1/managedZones/get
268268
269-
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
270-
:param client: the client to use. If not passed, falls back to the
269+
:type client: :class:`google.cloud.dns.client.Client`
270+
:param client: (Optional) the client to use. If not passed, falls back to the
271271
``client`` stored on the current zone.
272272
273273
:rtype: bool
@@ -289,8 +289,8 @@ def reload(self, client=None):
289289
See
290290
https://cloud.google.com/dns/api/v1/managedZones/get
291291
292-
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
293-
:param client: the client to use. If not passed, falls back to the
292+
:type client: :class:`google.cloud.dns.client.Client`
293+
:param client: (Optional) the client to use. If not passed, falls back to the
294294
``client`` stored on the current zone.
295295
"""
296296
client = self._require_client(client)
@@ -305,8 +305,8 @@ def delete(self, client=None):
305305
See:
306306
https://cloud.google.com/dns/api/v1/managedZones/delete
307307
308-
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
309-
:param client: the client to use. If not passed, falls back to the
308+
:type client: :class:`google.cloud.dns.client.Client`
309+
:param client: (Optional) the client to use. If not passed, falls back to the
310310
``client`` stored on the current zone.
311311
"""
312312
client = self._require_client(client)
@@ -328,8 +328,8 @@ def list_resource_record_sets(self, max_results=None, page_token=None,
328328
not passed, the API will return the first page of
329329
zones.
330330
331-
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
332-
:param client: the client to use. If not passed, falls back to the
331+
:type client: :class:`google.cloud.dns.client.Client`
332+
:param client: (Optional) the client to use. If not passed, falls back to the
333333
``client`` stored on the current zone.
334334
335335
:rtype: :class:`~google.cloud.iterator.Iterator`
@@ -361,8 +361,8 @@ def list_changes(self, max_results=None, page_token=None, client=None):
361361
not passed, the API will return the first page of
362362
zones.
363363
364-
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
365-
:param client: the client to use. If not passed, falls back to the
364+
:type client: :class:`google.cloud.dns.client.Client`
365+
:param client: (Optional) the client to use. If not passed, falls back to the
366366
``client`` stored on the current zone.
367367
368368
:rtype: :class:`~google.cloud.iterator.Iterator`

0 commit comments

Comments
 (0)