# Change Sets

0.37.0 (latest) 0.36.1 0.35.1 0.34.2 0.33.1 0.32.3 0.31.0 0.30.2 Define API ResourceRecordSets.

### *class* google.cloud.dns.changes.Changes(zone)

Bases: [`object`](https://docs.python.org/3/library/functions.html#object)

Changes are bundled additions / deletions of DNS resource records.

Changes are owned by a [`google.cloud.dns.zone.ManagedZone`](https://docs.cloud.google.com/python/docs/reference/dns/latest/zone#google.cloud.dns.zone.ManagedZone) instance.

See
<https://cloud.google.com/dns/api/v1/changes>

- **Parameters**

  **zone** ([`google.cloud.dns.zone.ManagedZone`](https://docs.cloud.google.com/python/docs/reference/dns/latest/zone#google.cloud.dns.zone.ManagedZone)) -- A zone which holds one or more record sets.

#### add_record_set(record_set)

Append a record set to the 'additions' for the change set.

- **Parameters**

  **record_set** ([`google.cloud.dns.resource_record_set.ResourceRecordSet`](https://docs.cloud.google.com/python/docs/reference/dns/latest/resource-record-set#google.cloud.dns.resource_record_set.ResourceRecordSet)) -- the record set to append.
- **Raises**

  `ValueError` if `record_set` is not of the required type.

#### *property* additions()

Resource record sets to be added to the zone.

- **Return type**

  sequence of
  [`google.cloud.dns.resource_record_set.ResourceRecordSet`](https://docs.cloud.google.com/python/docs/reference/dns/latest/resource-record-set#google.cloud.dns.resource_record_set.ResourceRecordSet).
- **Returns**

  record sets appended via `add_record_set()`.

#### create(client=None)

API call: create the change set via a POST request.

See
<https://cloud.google.com/dns/api/v1/changes/create>

- **Parameters**

  **client** ([`google.cloud.dns.client.Client`](https://docs.cloud.google.com/python/docs/reference/dns/latest/client#google.cloud.dns.client.Client)) -- (Optional) the client to use. If not passed, falls back to the
  `client` stored on the current zone.

#### delete_record_set(record_set)

Append a record set to the 'deletions' for the change set.

- **Parameters**

  **record_set** ([`google.cloud.dns.resource_record_set.ResourceRecordSet`](https://docs.cloud.google.com/python/docs/reference/dns/latest/resource-record-set#google.cloud.dns.resource_record_set.ResourceRecordSet)) -- the record set to append.
- **Raises**

  `ValueError` if `record_set` is not of the required type.

#### *property* deletions()

Resource record sets to be deleted from the zone.

- **Return type**

  sequence of
  [`google.cloud.dns.resource_record_set.ResourceRecordSet`](https://docs.cloud.google.com/python/docs/reference/dns/latest/resource-record-set#google.cloud.dns.resource_record_set.ResourceRecordSet).
- **Returns**

  record sets appended via `delete_record_set()`.

#### exists(client=None)

API call: test for the existence of the change set via a GET request.

See
<https://cloud.google.com/dns/api/v1/changes/get>

- **Parameters**

  **client** ([`google.cloud.dns.client.Client`](https://docs.cloud.google.com/python/docs/reference/dns/latest/client#google.cloud.dns.client.Client)) -- (Optional) the client to use. If not passed, falls back to the
  `client` stored on the current zone.
- **Return type**

  [bool](https://docs.python.org/3/library/functions.html#bool)
- **Returns**

  Boolean indicating existence of the changes.

#### *classmethod* from_api_repr(resource, zone)

Factory: construct a change set given its API representation

- **Parameters**

  - **resource** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict)) -- change set representation returned from the API.

  - **zone** ([`google.cloud.dns.zone.ManagedZone`](https://docs.cloud.google.com/python/docs/reference/dns/latest/zone#google.cloud.dns.zone.ManagedZone)) -- A zone which holds zero or more change sets.

- **Return type**

  `google.cloud.dns.changes.Changes`
- **Returns**

  RRS parsed from `resource`.

#### *property* name()

Name of the change set.

- **Return type**

  str or `NoneType`
- **Returns**

  Name, as set by the back-end, or None.

#### *property* path()

URL path for change set APIs.

- **Return type**

  [str](https://docs.python.org/3/library/stdtypes.html#str)
- **Returns**

  the path based on project, zone, and change set names.

#### reload(client=None)

API call: refresh zone properties via a GET request.

See
<https://cloud.google.com/dns/api/v1/changes/get>

- **Parameters**

  **client** ([`google.cloud.dns.client.Client`](https://docs.cloud.google.com/python/docs/reference/dns/latest/client#google.cloud.dns.client.Client)) -- (Optional) the client to use. If not passed, falls back to the
  `client` stored on the current zone.

#### *property* started()

Time when the change set was started.

- **Return type**

  `datetime.datetime` or `NoneType`
- **Returns**

  Time, as set by the back-end, or None.

#### *property* status()

Status of the change set.

- **Return type**

  str or `NoneType`
- **Returns**

  Status, as set by the back-end, or None.