Skip to content

Commit

Permalink
Merge pull request #2579 from tswast/str-not-string
Browse files Browse the repository at this point in the history
Replace types string with str.
  • Loading branch information
dhermes authored Oct 21, 2016
2 parents 9a5e79a + c92e40d commit b2d6a2c
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def _build_dataframe(time_series_iterable,
:param time_series_iterable:
An iterable (e.g., a query object) yielding time series.
:type label: string or None
:type label: str or None
:param label:
The label name to use for the dataframe header. This can be the name
of a resource label or metric label (e.g., ``"instance_name"``), or
Expand Down
42 changes: 21 additions & 21 deletions packages/google-cloud-monitoring/google/cloud/monitoring/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
class Client(JSONClient):
"""Client to bundle configuration needed for API requests.
:type project: string
:type project: str
:param project: The target project. If not passed, falls back to the
default inferred from the environment.
Expand Down Expand Up @@ -80,7 +80,7 @@ def query(self,
>>> query = client.query(minutes=5)
>>> print(query.as_dataframe()) # Requires pandas.
:type metric_type: string
:type metric_type: str
:param metric_type: The metric type name. The default value is
:data:`Query.DEFAULT_METRIC_TYPE
<google.cloud.monitoring.query.Query.DEFAULT_METRIC_TYPE>`,
Expand Down Expand Up @@ -158,19 +158,19 @@ def metric_descriptor(self, type_,
... description='Cumulative count of HTTP responses.')
>>> descriptor.create()
:type type_: string
:type type_: str
:param type_:
The metric type including a DNS name prefix. For example:
``"custom.googleapis.com/my_metric"``
:type metric_kind: string
:type metric_kind: str
:param metric_kind:
The kind of measurement. It must be one of
:data:`MetricKind.GAUGE`, :data:`MetricKind.DELTA`,
or :data:`MetricKind.CUMULATIVE`.
See :class:`~google.cloud.monitoring.metric.MetricKind`.
:type value_type: string
:type value_type: str
:param value_type:
The value type of the metric. It must be one of
:data:`ValueType.BOOL`, :data:`ValueType.INT64`,
Expand All @@ -184,13 +184,13 @@ def metric_descriptor(self, type_,
A sequence of zero or more label descriptors specifying the labels
used to identify a specific instance of this metric.
:type unit: string
:type unit: str
:param unit: An optional unit in which the metric value is reported.
:type description: string
:type description: str
:param description: An optional detailed description of the metric.
:type display_name: string
:type display_name: str
:param display_name: An optional concise name for the metric.
:rtype: :class:`MetricDescriptor`
Expand Down Expand Up @@ -221,7 +221,7 @@ def metric(type_, labels):
... 'status': 'successful',
... })
:type type_: string
:type type_: str
:param type_: The metric type name.
:type labels: dict
Expand All @@ -248,7 +248,7 @@ def resource(type_, labels):
https://cloud.google.com/monitoring/api/resources
:type type_: string
:type type_: str
:param type_: The monitored resource type name.
:type labels: dict
Expand Down Expand Up @@ -339,7 +339,7 @@ def fetch_metric_descriptor(self, metric_type):
>>> METRIC = 'compute.googleapis.com/instance/cpu/utilization'
>>> print(client.fetch_metric_descriptor(METRIC))
:type metric_type: string
:type metric_type: str
:param metric_type: The metric type name.
:rtype: :class:`~google.cloud.monitoring.metric.MetricDescriptor`
Expand All @@ -362,12 +362,12 @@ def list_metric_descriptors(self, filter_string=None, type_prefix=None):
... type_prefix='custom.'):
... print(descriptor.type)
:type filter_string: string or None
:type filter_string: str or None
:param filter_string:
An optional filter expression describing the metric descriptors
to be returned. See the `filter documentation`_.
:type type_prefix: string or None
:type type_prefix: str or None
:param type_prefix: An optional prefix constraining the selected
metric types. This adds ``metric.type = starts_with("<prefix>")``
to the filter.
Expand All @@ -389,7 +389,7 @@ def fetch_resource_descriptor(self, resource_type):
>>> print(client.fetch_resource_descriptor('gce_instance'))
:type resource_type: string
:type resource_type: str
:param resource_type: The resource type name.
:rtype: :class:`~google.cloud.monitoring.resource.ResourceDescriptor`
Expand All @@ -408,7 +408,7 @@ def list_resource_descriptors(self, filter_string=None):
>>> for descriptor in client.list_resource_descriptors():
... print(descriptor.type)
:type filter_string: string or None
:type filter_string: str or None
:param filter_string:
An optional filter expression describing the resource descriptors
to be returned. See the `filter documentation`_.
Expand All @@ -430,24 +430,24 @@ def group(self, group_id=None, display_name=None, parent_id=None,
This will not make an HTTP request; it simply instantiates
a group object owned by this client.
:type group_id: string or None
:type group_id: str or None
:param group_id: The ID of the group.
:type display_name: string or None
:type display_name: str or None
:param display_name:
A user-assigned name for this group, used only for display
purposes.
:type parent_id: string or None
:type parent_id: str or None
:param parent_id:
The ID of the group's parent, if it has one.
:type filter_string: string or None
:type filter_string: str or None
:param filter_string:
The filter string used to determine which monitored resources
belong to this group.
:type is_cluster: boolean
:type is_cluster: bool
:param is_cluster:
If true, the members of this group are considered to be a cluster.
The system can perform additional analysis on groups that are
Expand Down Expand Up @@ -478,7 +478,7 @@ def fetch_group(self, group_id):
>>> except google.cloud.exceptions.NotFound:
>>> print('That group does not exist!')
:type group_id: string
:type group_id: str
:param group_id: The ID of the group.
:rtype: :class:`~google.cloud.monitoring.group.Group`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Connection(base_connection.JSONConnection):
:type http: :class:`httplib2.Http` or class that defines ``request()``
:param http: (Optional) HTTP object to make requests.
:type api_base_url: string
:type api_base_url: str
:param api_base_url: The base of the API call URL. Defaults to the value
:attr:`Connection.API_BASE_URL`.
"""
Expand Down
32 changes: 16 additions & 16 deletions packages/google-cloud-monitoring/google/cloud/monitoring/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
def _group_id_from_name(path, project=None):
"""Validate a group URI path and get the group ID.
:type path: string
:type path: str
:param path: URI path for a group API request.
:type project: string or None
:type project: str or None
:param project: The project associated with the request. It is
included for validation purposes.
:rtype: string
:rtype: str
:returns: Group ID parsed from ``path``.
:raises: :class:`ValueError` if the ``path`` is ill-formed or if
the project from the ``path`` does not agree with the
Expand All @@ -57,13 +57,13 @@ def _group_id_from_name(path, project=None):
def _group_name_from_id(project, group_id):
"""Build the group name given the project and group ID.
:type project: string
:type project: str
:param project: The project associated with the group.
:type group_id: string
:type group_id: str
:param group_id: The group ID.
:rtype: string
:rtype: str
:returns: The fully qualified name of the group.
"""
return 'projects/{project}/groups/{group_id}'.format(
Expand All @@ -76,23 +76,23 @@ class Group(object):
:type client: :class:`google.cloud.monitoring.client.Client`
:param client: A client for operating on the metric descriptor.
:type group_id: string or None
:type group_id: str or None
:param group_id: The ID of the group.
:type display_name: string or None
:type display_name: str or None
:param display_name:
A user-assigned name for this group, used only for display purposes.
:type parent_id: string or None
:type parent_id: str or None
:param parent_id:
The ID of the group's parent, if it has one.
:type filter_string: string or None
:type filter_string: str or None
:param filter_string:
The filter string used to determine which monitored resources belong to
this group.
:type is_cluster: boolean
:type is_cluster: bool
:param is_cluster:
If true, the members of this group are considered to be a cluster. The
system can perform additional analysis on groups that are clusters.
Expand Down Expand Up @@ -296,7 +296,7 @@ def list_members(self, filter_string=None, end_time=None, start_time=None):
... print(member)
:type filter_string: string or None
:type filter_string: str or None
:param filter_string:
An optional list filter describing the members to be returned. The
filter may reference the type, labels, and metadata of monitored
Expand Down Expand Up @@ -365,7 +365,7 @@ def _fetch(cls, client, group_id):
:type client: :class:`google.cloud.monitoring.client.Client`
:param client: The client to use.
:type group_id: string
:type group_id: str
:param group_id: The group ID.
:rtype: :class:`Group`
Expand All @@ -386,17 +386,17 @@ def _list(cls, client, children_of_group=None, ancestors_of_group=None,
:type client: :class:`google.cloud.monitoring.client.Client`
:param client: The client to use.
:type children_of_group: string or None
:type children_of_group: str or None
:param children_of_group:
Returns groups whose parent_name field contains the group name. If
no groups have this parent, the results are empty.
:type ancestors_of_group: string or None
:type ancestors_of_group: str or None
:param ancestors_of_group:
Returns groups that are ancestors of the specified group. If the
specified group has no immediate parent, the results are empty.
:type descendants_of_group: string or None
:type descendants_of_group: str or None
:param descendants_of_group:
Returns the descendants of the specified group. This is a superset
of the results returned by the children_of_group filter, and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ class LabelValueType(object):
class LabelDescriptor(object):
"""Schema specification and documentation for a single label.
:type key: string
:type key: str
:param key: The name of the label.
:type value_type: string
:type value_type: str
:param value_type:
The type of the label. It must be one of :data:`LabelValueType.STRING`,
:data:`LabelValueType.BOOL`, or :data:`LabelValueType.INT64`.
See :class:`LabelValueType`.
:type description: string
:type description: str
:param description: A human-readable description for the label.
"""

Expand Down
22 changes: 11 additions & 11 deletions packages/google-cloud-monitoring/google/cloud/monitoring/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ class MetricDescriptor(object):
:type client: :class:`google.cloud.monitoring.client.Client`
:param client: A client for operating on the metric descriptor.
:type type_: string
:type type_: str
:param type_:
The metric type including a DNS name prefix. For example:
``"compute.googleapis.com/instance/cpu/utilization"``
:type metric_kind: string
:type metric_kind: str
:param metric_kind:
The kind of measurement. It must be one of
:data:`MetricKind.GAUGE`, :data:`MetricKind.DELTA`,
or :data:`MetricKind.CUMULATIVE`. See :class:`MetricKind`.
:type value_type: string
:type value_type: str
:param value_type:
The value type of the metric. It must be one of
:data:`ValueType.BOOL`, :data:`ValueType.INT64`,
Expand All @@ -93,16 +93,16 @@ class MetricDescriptor(object):
A sequence of zero or more label descriptors specifying the labels
used to identify a specific instance of this metric.
:type unit: string
:type unit: str
:param unit: An optional unit in which the metric value is reported.
:type description: string
:type description: str
:param description: An optional detailed description of the metric.
:type display_name: string
:type display_name: str
:param display_name: An optional concise name for the metric.
:type name: string or None
:type name: str or None
:param name:
The "resource name" of the metric descriptor. For example:
``"projects/<project_id>/metricDescriptors/<type>"``. As
Expand Down Expand Up @@ -176,7 +176,7 @@ def _fetch(cls, client, metric_type):
:type client: :class:`google.cloud.monitoring.client.Client`
:param client: The client to use.
:type metric_type: string
:type metric_type: str
:param metric_type: The metric type name.
:rtype: :class:`MetricDescriptor`
Expand All @@ -198,12 +198,12 @@ def _list(cls, client, filter_string=None, type_prefix=None):
:type client: :class:`google.cloud.monitoring.client.Client`
:param client: The client to use.
:type filter_string: string or None
:type filter_string: str or None
:param filter_string:
An optional filter expression describing the metric descriptors
to be returned. See the `filter documentation`_.
:type type_prefix: string or None
:type type_prefix: str or None
:param type_prefix: An optional prefix constraining the selected
metric types. This adds ``metric.type = starts_with("<prefix>")``
to the filter.
Expand Down Expand Up @@ -324,7 +324,7 @@ class Metric(collections.namedtuple('Metric', 'type labels')):
:meth:`~google.cloud.monitoring.client.Client.metric` factory method
of the :class:`~google.cloud.monitoring.client.Client` class.
:type type: string
:type type: str
:param type: The metric type name.
:type labels: dict
Expand Down
Loading

0 comments on commit b2d6a2c

Please sign in to comment.