kaggle 1.7.3b1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. kaggle/LICENSE +201 -0
  2. kaggle/__init__.py +6 -0
  3. kaggle/api/__init__.py +0 -0
  4. kaggle/api/kaggle_api.py +614 -0
  5. kaggle/api/kaggle_api_extended.py +4657 -0
  6. kaggle/cli.py +1606 -0
  7. kaggle/configuration.py +206 -0
  8. kaggle/models/__init__.py +0 -0
  9. kaggle/models/api_blob_type.py +4 -0
  10. kaggle/models/dataset_column.py +228 -0
  11. kaggle/models/dataset_new_request.py +385 -0
  12. kaggle/models/dataset_new_version_request.py +287 -0
  13. kaggle/models/dataset_update_settings_request.py +310 -0
  14. kaggle/models/kaggle_models_extended.py +276 -0
  15. kaggle/models/kernel_push_request.py +556 -0
  16. kaggle/models/model_instance_new_version_request.py +145 -0
  17. kaggle/models/model_instance_update_request.py +351 -0
  18. kaggle/models/model_new_instance_request.py +417 -0
  19. kaggle/models/model_new_request.py +314 -0
  20. kaggle/models/model_update_request.py +282 -0
  21. kaggle/models/start_blob_upload_request.py +232 -0
  22. kaggle/models/start_blob_upload_response.py +137 -0
  23. kaggle/models/upload_file.py +169 -0
  24. kaggle/test/__init__.py +0 -0
  25. kaggle/test/test_authenticate.py +43 -0
  26. kaggle-1.7.3b1.dist-info/METADATA +348 -0
  27. kaggle-1.7.3b1.dist-info/RECORD +89 -0
  28. kaggle-1.7.3b1.dist-info/WHEEL +4 -0
  29. kaggle-1.7.3b1.dist-info/entry_points.txt +2 -0
  30. kaggle-1.7.3b1.dist-info/licenses/LICENSE.txt +201 -0
  31. kagglesdk/LICENSE +201 -0
  32. kagglesdk/__init__.py +2 -0
  33. kagglesdk/admin/__init__.py +0 -0
  34. kagglesdk/admin/services/__init__.py +0 -0
  35. kagglesdk/admin/services/inbox_file_service.py +22 -0
  36. kagglesdk/admin/types/__init__.py +0 -0
  37. kagglesdk/admin/types/inbox_file_service.py +74 -0
  38. kagglesdk/blobs/__init__.py +0 -0
  39. kagglesdk/blobs/services/__init__.py +0 -0
  40. kagglesdk/blobs/services/blob_api_service.py +25 -0
  41. kagglesdk/blobs/types/__init__.py +0 -0
  42. kagglesdk/blobs/types/blob_api_service.py +177 -0
  43. kagglesdk/common/__init__.py +0 -0
  44. kagglesdk/common/types/__init__.py +0 -0
  45. kagglesdk/common/types/file_download.py +102 -0
  46. kagglesdk/common/types/http_redirect.py +105 -0
  47. kagglesdk/competitions/__init__.py +0 -0
  48. kagglesdk/competitions/services/__init__.py +0 -0
  49. kagglesdk/competitions/services/competition_api_service.py +129 -0
  50. kagglesdk/competitions/types/__init__.py +0 -0
  51. kagglesdk/competitions/types/competition_api_service.py +1874 -0
  52. kagglesdk/competitions/types/competition_enums.py +53 -0
  53. kagglesdk/competitions/types/submission_status.py +9 -0
  54. kagglesdk/datasets/__init__.py +0 -0
  55. kagglesdk/datasets/services/__init__.py +0 -0
  56. kagglesdk/datasets/services/dataset_api_service.py +170 -0
  57. kagglesdk/datasets/types/__init__.py +0 -0
  58. kagglesdk/datasets/types/dataset_api_service.py +2777 -0
  59. kagglesdk/datasets/types/dataset_enums.py +82 -0
  60. kagglesdk/datasets/types/dataset_types.py +646 -0
  61. kagglesdk/education/__init__.py +0 -0
  62. kagglesdk/education/services/__init__.py +0 -0
  63. kagglesdk/education/services/education_api_service.py +19 -0
  64. kagglesdk/education/types/__init__.py +0 -0
  65. kagglesdk/education/types/education_api_service.py +248 -0
  66. kagglesdk/education/types/education_service.py +139 -0
  67. kagglesdk/kaggle_client.py +66 -0
  68. kagglesdk/kaggle_env.py +42 -0
  69. kagglesdk/kaggle_http_client.py +316 -0
  70. kagglesdk/kaggle_object.py +293 -0
  71. kagglesdk/kernels/__init__.py +0 -0
  72. kagglesdk/kernels/services/__init__.py +0 -0
  73. kagglesdk/kernels/services/kernels_api_service.py +109 -0
  74. kagglesdk/kernels/types/__init__.py +0 -0
  75. kagglesdk/kernels/types/kernels_api_service.py +1951 -0
  76. kagglesdk/kernels/types/kernels_enums.py +33 -0
  77. kagglesdk/models/__init__.py +0 -0
  78. kagglesdk/models/services/__init__.py +0 -0
  79. kagglesdk/models/services/model_api_service.py +255 -0
  80. kagglesdk/models/services/model_service.py +19 -0
  81. kagglesdk/models/types/__init__.py +0 -0
  82. kagglesdk/models/types/model_api_service.py +3719 -0
  83. kagglesdk/models/types/model_enums.py +60 -0
  84. kagglesdk/models/types/model_service.py +275 -0
  85. kagglesdk/models/types/model_types.py +286 -0
  86. kagglesdk/test/test_client.py +45 -0
  87. kagglesdk/users/__init__.py +0 -0
  88. kagglesdk/users/types/__init__.py +0 -0
  89. kagglesdk/users/types/users_enums.py +22 -0
@@ -0,0 +1,556 @@
1
+ #!/usr/bin/python
2
+ #
3
+ # Copyright 2024 Kaggle Inc
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # coding: utf-8
18
+
19
+
20
+ import pprint
21
+ import re # noqa: F401
22
+
23
+ import six
24
+
25
+
26
+ class KernelPushRequest(object):
27
+ """
28
+ Attributes:
29
+ project_types (dict): The key is attribute name
30
+ and the value is attribute type.
31
+ attribute_map (dict): The key is attribute name
32
+ and the value is json key in definition.
33
+ """
34
+ project_types = {
35
+ 'id': 'int',
36
+ 'slug': 'str',
37
+ 'new_title': 'str',
38
+ 'text': 'str',
39
+ 'language': 'str',
40
+ 'kernel_type': 'str',
41
+ 'is_private': 'bool',
42
+ 'enable_gpu': 'bool',
43
+ 'enable_tpu': 'bool',
44
+ 'enable_internet': 'bool',
45
+ 'dataset_data_sources': 'list[str]',
46
+ 'competition_data_sources': 'list[str]',
47
+ 'kernel_data_sources': 'list[str]',
48
+ 'model_data_sources': 'list[str]',
49
+ 'category_ids': 'list[str]',
50
+ 'docker_image_pinning_type': 'str'
51
+ }
52
+
53
+ attribute_map = {
54
+ 'id': 'id',
55
+ 'slug': 'slug',
56
+ 'new_title': 'newTitle',
57
+ 'text': 'text',
58
+ 'language': 'language',
59
+ 'kernel_type': 'kernelType',
60
+ 'is_private': 'isPrivate',
61
+ 'enable_gpu': 'enableGpu',
62
+ 'enable_tpu': 'enableTpu',
63
+ 'enable_internet': 'enableInternet',
64
+ 'dataset_data_sources': 'datasetDataSources',
65
+ 'competition_data_sources': 'competitionDataSources',
66
+ 'kernel_data_sources': 'kernelDataSources',
67
+ 'model_data_sources': 'modelDataSources',
68
+ 'category_ids': 'categoryIds',
69
+ 'docker_image_pinning_type': 'dockerImagePinningType'
70
+ }
71
+
72
+ def __init__(self, id=None, slug=None, new_title=None, text=None, language=None, kernel_type=None, is_private=None, enable_gpu=None, enable_tpu=None, enable_internet=None, dataset_data_sources=None, competition_data_sources=None, kernel_data_sources=None, model_data_sources=None, category_ids=None, docker_image_pinning_type=None): # noqa: E501
73
+
74
+ self._id = None
75
+ self._slug = None
76
+ self._new_title = None
77
+ self._text = None
78
+ self._language = None
79
+ self._kernel_type = None
80
+ self._is_private = None
81
+ self._enable_gpu = None
82
+ self._enable_tpu = None
83
+ self._enable_internet = None
84
+ self._dataset_data_sources = None
85
+ self._competition_data_sources = None
86
+ self._kernel_data_sources = None
87
+ self._model_data_sources = None
88
+ self._category_ids = None
89
+ self._docker_image_pinning_type = None
90
+ self.discriminator = None
91
+
92
+ if id is not None:
93
+ self.id = id
94
+ if slug is not None:
95
+ self.slug = slug
96
+ if new_title is not None:
97
+ self.new_title = new_title
98
+ self.text = text
99
+ self.language = language
100
+ self.kernel_type = kernel_type
101
+ if is_private is not None:
102
+ self.is_private = is_private
103
+ if enable_gpu is not None:
104
+ self.enable_gpu = enable_gpu
105
+ if enable_tpu is not None:
106
+ self.enable_tpu = enable_tpu
107
+ if enable_internet is not None:
108
+ self.enable_internet = enable_internet
109
+ if dataset_data_sources is not None:
110
+ self.dataset_data_sources = dataset_data_sources
111
+ if competition_data_sources is not None:
112
+ self.competition_data_sources = competition_data_sources
113
+ if kernel_data_sources is not None:
114
+ self.kernel_data_sources = kernel_data_sources
115
+ if model_data_sources is not None:
116
+ self.model_data_sources = model_data_sources
117
+ if category_ids is not None:
118
+ self.category_ids = category_ids
119
+ if docker_image_pinning_type is not None:
120
+ self.docker_image_pinning_type = docker_image_pinning_type
121
+
122
+ @property
123
+ def id(self):
124
+ """Gets the id of this KernelPushRequest. # noqa: E501
125
+
126
+ The kernel's ID number. One of `id` and `slug` are required. If both are specified, `id` will be preferred # noqa: E501
127
+
128
+ :return: The id of this KernelPushRequest. # noqa: E501
129
+ :rtype: int
130
+ """
131
+ return self._id
132
+
133
+ @id.setter
134
+ def id(self, id):
135
+ """Sets the id of this KernelPushRequest.
136
+
137
+ The kernel's ID number. One of `id` and `slug` are required. If both are specified, `id` will be preferred # noqa: E501
138
+
139
+ :param id: The id of this KernelPushRequest. # noqa: E501
140
+ :type: int
141
+ """
142
+
143
+ self._id = id
144
+
145
+ @property
146
+ def slug(self):
147
+ """Gets the slug of this KernelPushRequest. # noqa: E501
148
+
149
+ The full slug of the kernel to push to, in the format `USERNAME/KERNEL-SLUG`. The kernel slug must be the title lowercased with dashes (`-`) replacing spaces. One of `id` and `slug` are required. If both are specified, `id` will be preferred # noqa: E501
150
+
151
+ :return: The slug of this KernelPushRequest. # noqa: E501
152
+ :rtype: str
153
+ """
154
+ return self._slug
155
+
156
+ @slug.setter
157
+ def slug(self, slug):
158
+ """Sets the slug of this KernelPushRequest.
159
+
160
+ The full slug of the kernel to push to, in the format `USERNAME/KERNEL-SLUG`. The kernel slug must be the title lowercased with dashes (`-`) replacing spaces. One of `id` and `slug` are required. If both are specified, `id` will be preferred # noqa: E501
161
+
162
+ :param slug: The slug of this KernelPushRequest. # noqa: E501
163
+ :type: str
164
+ """
165
+
166
+ self._slug = slug
167
+
168
+ @property
169
+ def new_title(self):
170
+ """Gets the new_title of this KernelPushRequest. # noqa: E501
171
+
172
+ The title to be set on the kernel # noqa: E501
173
+
174
+ :return: The new_title of this KernelPushRequest. # noqa: E501
175
+ :rtype: str
176
+ """
177
+ return self._new_title
178
+
179
+ @new_title.setter
180
+ def new_title(self, new_title):
181
+ """Sets the new_title of this KernelPushRequest.
182
+
183
+ The title to be set on the kernel # noqa: E501
184
+
185
+ :param new_title: The new_title of this KernelPushRequest. # noqa: E501
186
+ :type: str
187
+ """
188
+
189
+ self._new_title = new_title
190
+
191
+ @property
192
+ def text(self):
193
+ """Gets the text of this KernelPushRequest. # noqa: E501
194
+
195
+ The kernel's source code # noqa: E501
196
+
197
+ :return: The text of this KernelPushRequest. # noqa: E501
198
+ :rtype: str
199
+ """
200
+ return self._text
201
+
202
+ @text.setter
203
+ def text(self, text):
204
+ """Sets the text of this KernelPushRequest.
205
+
206
+ The kernel's source code # noqa: E501
207
+
208
+ :param text: The text of this KernelPushRequest. # noqa: E501
209
+ :type: str
210
+ """
211
+ if text is None:
212
+ raise ValueError("Invalid value for `text`, must not be `None`") # noqa: E501
213
+
214
+ self._text = text
215
+
216
+ @property
217
+ def language(self):
218
+ """Gets the language of this KernelPushRequest. # noqa: E501
219
+
220
+ The language that the kernel is written in # noqa: E501
221
+
222
+ :return: The language of this KernelPushRequest. # noqa: E501
223
+ :rtype: str
224
+ """
225
+ return self._language
226
+
227
+ @language.setter
228
+ def language(self, language):
229
+ """Sets the language of this KernelPushRequest.
230
+
231
+ The language that the kernel is written in # noqa: E501
232
+
233
+ :param language: The language of this KernelPushRequest. # noqa: E501
234
+ :type: str
235
+ """
236
+ if language is None:
237
+ raise ValueError("Invalid value for `language`, must not be `None`") # noqa: E501
238
+ allowed_values = ["python", "r", "rmarkdown"] # noqa: E501
239
+ if language not in allowed_values:
240
+ raise ValueError(
241
+ "Invalid value for `language` ({0}), must be one of {1}" # noqa: E501
242
+ .format(language, allowed_values)
243
+ )
244
+
245
+ self._language = language
246
+
247
+ @property
248
+ def kernel_type(self):
249
+ """Gets the kernel_type of this KernelPushRequest. # noqa: E501
250
+
251
+ The type of kernel. Cannot be changed once the kernel has been created # noqa: E501
252
+
253
+ :return: The kernel_type of this KernelPushRequest. # noqa: E501
254
+ :rtype: str
255
+ """
256
+ return self._kernel_type
257
+
258
+ @kernel_type.setter
259
+ def kernel_type(self, kernel_type):
260
+ """Sets the kernel_type of this KernelPushRequest.
261
+
262
+ The type of kernel. Cannot be changed once the kernel has been created # noqa: E501
263
+
264
+ :param kernel_type: The kernel_type of this KernelPushRequest. # noqa: E501
265
+ :type: str
266
+ """
267
+ if kernel_type is None:
268
+ raise ValueError("Invalid value for `kernel_type`, must not be `None`") # noqa: E501
269
+ allowed_values = ["script", "notebook"] # noqa: E501
270
+ if kernel_type not in allowed_values:
271
+ raise ValueError(
272
+ "Invalid value for `kernel_type` ({0}), must be one of {1}" # noqa: E501
273
+ .format(kernel_type, allowed_values)
274
+ )
275
+
276
+ self._kernel_type = kernel_type
277
+
278
+ @property
279
+ def is_private(self):
280
+ """Gets the is_private of this KernelPushRequest. # noqa: E501
281
+
282
+ Whether or not the kernel should be private # noqa: E501
283
+
284
+ :return: The is_private of this KernelPushRequest. # noqa: E501
285
+ :rtype: bool
286
+ """
287
+ return self._is_private
288
+
289
+ @is_private.setter
290
+ def is_private(self, is_private):
291
+ """Sets the is_private of this KernelPushRequest.
292
+
293
+ Whether or not the kernel should be private # noqa: E501
294
+
295
+ :param is_private: The is_private of this KernelPushRequest. # noqa: E501
296
+ :type: bool
297
+ """
298
+
299
+ self._is_private = is_private
300
+
301
+ @property
302
+ def enable_gpu(self):
303
+ """Gets the enable_gpu of this KernelPushRequest. # noqa: E501
304
+
305
+ Whether or not the kernel should run on a GPU # noqa: E501
306
+
307
+ :return: The enable_gpu of this KernelPushRequest. # noqa: E501
308
+ :rtype: bool
309
+ """
310
+ return self._enable_gpu
311
+
312
+ @enable_gpu.setter
313
+ def enable_gpu(self, enable_gpu):
314
+ """Sets the enable_gpu of this KernelPushRequest.
315
+
316
+ Whether or not the kernel should run on a GPU # noqa: E501
317
+
318
+ :param enable_gpu: The enable_gpu of this KernelPushRequest. # noqa: E501
319
+ :type: bool
320
+ """
321
+
322
+ self._enable_gpu = enable_gpu
323
+
324
+ @property
325
+ def enable_tpu(self):
326
+ """Gets the enable_tpu of this KernelPushRequest. # noqa: E501
327
+
328
+ Whether or not the kernel should run on a TPU # noqa: E501
329
+
330
+ :return: The enable_tpu of this KernelPushRequest. # noqa: E501
331
+ :rtype: bool
332
+ """
333
+ return self._enable_tpu
334
+
335
+ @enable_tpu.setter
336
+ def enable_tpu(self, enable_tpu):
337
+ """Sets the enable_tpu of this KernelPushRequest.
338
+
339
+ Whether or not the kernel should run on a TPU # noqa: E501
340
+
341
+ :param enable_tpu: The enable_tpu of this KernelPushRequest. # noqa: E501
342
+ :type: bool
343
+ """
344
+
345
+ self._enable_tpu = enable_tpu
346
+
347
+ @property
348
+ def enable_internet(self):
349
+ """Gets the enable_internet of this KernelPushRequest. # noqa: E501
350
+
351
+ Whether or not the kernel should be able to access the internet # noqa: E501
352
+
353
+ :return: The enable_internet of this KernelPushRequest. # noqa: E501
354
+ :rtype: bool
355
+ """
356
+ return self._enable_internet
357
+
358
+ @enable_internet.setter
359
+ def enable_internet(self, enable_internet):
360
+ """Sets the enable_internet of this KernelPushRequest.
361
+
362
+ Whether or not the kernel should be able to access the internet # noqa: E501
363
+
364
+ :param enable_internet: The enable_internet of this KernelPushRequest. # noqa: E501
365
+ :type: bool
366
+ """
367
+
368
+ self._enable_internet = enable_internet
369
+
370
+ @property
371
+ def dataset_data_sources(self):
372
+ """Gets the dataset_data_sources of this KernelPushRequest. # noqa: E501
373
+
374
+ A list of dataset data sources that the kernel should use. Each dataset is specified as `USERNAME/DATASET-SLUG` # noqa: E501
375
+
376
+ :return: The dataset_data_sources of this KernelPushRequest. # noqa: E501
377
+ :rtype: list[str]
378
+ """
379
+ return self._dataset_data_sources
380
+
381
+ @dataset_data_sources.setter
382
+ def dataset_data_sources(self, dataset_data_sources):
383
+ """Sets the dataset_data_sources of this KernelPushRequest.
384
+
385
+ A list of dataset data sources that the kernel should use. Each dataset is specified as `USERNAME/DATASET-SLUG` # noqa: E501
386
+
387
+ :param dataset_data_sources: The dataset_data_sources of this KernelPushRequest. # noqa: E501
388
+ :type: list[str]
389
+ """
390
+
391
+ self._dataset_data_sources = dataset_data_sources
392
+
393
+ @property
394
+ def competition_data_sources(self):
395
+ """Gets the competition_data_sources of this KernelPushRequest. # noqa: E501
396
+
397
+ A list of competition data sources that the kernel should use # noqa: E501
398
+
399
+ :return: The competition_data_sources of this KernelPushRequest. # noqa: E501
400
+ :rtype: list[str]
401
+ """
402
+ return self._competition_data_sources
403
+
404
+ @competition_data_sources.setter
405
+ def competition_data_sources(self, competition_data_sources):
406
+ """Sets the competition_data_sources of this KernelPushRequest.
407
+
408
+ A list of competition data sources that the kernel should use # noqa: E501
409
+
410
+ :param competition_data_sources: The competition_data_sources of this KernelPushRequest. # noqa: E501
411
+ :type: list[str]
412
+ """
413
+
414
+ self._competition_data_sources = competition_data_sources
415
+
416
+ @property
417
+ def kernel_data_sources(self):
418
+ """Gets the kernel_data_sources of this KernelPushRequest. # noqa: E501
419
+
420
+ A list of kernel data sources that the kernel should use. Each dataset is specified as `USERNAME/KERNEL-SLUG` # noqa: E501
421
+
422
+ :return: The kernel_data_sources of this KernelPushRequest. # noqa: E501
423
+ :rtype: list[str]
424
+ """
425
+ return self._kernel_data_sources
426
+
427
+ @kernel_data_sources.setter
428
+ def kernel_data_sources(self, kernel_data_sources):
429
+ """Sets the kernel_data_sources of this KernelPushRequest.
430
+
431
+ A list of kernel data sources that the kernel should use. Each dataset is specified as `USERNAME/KERNEL-SLUG` # noqa: E501
432
+
433
+ :param kernel_data_sources: The kernel_data_sources of this KernelPushRequest. # noqa: E501
434
+ :type: list[str]
435
+ """
436
+
437
+ self._kernel_data_sources = kernel_data_sources
438
+
439
+ @property
440
+ def model_data_sources(self):
441
+ """Gets the model_data_sources of this KernelPushRequest. # noqa: E501
442
+
443
+ A list of model data sources that the kernel should use. Each model is specified as `USERNAME/MODEL-SLUG/FRAMEWORK/VARIATION-SLUG/VERSION-NUMBER` # noqa: E501
444
+
445
+ :return: The model_data_sources of this KernelPushRequest. # noqa: E501
446
+ :rtype: list[str]
447
+ """
448
+ return self._model_data_sources
449
+
450
+ @model_data_sources.setter
451
+ def model_data_sources(self, model_data_sources):
452
+ """Sets the model_data_sources of this KernelPushRequest.
453
+
454
+ A list of model data sources that the kernel should use. Each model is specified as `USERNAME/MODEL-SLUG/FRAMEWORK/VARIATION-SLUG/VERSION-NUMBER` # noqa: E501
455
+
456
+ :param model_data_sources: The model_data_sources of this KernelPushRequest. # noqa: E501
457
+ :type: list[str]
458
+ """
459
+
460
+ self._model_data_sources = model_data_sources
461
+
462
+ @property
463
+ def category_ids(self):
464
+ """Gets the category_ids of this KernelPushRequest. # noqa: E501
465
+
466
+ A list of tag IDs to associated with the kernel # noqa: E501
467
+
468
+ :return: The category_ids of this KernelPushRequest. # noqa: E501
469
+ :rtype: list[str]
470
+ """
471
+ return self._category_ids
472
+
473
+ @category_ids.setter
474
+ def category_ids(self, category_ids):
475
+ """Sets the category_ids of this KernelPushRequest.
476
+
477
+ A list of tag IDs to associated with the kernel # noqa: E501
478
+
479
+ :param category_ids: The category_ids of this KernelPushRequest. # noqa: E501
480
+ :type: list[str]
481
+ """
482
+
483
+ self._category_ids = category_ids
484
+
485
+ @property
486
+ def docker_image_pinning_type(self):
487
+ """Gets the docker_image_pinning_type of this KernelPushRequest. # noqa: E501
488
+
489
+ Which docker image to use for executing new versions going forward. # noqa: E501
490
+
491
+ :return: The docker_image_pinning_type of this KernelPushRequest. # noqa: E501
492
+ :rtype: str
493
+ """
494
+ return self._docker_image_pinning_type
495
+
496
+ @docker_image_pinning_type.setter
497
+ def docker_image_pinning_type(self, docker_image_pinning_type):
498
+ """Sets the docker_image_pinning_type of this KernelPushRequest.
499
+
500
+ Which docker image to use for executing new versions going forward. # noqa: E501
501
+
502
+ :param docker_image_pinning_type: The docker_image_pinning_type of this KernelPushRequest. # noqa: E501
503
+ :type: str
504
+ """
505
+ allowed_values = ["original", "latest"] # noqa: E501
506
+ if docker_image_pinning_type not in allowed_values:
507
+ raise ValueError(
508
+ "Invalid value for `docker_image_pinning_type` ({0}), must be one of {1}" # noqa: E501
509
+ .format(docker_image_pinning_type, allowed_values)
510
+ )
511
+
512
+ self._docker_image_pinning_type = docker_image_pinning_type
513
+
514
+ def to_dict(self):
515
+ """Returns the model properties as a dict"""
516
+ result = {}
517
+
518
+ for attr, _ in six.iteritems(self.project_types):
519
+ value = getattr(self, attr)
520
+ if isinstance(value, list):
521
+ result[attr] = list(map(
522
+ lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
523
+ value
524
+ ))
525
+ elif hasattr(value, "to_dict"):
526
+ result[attr] = value.to_dict()
527
+ elif isinstance(value, dict):
528
+ result[attr] = dict(map(
529
+ lambda item: (item[0], item[1].to_dict())
530
+ if hasattr(item[1], "to_dict") else item,
531
+ value.items()
532
+ ))
533
+ else:
534
+ result[attr] = value
535
+
536
+ return result
537
+
538
+ def to_str(self):
539
+ """Returns the string representation of the model"""
540
+ return pprint.pformat(self.to_dict())
541
+
542
+ def __repr__(self):
543
+ """For `print` and `pprint`"""
544
+ return self.to_str()
545
+
546
+ def __eq__(self, other):
547
+ """Returns true if both objects are equal"""
548
+ if not isinstance(other, KernelPushRequest):
549
+ return False
550
+
551
+ return self.__dict__ == other.__dict__
552
+
553
+ def __ne__(self, other):
554
+ """Returns true if both objects are not equal"""
555
+ return not self == other
556
+
@@ -0,0 +1,145 @@
1
+ #!/usr/bin/python
2
+ #
3
+ # Copyright 2024 Kaggle Inc
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # coding: utf-8
18
+
19
+ import pprint
20
+ import re # noqa: F401
21
+
22
+ import six
23
+
24
+ from kaggle.models.upload_file import UploadFile # noqa: F401,E501
25
+
26
+
27
+ class ModelInstanceNewVersionRequest(object):
28
+ """
29
+ Attributes:
30
+ project_types (dict): The key is attribute name
31
+ and the value is attribute type.
32
+ attribute_map (dict): The key is attribute name
33
+ and the value is json key in definition.
34
+ """
35
+ project_types = {
36
+ 'version_notes': 'str',
37
+ 'files': 'list[UploadFile]'
38
+ }
39
+
40
+ attribute_map = {
41
+ 'version_notes': 'versionNotes',
42
+ 'files': 'files'
43
+ }
44
+
45
+ def __init__(self, version_notes=None, files=None): # noqa: E501
46
+
47
+ self._version_notes = None
48
+ self._files = None
49
+ self.discriminator = None
50
+
51
+ if version_notes is not None:
52
+ self.version_notes = version_notes
53
+ self.files = files
54
+
55
+ @property
56
+ def version_notes(self):
57
+ """Gets the version_notes of this ModelInstanceNewVersionRequest. # noqa: E501
58
+
59
+ The version notes for the model instance version # noqa: E501
60
+
61
+ :return: The version_notes of this ModelInstanceNewVersionRequest. # noqa: E501
62
+ :rtype: str
63
+ """
64
+ return self._version_notes
65
+
66
+ @version_notes.setter
67
+ def version_notes(self, version_notes):
68
+ """Sets the version_notes of this ModelInstanceNewVersionRequest.
69
+
70
+ The version notes for the model instance version # noqa: E501
71
+
72
+ :param version_notes: The version_notes of this ModelInstanceNewVersionRequest. # noqa: E501
73
+ :type: str
74
+ """
75
+
76
+ self._version_notes = version_notes
77
+
78
+ @property
79
+ def files(self):
80
+ """Gets the files of this ModelInstanceNewVersionRequest. # noqa: E501
81
+
82
+ A list of files that should be associated with the model instance version # noqa: E501
83
+
84
+ :return: The files of this ModelInstanceNewVersionRequest. # noqa: E501
85
+ :rtype: list[UploadFile]
86
+ """
87
+ return self._files
88
+
89
+ @files.setter
90
+ def files(self, files):
91
+ """Sets the files of this ModelInstanceNewVersionRequest.
92
+
93
+ A list of files that should be associated with the model instance version # noqa: E501
94
+
95
+ :param files: The files of this ModelInstanceNewVersionRequest. # noqa: E501
96
+ :type: list[UploadFile]
97
+ """
98
+ if files is None:
99
+ raise ValueError("Invalid value for `files`, must not be `None`") # noqa: E501
100
+
101
+ self._files = files
102
+
103
+ def to_dict(self):
104
+ """Returns the model properties as a dict"""
105
+ result = {}
106
+
107
+ for attr, _ in six.iteritems(self.project_types):
108
+ value = getattr(self, attr)
109
+ if isinstance(value, list):
110
+ result[attr] = list(map(
111
+ lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
112
+ value
113
+ ))
114
+ elif hasattr(value, "to_dict"):
115
+ result[attr] = value.to_dict()
116
+ elif isinstance(value, dict):
117
+ result[attr] = dict(map(
118
+ lambda item: (item[0], item[1].to_dict())
119
+ if hasattr(item[1], "to_dict") else item,
120
+ value.items()
121
+ ))
122
+ else:
123
+ result[attr] = value
124
+
125
+ return result
126
+
127
+ def to_str(self):
128
+ """Returns the string representation of the model"""
129
+ return pprint.pformat(self.to_dict())
130
+
131
+ def __repr__(self):
132
+ """For `print` and `pprint`"""
133
+ return self.to_str()
134
+
135
+ def __eq__(self, other):
136
+ """Returns true if both objects are equal"""
137
+ if not isinstance(other, ModelInstanceNewVersionRequest):
138
+ return False
139
+
140
+ return self.__dict__ == other.__dict__
141
+
142
+ def __ne__(self, other):
143
+ """Returns true if both objects are not equal"""
144
+ return not self == other
145
+