As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.

google.cloud.bigquery.query.ScalarQueryParameterType

class google.cloud.bigquery.query.ScalarQueryParameterType(type_, *, name=None, description=None)[source]

Type representation for scalar query parameters.

Parameters
  • type (str) – One of ‘STRING’, ‘INT64’, ‘FLOAT64’, ‘NUMERIC’, ‘BOOL’, ‘TIMESTAMP’, ‘DATETIME’, or ‘DATE’.

  • name (Optional[str]) – The name of the query parameter. Primarily used if the type is one of the subfields in StructQueryParameterType instance.

  • description (Optional[str]) – The query parameter description. Primarily used if the type is one of the subfields in StructQueryParameterType instance.

__init__(type_, *, name=None, description=None)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(type_, *[, name, description])

Initialize self.

from_api_repr(resource)

Factory: construct parameter type from JSON resource.

to_api_repr()

Construct JSON API representation for the parameter type.

with_name(new_name)

Return a copy of the instance with name set to new_name.

classmethod from_api_repr(resource)[source]

Factory: construct parameter type from JSON resource.

Parameters

resource (Dict) – JSON mapping of parameter

Returns

Instance

Return type

google.cloud.bigquery.query.ScalarQueryParameterType

to_api_repr()[source]

Construct JSON API representation for the parameter type.

Returns

JSON mapping

Return type

Dict

with_name(new_name: Optional[str])[source]

Return a copy of the instance with name set to new_name.

Parameters

name (Union[str, None]) – The new name of the query parameter type. If None, the existing name is cleared.

Returns

A new instance with updated name.

Return type

google.cloud.bigquery.query.ScalarQueryParameterType