Skip to content

Commit

Permalink
Remove None from param types and add (Optional).
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
tswast committed Oct 21, 2016
1 parent b30e955 commit 0f64a76
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
16 changes: 8 additions & 8 deletions google/cloud/dns/changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ def delete_record_set(self, record_set):
def _require_client(self, client):
"""Check client or verify over-ride.
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
:param client: the client to use. If not passed, falls back to the
:type client: :class:`google.cloud.dns.client.Client`
:param client: (Optional) the client to use. If not passed, falls back to the
``client`` stored on the current zone.
:rtype: :class:`google.cloud.dns.client.Client`
Expand Down Expand Up @@ -207,8 +207,8 @@ def create(self, client=None):
See:
https://cloud.google.com/dns/api/v1/changes/create
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
:param client: the client to use. If not passed, falls back to the
:type client: :class:`google.cloud.dns.client.Client`
:param client: (Optional) the client to use. If not passed, falls back to the
``client`` stored on the current zone.
"""
if len(self.additions) == 0 and len(self.deletions) == 0:
Expand All @@ -226,8 +226,8 @@ def exists(self, client=None):
See
https://cloud.google.com/dns/api/v1/changes/get
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
:param client: the client to use. If not passed, falls back to the
:type client: :class:`google.cloud.dns.client.Client`
:param client: (Optional) the client to use. If not passed, falls back to the
``client`` stored on the current zone.
:rtype: bool
Expand All @@ -248,8 +248,8 @@ def reload(self, client=None):
See
https://cloud.google.com/dns/api/v1/changes/get
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
:param client: the client to use. If not passed, falls back to the
:type client: :class:`google.cloud.dns.client.Client`
:param client: (Optional) the client to use. If not passed, falls back to the
``client`` stored on the current zone.
"""
client = self._require_client(client)
Expand Down
8 changes: 4 additions & 4 deletions google/cloud/dns/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ def zone(self, name, dns_name=None, description=None):
:type name: str
:param name: Name of the zone.
:type dns_name: str or :class:`NoneType`
:param dns_name: DNS name of the zone. If not passed, then calls
:type dns_name: str
:param dns_name: (Optional) DNS name of the zone. If not passed, then calls
to :meth:`zone.create` will fail.
:type description: str or :class:`NoneType`
:param description: the description for the zone. If not passed,
:type description: str
:param description: (Optional) the description for the zone. If not passed,
defaults to the value of 'dns_name'.
:rtype: :class:`google.cloud.dns.zone.ManagedZone`
Expand Down
44 changes: 22 additions & 22 deletions google/cloud/dns/zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ class ManagedZone(object):
:type name: str
:param name: the name of the zone
:type dns_name: str or :class:`NoneType`
:param dns_name: the DNS name of the zone. If not passed, then calls
:type dns_name: str
:param dns_name: (Optional) the DNS name of the zone. If not passed, then calls
to :meth:`create` will fail.
:type client: :class:`google.cloud.dns.client.Client`
:param client: A client which holds credentials and project configuration
for the zone (which requires a project).
:type description: str or :class:`NoneType`
:param description: the description for the zone. If not passed, defaults
:type description: str
:param description: (Optional) the description for the zone. If not passed, defaults
to the value of 'dns_name'.
"""

Expand Down Expand Up @@ -135,8 +135,8 @@ def description(self):
def description(self, value):
"""Update description of the zone.
:type value: str, or ``NoneType``
:param value: new description
:type value: str
:param value: (Optional) new description
:raises: ValueError for invalid value types.
"""
Expand All @@ -162,8 +162,8 @@ def name_server_set(self):
def name_server_set(self, value):
"""Update named set of DNS name servers.
:type value: str, or ``NoneType``
:param value: new title
:type value: str
:param value: (Optional) new title
:raises: ValueError for invalid value types.
"""
Expand Down Expand Up @@ -202,8 +202,8 @@ def changes(self):
def _require_client(self, client):
"""Check client or verify over-ride.
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
:param client: the client to use. If not passed, falls back to the
:type client: :class:`google.cloud.dns.client.Client`
:param client: (Optional) the client to use. If not passed, falls back to the
``client`` stored on the current zone.
:rtype: :class:`google.cloud.dns.client.Client`
Expand Down Expand Up @@ -250,8 +250,8 @@ def create(self, client=None):
See:
https://cloud.google.com/dns/api/v1/managedZones/create
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
:param client: the client to use. If not passed, falls back to the
:type client: :class:`google.cloud.dns.client.Client`
:param client: (Optional) the client to use. If not passed, falls back to the
``client`` stored on the current zone.
"""
client = self._require_client(client)
Expand All @@ -266,8 +266,8 @@ def exists(self, client=None):
See
https://cloud.google.com/dns/api/v1/managedZones/get
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
:param client: the client to use. If not passed, falls back to the
:type client: :class:`google.cloud.dns.client.Client`
:param client: (Optional) the client to use. If not passed, falls back to the
``client`` stored on the current zone.
:rtype: bool
Expand All @@ -289,8 +289,8 @@ def reload(self, client=None):
See
https://cloud.google.com/dns/api/v1/managedZones/get
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
:param client: the client to use. If not passed, falls back to the
:type client: :class:`google.cloud.dns.client.Client`
:param client: (Optional) the client to use. If not passed, falls back to the
``client`` stored on the current zone.
"""
client = self._require_client(client)
Expand All @@ -305,8 +305,8 @@ def delete(self, client=None):
See:
https://cloud.google.com/dns/api/v1/managedZones/delete
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
:param client: the client to use. If not passed, falls back to the
:type client: :class:`google.cloud.dns.client.Client`
:param client: (Optional) the client to use. If not passed, falls back to the
``client`` stored on the current zone.
"""
client = self._require_client(client)
Expand All @@ -328,8 +328,8 @@ def list_resource_record_sets(self, max_results=None, page_token=None,
not passed, the API will return the first page of
zones.
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
:param client: the client to use. If not passed, falls back to the
:type client: :class:`google.cloud.dns.client.Client`
:param client: (Optional) the client to use. If not passed, falls back to the
``client`` stored on the current zone.
:rtype: :class:`~google.cloud.iterator.Iterator`
Expand Down Expand Up @@ -361,8 +361,8 @@ def list_changes(self, max_results=None, page_token=None, client=None):
not passed, the API will return the first page of
zones.
:type client: :class:`google.cloud.dns.client.Client` or ``NoneType``
:param client: the client to use. If not passed, falls back to the
:type client: :class:`google.cloud.dns.client.Client`
:param client: (Optional) the client to use. If not passed, falls back to the
``client`` stored on the current zone.
:rtype: :class:`~google.cloud.iterator.Iterator`
Expand Down

0 comments on commit 0f64a76

Please sign in to comment.