We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Passing destinationExpirationTime while creating table snapshot
Hi, 

Lib: google-cloud-bigquery==2.32.0

I am trying to create table snapshot but not finding any properties in CopyJob config where i can pass the destintionExpiration time.
I tried passing the expire at destination table but it didn't worked.





--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `google/cloud/bigquery/job/copy_.py`
Content:
```
1 # Copyright 2015 Google LLC
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 """Classes for copy jobs."""
16 
17 from typing import Optional
18 
19 from google.cloud.bigquery.encryption_configuration import EncryptionConfiguration
20 from google.cloud.bigquery import _helpers
21 from google.cloud.bigquery.table import TableReference
22 
23 from google.cloud.bigquery.job.base import _AsyncJob
24 from google.cloud.bigquery.job.base import _JobConfig
25 from google.cloud.bigquery.job.base import _JobReference
26 
27 
28 class OperationType:
29     """Different operation types supported in table copy job.
30 
31     https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#operationtype
32     """
33 
34     OPERATION_TYPE_UNSPECIFIED = "OPERATION_TYPE_UNSPECIFIED"
35     """Unspecified operation type."""
36 
37     COPY = "COPY"
38     """The source and destination table have the same table type."""
39 
40     SNAPSHOT = "SNAPSHOT"
41     """The source table type is TABLE and the destination table type is SNAPSHOT."""
42 
43     CLONE = "CLONE"
44     """The source table type is TABLE and the destination table type is CLONE."""
45 
46     RESTORE = "RESTORE"
47     """The source table type is SNAPSHOT and the destination table type is TABLE."""
48 
49 
50 class CopyJobConfig(_JobConfig):
51     """Configuration options for copy jobs.
52 
53     All properties in this class are optional. Values which are :data:`None` ->
54     server defaults. Set properties on the constructed configuration by using
55     the property name as the name of a keyword argument.
56     """
57 
58     def __init__(self, **kwargs) -> None:
59         super(CopyJobConfig, self).__init__("copy", **kwargs)
60 
61     @property
62     def create_disposition(self):
63         """google.cloud.bigquery.job.CreateDisposition: Specifies behavior
64         for creating tables.
65 
66         See
67         https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationTableCopy.FIELDS.create_disposition
68         """
69         return self._get_sub_prop("createDisposition")
70 
71     @create_disposition.setter
72     def create_disposition(self, value):
73         self._set_sub_prop("createDisposition", value)
74 
75     @property
76     def write_disposition(self):
77         """google.cloud.bigquery.job.WriteDisposition: Action that occurs if
78         the destination table already exists.
79 
80         See
81         https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationTableCopy.FIELDS.write_disposition
82         """
83         return self._get_sub_prop("writeDisposition")
84 
85     @write_disposition.setter
86     def write_disposition(self, value):
87         self._set_sub_prop("writeDisposition", value)
88 
89     @property
90     def destination_encryption_configuration(self):
91         """google.cloud.bigquery.encryption_configuration.EncryptionConfiguration: Custom
92         encryption configuration for the destination table.
93 
94         Custom encryption configuration (e.g., Cloud KMS keys) or :data:`None`
95         if using default encryption.
96 
97         See
98         https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationTableCopy.FIELDS.destination_encryption_configuration
99         """
100         prop = self._get_sub_prop("destinationEncryptionConfiguration")
101         if prop is not None:
102             prop = EncryptionConfiguration.from_api_repr(prop)
103         return prop
104 
105     @destination_encryption_configuration.setter
106     def destination_encryption_configuration(self, value):
107         api_repr = value
108         if value is not None:
109             api_repr = value.to_api_repr()
110         self._set_sub_prop("destinationEncryptionConfiguration", api_repr)
111 
112     @property
113     def operation_type(self) -> str:
114         """The operation to perform with this copy job.
115 
116         See
117         https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationTableCopy.FIELDS.operation_type
118         """
119         return self._get_sub_prop(
120             "operationType", OperationType.OPERATION_TYPE_UNSPECIFIED
121         )
122 
123     @operation_type.setter
124     def operation_type(self, value: Optional[str]):
125         if value is None:
126             value = OperationType.OPERATION_TYPE_UNSPECIFIED
127         self._set_sub_prop("operationType", value)
128 
129 
130 class CopyJob(_AsyncJob):
131     """Asynchronous job: copy data into a table from other tables.
132 
133     Args:
134         job_id (str): the job's ID, within the project belonging to ``client``.
135 
136         sources (List[google.cloud.bigquery.table.TableReference]): Table from which data is to be loaded.
137 
138         destination (google.cloud.bigquery.table.TableReference): Table into which data is to be loaded.
139 
140         client (google.cloud.bigquery.client.Client):
141             A client which holds credentials and project configuration
142             for the dataset (which requires a project).
143 
144         job_config (Optional[google.cloud.bigquery.job.CopyJobConfig]):
145             Extra configuration options for the copy job.
146     """
147 
148     _JOB_TYPE = "copy"
149 
150     def __init__(self, job_id, sources, destination, client, job_config=None):
151         super(CopyJob, self).__init__(job_id, client)
152 
153         if not job_config:
154             job_config = CopyJobConfig()
155 
156         self._configuration = job_config
157         self._properties["configuration"] = job_config._properties
158 
159         if destination:
160             _helpers._set_sub_prop(
161                 self._properties,
162                 ["configuration", "copy", "destinationTable"],
163                 destination.to_api_repr(),
164             )
165 
166         if sources:
167             source_resources = [source.to_api_repr() for source in sources]
168             _helpers._set_sub_prop(
169                 self._properties,
170                 ["configuration", "copy", "sourceTables"],
171                 source_resources,
172             )
173 
174     @property
175     def destination(self):
176         """google.cloud.bigquery.table.TableReference: Table into which data
177         is to be loaded.
178         """
179         return TableReference.from_api_repr(
180             _helpers._get_sub_prop(
181                 self._properties, ["configuration", "copy", "destinationTable"]
182             )
183         )
184 
185     @property
186     def sources(self):
187         """List[google.cloud.bigquery.table.TableReference]): Table(s) from
188         which data is to be loaded.
189         """
190         source_configs = _helpers._get_sub_prop(
191             self._properties, ["configuration", "copy", "sourceTables"]
192         )
193         if source_configs is None:
194             single = _helpers._get_sub_prop(
195                 self._properties, ["configuration", "copy", "sourceTable"]
196             )
197             if single is None:
198                 raise KeyError("Resource missing 'sourceTables' / 'sourceTable'")
199             source_configs = [single]
200 
201         sources = []
202         for source_config in source_configs:
203             table_ref = TableReference.from_api_repr(source_config)
204             sources.append(table_ref)
205         return sources
206 
207     @property
208     def create_disposition(self):
209         """See
210         :attr:`google.cloud.bigquery.job.CopyJobConfig.create_disposition`.
211         """
212         return self._configuration.create_disposition
213 
214     @property
215     def write_disposition(self):
216         """See
217         :attr:`google.cloud.bigquery.job.CopyJobConfig.write_disposition`.
218         """
219         return self._configuration.write_disposition
220 
221     @property
222     def destination_encryption_configuration(self):
223         """google.cloud.bigquery.encryption_configuration.EncryptionConfiguration: Custom
224         encryption configuration for the destination table.
225 
226         Custom encryption configuration (e.g., Cloud KMS keys) or :data:`None`
227         if using default encryption.
228 
229         See
230         :attr:`google.cloud.bigquery.job.CopyJobConfig.destination_encryption_configuration`.
231         """
232         return self._configuration.destination_encryption_configuration
233 
234     def to_api_repr(self):
235         """Generate a resource for :meth:`_begin`."""
236         # Exclude statistics, if set.
237         return {
238             "jobReference": self._properties["jobReference"],
239             "configuration": self._properties["configuration"],
240         }
241 
242     @classmethod
243     def from_api_repr(cls, resource, client):
244         """Factory: construct a job given its API representation
245 
246         .. note::
247 
248            This method assumes that the project found in the resource matches
249            the client's project.
250 
251         Args:
252             resource (Dict): dataset job representation returned from the API
253             client (google.cloud.bigquery.client.Client):
254                 Client which holds credentials and project
255                 configuration for the dataset.
256 
257         Returns:
258             google.cloud.bigquery.job.CopyJob: Job parsed from ``resource``.
259         """
260         cls._check_resource_config(resource)
261         job_ref = _JobReference._from_api_repr(resource["jobReference"])
262         job = cls(job_ref, None, None, client=client)
263         job._set_properties(resource)
264         return job
265
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/google/cloud/bigquery/job/copy_.py b/google/cloud/bigquery/job/copy_.py
--- a/google/cloud/bigquery/job/copy_.py
+++ b/google/cloud/bigquery/job/copy_.py
@@ -126,6 +126,20 @@
             value = OperationType.OPERATION_TYPE_UNSPECIFIED
         self._set_sub_prop("operationType", value)
 
+    @property
+    def destination_expiration_time(self) -> str:
+        """google.cloud.bigquery.job.DestinationExpirationTime: The time when the
+        destination table expires. Expired tables will be deleted and their storage reclaimed.
+
+        See
+        https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationTableCopy.FIELDS.destination_expiration_time
+        """
+        return self._get_sub_prop("destinationExpirationTime")
+
+    @destination_expiration_time.setter
+    def destination_expiration_time(self, value: str):
+        self._set_sub_prop("destinationExpirationTime", value)
+
 
 class CopyJob(_AsyncJob):
     """Asynchronous job: copy data into a table from other tables.

{"golden_diff": "diff --git a/google/cloud/bigquery/job/copy_.py b/google/cloud/bigquery/job/copy_.py\n--- a/google/cloud/bigquery/job/copy_.py\n+++ b/google/cloud/bigquery/job/copy_.py\n@@ -126,6 +126,20 @@\n             value = OperationType.OPERATION_TYPE_UNSPECIFIED\n         self._set_sub_prop(\"operationType\", value)\n \n+    @property\n+    def destination_expiration_time(self) -> str:\n+        \"\"\"google.cloud.bigquery.job.DestinationExpirationTime: The time when the\n+        destination table expires. Expired tables will be deleted and their storage reclaimed.\n+\n+        See\n+        https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationTableCopy.FIELDS.destination_expiration_time\n+        \"\"\"\n+        return self._get_sub_prop(\"destinationExpirationTime\")\n+\n+    @destination_expiration_time.setter\n+    def destination_expiration_time(self, value: str):\n+        self._set_sub_prop(\"destinationExpirationTime\", value)\n+\n \n class CopyJob(_AsyncJob):\n     \"\"\"Asynchronous job: copy data into a table from other tables.\n", "issue": "Passing destinationExpirationTime while creating table snapshot\nHi, \r\n\r\nLib: google-cloud-bigquery==2.32.0\r\n\r\nI am trying to create table snapshot but not finding any properties in CopyJob config where i can pass the destintionExpiration time.\r\nI tried passing the expire at destination table but it didn't worked.\r\n\r\n\r\n\r\n\n", "before_files": [{"content": "# Copyright 2015 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Classes for copy jobs.\"\"\"\n\nfrom typing import Optional\n\nfrom google.cloud.bigquery.encryption_configuration import EncryptionConfiguration\nfrom google.cloud.bigquery import _helpers\nfrom google.cloud.bigquery.table import TableReference\n\nfrom google.cloud.bigquery.job.base import _AsyncJob\nfrom google.cloud.bigquery.job.base import _JobConfig\nfrom google.cloud.bigquery.job.base import _JobReference\n\n\nclass OperationType:\n    \"\"\"Different operation types supported in table copy job.\n\n    https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#operationtype\n    \"\"\"\n\n    OPERATION_TYPE_UNSPECIFIED = \"OPERATION_TYPE_UNSPECIFIED\"\n    \"\"\"Unspecified operation type.\"\"\"\n\n    COPY = \"COPY\"\n    \"\"\"The source and destination table have the same table type.\"\"\"\n\n    SNAPSHOT = \"SNAPSHOT\"\n    \"\"\"The source table type is TABLE and the destination table type is SNAPSHOT.\"\"\"\n\n    CLONE = \"CLONE\"\n    \"\"\"The source table type is TABLE and the destination table type is CLONE.\"\"\"\n\n    RESTORE = \"RESTORE\"\n    \"\"\"The source table type is SNAPSHOT and the destination table type is TABLE.\"\"\"\n\n\nclass CopyJobConfig(_JobConfig):\n    \"\"\"Configuration options for copy jobs.\n\n    All properties in this class are optional. Values which are :data:`None` ->\n    server defaults. Set properties on the constructed configuration by using\n    the property name as the name of a keyword argument.\n    \"\"\"\n\n    def __init__(self, **kwargs) -> None:\n        super(CopyJobConfig, self).__init__(\"copy\", **kwargs)\n\n    @property\n    def create_disposition(self):\n        \"\"\"google.cloud.bigquery.job.CreateDisposition: Specifies behavior\n        for creating tables.\n\n        See\n        https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationTableCopy.FIELDS.create_disposition\n        \"\"\"\n        return self._get_sub_prop(\"createDisposition\")\n\n    @create_disposition.setter\n    def create_disposition(self, value):\n        self._set_sub_prop(\"createDisposition\", value)\n\n    @property\n    def write_disposition(self):\n        \"\"\"google.cloud.bigquery.job.WriteDisposition: Action that occurs if\n        the destination table already exists.\n\n        See\n        https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationTableCopy.FIELDS.write_disposition\n        \"\"\"\n        return self._get_sub_prop(\"writeDisposition\")\n\n    @write_disposition.setter\n    def write_disposition(self, value):\n        self._set_sub_prop(\"writeDisposition\", value)\n\n    @property\n    def destination_encryption_configuration(self):\n        \"\"\"google.cloud.bigquery.encryption_configuration.EncryptionConfiguration: Custom\n        encryption configuration for the destination table.\n\n        Custom encryption configuration (e.g., Cloud KMS keys) or :data:`None`\n        if using default encryption.\n\n        See\n        https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationTableCopy.FIELDS.destination_encryption_configuration\n        \"\"\"\n        prop = self._get_sub_prop(\"destinationEncryptionConfiguration\")\n        if prop is not None:\n            prop = EncryptionConfiguration.from_api_repr(prop)\n        return prop\n\n    @destination_encryption_configuration.setter\n    def destination_encryption_configuration(self, value):\n        api_repr = value\n        if value is not None:\n            api_repr = value.to_api_repr()\n        self._set_sub_prop(\"destinationEncryptionConfiguration\", api_repr)\n\n    @property\n    def operation_type(self) -> str:\n        \"\"\"The operation to perform with this copy job.\n\n        See\n        https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationTableCopy.FIELDS.operation_type\n        \"\"\"\n        return self._get_sub_prop(\n            \"operationType\", OperationType.OPERATION_TYPE_UNSPECIFIED\n        )\n\n    @operation_type.setter\n    def operation_type(self, value: Optional[str]):\n        if value is None:\n            value = OperationType.OPERATION_TYPE_UNSPECIFIED\n        self._set_sub_prop(\"operationType\", value)\n\n\nclass CopyJob(_AsyncJob):\n    \"\"\"Asynchronous job: copy data into a table from other tables.\n\n    Args:\n        job_id (str): the job's ID, within the project belonging to ``client``.\n\n        sources (List[google.cloud.bigquery.table.TableReference]): Table from which data is to be loaded.\n\n        destination (google.cloud.bigquery.table.TableReference): Table into which data is to be loaded.\n\n        client (google.cloud.bigquery.client.Client):\n            A client which holds credentials and project configuration\n            for the dataset (which requires a project).\n\n        job_config (Optional[google.cloud.bigquery.job.CopyJobConfig]):\n            Extra configuration options for the copy job.\n    \"\"\"\n\n    _JOB_TYPE = \"copy\"\n\n    def __init__(self, job_id, sources, destination, client, job_config=None):\n        super(CopyJob, self).__init__(job_id, client)\n\n        if not job_config:\n            job_config = CopyJobConfig()\n\n        self._configuration = job_config\n        self._properties[\"configuration\"] = job_config._properties\n\n        if destination:\n            _helpers._set_sub_prop(\n                self._properties,\n                [\"configuration\", \"copy\", \"destinationTable\"],\n                destination.to_api_repr(),\n            )\n\n        if sources:\n            source_resources = [source.to_api_repr() for source in sources]\n            _helpers._set_sub_prop(\n                self._properties,\n                [\"configuration\", \"copy\", \"sourceTables\"],\n                source_resources,\n            )\n\n    @property\n    def destination(self):\n        \"\"\"google.cloud.bigquery.table.TableReference: Table into which data\n        is to be loaded.\n        \"\"\"\n        return TableReference.from_api_repr(\n            _helpers._get_sub_prop(\n                self._properties, [\"configuration\", \"copy\", \"destinationTable\"]\n            )\n        )\n\n    @property\n    def sources(self):\n        \"\"\"List[google.cloud.bigquery.table.TableReference]): Table(s) from\n        which data is to be loaded.\n        \"\"\"\n        source_configs = _helpers._get_sub_prop(\n            self._properties, [\"configuration\", \"copy\", \"sourceTables\"]\n        )\n        if source_configs is None:\n            single = _helpers._get_sub_prop(\n                self._properties, [\"configuration\", \"copy\", \"sourceTable\"]\n            )\n            if single is None:\n                raise KeyError(\"Resource missing 'sourceTables' / 'sourceTable'\")\n            source_configs = [single]\n\n        sources = []\n        for source_config in source_configs:\n            table_ref = TableReference.from_api_repr(source_config)\n            sources.append(table_ref)\n        return sources\n\n    @property\n    def create_disposition(self):\n        \"\"\"See\n        :attr:`google.cloud.bigquery.job.CopyJobConfig.create_disposition`.\n        \"\"\"\n        return self._configuration.create_disposition\n\n    @property\n    def write_disposition(self):\n        \"\"\"See\n        :attr:`google.cloud.bigquery.job.CopyJobConfig.write_disposition`.\n        \"\"\"\n        return self._configuration.write_disposition\n\n    @property\n    def destination_encryption_configuration(self):\n        \"\"\"google.cloud.bigquery.encryption_configuration.EncryptionConfiguration: Custom\n        encryption configuration for the destination table.\n\n        Custom encryption configuration (e.g., Cloud KMS keys) or :data:`None`\n        if using default encryption.\n\n        See\n        :attr:`google.cloud.bigquery.job.CopyJobConfig.destination_encryption_configuration`.\n        \"\"\"\n        return self._configuration.destination_encryption_configuration\n\n    def to_api_repr(self):\n        \"\"\"Generate a resource for :meth:`_begin`.\"\"\"\n        # Exclude statistics, if set.\n        return {\n            \"jobReference\": self._properties[\"jobReference\"],\n            \"configuration\": self._properties[\"configuration\"],\n        }\n\n    @classmethod\n    def from_api_repr(cls, resource, client):\n        \"\"\"Factory: construct a job given its API representation\n\n        .. note::\n\n           This method assumes that the project found in the resource matches\n           the client's project.\n\n        Args:\n            resource (Dict): dataset job representation returned from the API\n            client (google.cloud.bigquery.client.Client):\n                Client which holds credentials and project\n                configuration for the dataset.\n\n        Returns:\n            google.cloud.bigquery.job.CopyJob: Job parsed from ``resource``.\n        \"\"\"\n        cls._check_resource_config(resource)\n        job_ref = _JobReference._from_api_repr(resource[\"jobReference\"])\n        job = cls(job_ref, None, None, client=client)\n        job._set_properties(resource)\n        return job\n", "path": "google/cloud/bigquery/job/copy_.py"}], "after_files": [{"content": "# Copyright 2015 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Classes for copy jobs.\"\"\"\n\nfrom typing import Optional\n\nfrom google.cloud.bigquery.encryption_configuration import EncryptionConfiguration\nfrom google.cloud.bigquery import _helpers\nfrom google.cloud.bigquery.table import TableReference\n\nfrom google.cloud.bigquery.job.base import _AsyncJob\nfrom google.cloud.bigquery.job.base import _JobConfig\nfrom google.cloud.bigquery.job.base import _JobReference\n\n\nclass OperationType:\n    \"\"\"Different operation types supported in table copy job.\n\n    https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#operationtype\n    \"\"\"\n\n    OPERATION_TYPE_UNSPECIFIED = \"OPERATION_TYPE_UNSPECIFIED\"\n    \"\"\"Unspecified operation type.\"\"\"\n\n    COPY = \"COPY\"\n    \"\"\"The source and destination table have the same table type.\"\"\"\n\n    SNAPSHOT = \"SNAPSHOT\"\n    \"\"\"The source table type is TABLE and the destination table type is SNAPSHOT.\"\"\"\n\n    CLONE = \"CLONE\"\n    \"\"\"The source table type is TABLE and the destination table type is CLONE.\"\"\"\n\n    RESTORE = \"RESTORE\"\n    \"\"\"The source table type is SNAPSHOT and the destination table type is TABLE.\"\"\"\n\n\nclass CopyJobConfig(_JobConfig):\n    \"\"\"Configuration options for copy jobs.\n\n    All properties in this class are optional. Values which are :data:`None` ->\n    server defaults. Set properties on the constructed configuration by using\n    the property name as the name of a keyword argument.\n    \"\"\"\n\n    def __init__(self, **kwargs) -> None:\n        super(CopyJobConfig, self).__init__(\"copy\", **kwargs)\n\n    @property\n    def create_disposition(self):\n        \"\"\"google.cloud.bigquery.job.CreateDisposition: Specifies behavior\n        for creating tables.\n\n        See\n        https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationTableCopy.FIELDS.create_disposition\n        \"\"\"\n        return self._get_sub_prop(\"createDisposition\")\n\n    @create_disposition.setter\n    def create_disposition(self, value):\n        self._set_sub_prop(\"createDisposition\", value)\n\n    @property\n    def write_disposition(self):\n        \"\"\"google.cloud.bigquery.job.WriteDisposition: Action that occurs if\n        the destination table already exists.\n\n        See\n        https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationTableCopy.FIELDS.write_disposition\n        \"\"\"\n        return self._get_sub_prop(\"writeDisposition\")\n\n    @write_disposition.setter\n    def write_disposition(self, value):\n        self._set_sub_prop(\"writeDisposition\", value)\n\n    @property\n    def destination_encryption_configuration(self):\n        \"\"\"google.cloud.bigquery.encryption_configuration.EncryptionConfiguration: Custom\n        encryption configuration for the destination table.\n\n        Custom encryption configuration (e.g., Cloud KMS keys) or :data:`None`\n        if using default encryption.\n\n        See\n        https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationTableCopy.FIELDS.destination_encryption_configuration\n        \"\"\"\n        prop = self._get_sub_prop(\"destinationEncryptionConfiguration\")\n        if prop is not None:\n            prop = EncryptionConfiguration.from_api_repr(prop)\n        return prop\n\n    @destination_encryption_configuration.setter\n    def destination_encryption_configuration(self, value):\n        api_repr = value\n        if value is not None:\n            api_repr = value.to_api_repr()\n        self._set_sub_prop(\"destinationEncryptionConfiguration\", api_repr)\n\n    @property\n    def operation_type(self) -> str:\n        \"\"\"The operation to perform with this copy job.\n\n        See\n        https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationTableCopy.FIELDS.operation_type\n        \"\"\"\n        return self._get_sub_prop(\n            \"operationType\", OperationType.OPERATION_TYPE_UNSPECIFIED\n        )\n\n    @operation_type.setter\n    def operation_type(self, value: Optional[str]):\n        if value is None:\n            value = OperationType.OPERATION_TYPE_UNSPECIFIED\n        self._set_sub_prop(\"operationType\", value)\n\n    @property\n    def destination_expiration_time(self) -> str:\n        \"\"\"google.cloud.bigquery.job.DestinationExpirationTime: The time when the\n        destination table expires. Expired tables will be deleted and their storage reclaimed.\n\n        See\n        https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationTableCopy.FIELDS.destination_expiration_time\n        \"\"\"\n        return self._get_sub_prop(\"destinationExpirationTime\")\n\n    @destination_expiration_time.setter\n    def destination_expiration_time(self, value: str):\n        self._set_sub_prop(\"destinationExpirationTime\", value)\n\n\nclass CopyJob(_AsyncJob):\n    \"\"\"Asynchronous job: copy data into a table from other tables.\n\n    Args:\n        job_id (str): the job's ID, within the project belonging to ``client``.\n\n        sources (List[google.cloud.bigquery.table.TableReference]): Table from which data is to be loaded.\n\n        destination (google.cloud.bigquery.table.TableReference): Table into which data is to be loaded.\n\n        client (google.cloud.bigquery.client.Client):\n            A client which holds credentials and project configuration\n            for the dataset (which requires a project).\n\n        job_config (Optional[google.cloud.bigquery.job.CopyJobConfig]):\n            Extra configuration options for the copy job.\n    \"\"\"\n\n    _JOB_TYPE = \"copy\"\n\n    def __init__(self, job_id, sources, destination, client, job_config=None):\n        super(CopyJob, self).__init__(job_id, client)\n\n        if not job_config:\n            job_config = CopyJobConfig()\n\n        self._configuration = job_config\n        self._properties[\"configuration\"] = job_config._properties\n\n        if destination:\n            _helpers._set_sub_prop(\n                self._properties,\n                [\"configuration\", \"copy\", \"destinationTable\"],\n                destination.to_api_repr(),\n            )\n\n        if sources:\n            source_resources = [source.to_api_repr() for source in sources]\n            _helpers._set_sub_prop(\n                self._properties,\n                [\"configuration\", \"copy\", \"sourceTables\"],\n                source_resources,\n            )\n\n    @property\n    def destination(self):\n        \"\"\"google.cloud.bigquery.table.TableReference: Table into which data\n        is to be loaded.\n        \"\"\"\n        return TableReference.from_api_repr(\n            _helpers._get_sub_prop(\n                self._properties, [\"configuration\", \"copy\", \"destinationTable\"]\n            )\n        )\n\n    @property\n    def sources(self):\n        \"\"\"List[google.cloud.bigquery.table.TableReference]): Table(s) from\n        which data is to be loaded.\n        \"\"\"\n        source_configs = _helpers._get_sub_prop(\n            self._properties, [\"configuration\", \"copy\", \"sourceTables\"]\n        )\n        if source_configs is None:\n            single = _helpers._get_sub_prop(\n                self._properties, [\"configuration\", \"copy\", \"sourceTable\"]\n            )\n            if single is None:\n                raise KeyError(\"Resource missing 'sourceTables' / 'sourceTable'\")\n            source_configs = [single]\n\n        sources = []\n        for source_config in source_configs:\n            table_ref = TableReference.from_api_repr(source_config)\n            sources.append(table_ref)\n        return sources\n\n    @property\n    def create_disposition(self):\n        \"\"\"See\n        :attr:`google.cloud.bigquery.job.CopyJobConfig.create_disposition`.\n        \"\"\"\n        return self._configuration.create_disposition\n\n    @property\n    def write_disposition(self):\n        \"\"\"See\n        :attr:`google.cloud.bigquery.job.CopyJobConfig.write_disposition`.\n        \"\"\"\n        return self._configuration.write_disposition\n\n    @property\n    def destination_encryption_configuration(self):\n        \"\"\"google.cloud.bigquery.encryption_configuration.EncryptionConfiguration: Custom\n        encryption configuration for the destination table.\n\n        Custom encryption configuration (e.g., Cloud KMS keys) or :data:`None`\n        if using default encryption.\n\n        See\n        :attr:`google.cloud.bigquery.job.CopyJobConfig.destination_encryption_configuration`.\n        \"\"\"\n        return self._configuration.destination_encryption_configuration\n\n    def to_api_repr(self):\n        \"\"\"Generate a resource for :meth:`_begin`.\"\"\"\n        # Exclude statistics, if set.\n        return {\n            \"jobReference\": self._properties[\"jobReference\"],\n            \"configuration\": self._properties[\"configuration\"],\n        }\n\n    @classmethod\n    def from_api_repr(cls, resource, client):\n        \"\"\"Factory: construct a job given its API representation\n\n        .. note::\n\n           This method assumes that the project found in the resource matches\n           the client's project.\n\n        Args:\n            resource (Dict): dataset job representation returned from the API\n            client (google.cloud.bigquery.client.Client):\n                Client which holds credentials and project\n                configuration for the dataset.\n\n        Returns:\n            google.cloud.bigquery.job.CopyJob: Job parsed from ``resource``.\n        \"\"\"\n        cls._check_resource_config(resource)\n        job_ref = _JobReference._from_api_repr(resource[\"jobReference\"])\n        job = cls(job_ref, None, None, client=client)\n        job._set_properties(resource)\n        return job\n", "path": "google/cloud/bigquery/job/copy_.py"}]}