# Cloud Firestore API . projects . databases . changeStreams

## Instance Methods

Close httplib2 connections.

Creates a new change stream for the database.

Deletes a change stream.

Gets information about a change stream.

Lists all change streams in a database.

### Method Details

`close()`

    Close httplib2 connections.

`create(parent, body=None, changeStreamId=None, x__xgafv=None)`

    Creates a new change stream for the database.

    Args:
      parent: string, Required. The parent database to create the change stream for. Format is `projects/{project}/databases/{database}`. (required)
      body: object, The request body.
        The object takes the form of:

    { # A Change Stream is a resource that allows users to receive change notifications from a Firestore database.
      "collectionGroupScope": { # The change stream is scoped to a collection group. Only events associated with the given collection group are visible to the Change Stream. Only a single change stream can be enabled per collection group. # If set, the change stream is scoped to a collection group.
        "collectionGroupId": "A String", # Required. The collection group name.
      },
      "createTime": "A String", # Output only. The time the Change Stream was created.
      "databaseScope": { # The change stream is scoped to the entire database. All events in the database are visible to the Change Stream. One Database scope Change Stream is allowed per database. # If set, the change stream is scoped to the entire database.
      },
      "etag": "A String", # Optional. An etag used to determine which version of the configuration is being edited.
      "name": "A String", # Identifier. The external resource name of the change stream. Format `projects/{project}/databases/{database}/changeStreams/{change_stream}`
      "retentionPeriod": "A String", # Required. The retention period of the change stream. This is the amount of time a change event is available on the change stream. Must be from 1 to 7 days, inclusive. The retention_period must be in day granularity, i.e. it must be a multiple of 24 hours.
      "startTime": "A String", # Output only. The time the Change Stream started recording events.
      "updateTime": "A String", # Output only. The time the Change Stream was last updated.
    }

      changeStreamId: string, Required. The ID to use for the change stream, which will become the final component of the change stream's resource name. This value should be 4-63 characters. Valid characters are lowercase letters, numbers, and hyphens. The first character must be a letter, and the last character must be a letter or a number.
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # A Change Stream is a resource that allows users to receive change notifications from a Firestore database.
      "collectionGroupScope": { # The change stream is scoped to a collection group. Only events associated with the given collection group are visible to the Change Stream. Only a single change stream can be enabled per collection group. # If set, the change stream is scoped to a collection group.
        "collectionGroupId": "A String", # Required. The collection group name.
      },
      "createTime": "A String", # Output only. The time the Change Stream was created.
      "databaseScope": { # The change stream is scoped to the entire database. All events in the database are visible to the Change Stream. One Database scope Change Stream is allowed per database. # If set, the change stream is scoped to the entire database.
      },
      "etag": "A String", # Optional. An etag used to determine which version of the configuration is being edited.
      "name": "A String", # Identifier. The external resource name of the change stream. Format `projects/{project}/databases/{database}/changeStreams/{change_stream}`
      "retentionPeriod": "A String", # Required. The retention period of the change stream. This is the amount of time a change event is available on the change stream. Must be from 1 to 7 days, inclusive. The retention_period must be in day granularity, i.e. it must be a multiple of 24 hours.
      "startTime": "A String", # Output only. The time the Change Stream started recording events.
      "updateTime": "A String", # Output only. The time the Change Stream was last updated.
    }

`delete(name, etag=None, x__xgafv=None)`

    Deletes a change stream.

    Args:
      name: string, Required. The name of the change stream to delete. Format is `projects/{project}/databases/{database}/changeStreams/{change_stream}`. (required)
      etag: string, Optional. The etag of the change stream to delete. If this is not the current etag of the change stream, the deletion will fail.
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
    }

`get(name, x__xgafv=None)`

    Gets information about a change stream.

    Args:
      name: string, Required. The name of the change stream to retrieve. Format is `projects/{project}/databases/{database}/changeStreams/{change_stream}`. (required)
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # A Change Stream is a resource that allows users to receive change notifications from a Firestore database.
      "collectionGroupScope": { # The change stream is scoped to a collection group. Only events associated with the given collection group are visible to the Change Stream. Only a single change stream can be enabled per collection group. # If set, the change stream is scoped to a collection group.
        "collectionGroupId": "A String", # Required. The collection group name.
      },
      "createTime": "A String", # Output only. The time the Change Stream was created.
      "databaseScope": { # The change stream is scoped to the entire database. All events in the database are visible to the Change Stream. One Database scope Change Stream is allowed per database. # If set, the change stream is scoped to the entire database.
      },
      "etag": "A String", # Optional. An etag used to determine which version of the configuration is being edited.
      "name": "A String", # Identifier. The external resource name of the change stream. Format `projects/{project}/databases/{database}/changeStreams/{change_stream}`
      "retentionPeriod": "A String", # Required. The retention period of the change stream. This is the amount of time a change event is available on the change stream. Must be from 1 to 7 days, inclusive. The retention_period must be in day granularity, i.e. it must be a multiple of 24 hours.
      "startTime": "A String", # Output only. The time the Change Stream started recording events.
      "updateTime": "A String", # Output only. The time the Change Stream was last updated.
    }

`list(parent, x__xgafv=None)`

    Lists all change streams in a database.

    Args:
      parent: string, Required. The parent database to list change streams from. Format is `projects/{project}/databases/{database}`. (required)
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # Response to FirestoreAdmin.ListChangeStreams.
      "changeStreams": [ # The list of change streams.
        { # A Change Stream is a resource that allows users to receive change notifications from a Firestore database.
          "collectionGroupScope": { # The change stream is scoped to a collection group. Only events associated with the given collection group are visible to the Change Stream. Only a single change stream can be enabled per collection group. # If set, the change stream is scoped to a collection group.
            "collectionGroupId": "A String", # Required. The collection group name.
          },
          "createTime": "A String", # Output only. The time the Change Stream was created.
          "databaseScope": { # The change stream is scoped to the entire database. All events in the database are visible to the Change Stream. One Database scope Change Stream is allowed per database. # If set, the change stream is scoped to the entire database.
          },
          "etag": "A String", # Optional. An etag used to determine which version of the configuration is being edited.
          "name": "A String", # Identifier. The external resource name of the change stream. Format `projects/{project}/databases/{database}/changeStreams/{change_stream}`
          "retentionPeriod": "A String", # Required. The retention period of the change stream. This is the amount of time a change event is available on the change stream. Must be from 1 to 7 days, inclusive. The retention_period must be in day granularity, i.e. it must be a multiple of 24 hours.
          "startTime": "A String", # Output only. The time the Change Stream started recording events.
          "updateTime": "A String", # Output only. The time the Change Stream was last updated.
        },
      ],
    }