kaggle 1.8.0__py3-none-any.whl → 1.8.3__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 (128) hide show
  1. kaggle/__init__.py +1 -1
  2. kaggle/api/kaggle_api_extended.py +24 -2
  3. {kaggle-1.8.0.dist-info → kaggle-1.8.3.dist-info}/METADATA +4 -3
  4. kaggle-1.8.3.dist-info/RECORD +28 -0
  5. {kaggle-1.8.0.dist-info → kaggle-1.8.3.dist-info}/WHEEL +1 -1
  6. kaggle-1.8.0.dist-info/RECORD +0 -148
  7. kagglesdk/LICENSE +0 -201
  8. kagglesdk/__init__.py +0 -6
  9. kagglesdk/admin/__init__.py +0 -0
  10. kagglesdk/admin/services/__init__.py +0 -0
  11. kagglesdk/admin/services/inbox_file_service.py +0 -22
  12. kagglesdk/admin/types/__init__.py +0 -0
  13. kagglesdk/admin/types/inbox_file_service.py +0 -74
  14. kagglesdk/benchmarks/__init__.py +0 -0
  15. kagglesdk/benchmarks/services/__init__.py +0 -0
  16. kagglesdk/benchmarks/services/benchmarks_api_service.py +0 -19
  17. kagglesdk/benchmarks/types/__init__.py +0 -0
  18. kagglesdk/benchmarks/types/benchmark_types.py +0 -307
  19. kagglesdk/benchmarks/types/benchmarks_api_service.py +0 -243
  20. kagglesdk/blobs/__init__.py +0 -0
  21. kagglesdk/blobs/services/__init__.py +0 -0
  22. kagglesdk/blobs/services/blob_api_service.py +0 -25
  23. kagglesdk/blobs/types/__init__.py +0 -0
  24. kagglesdk/blobs/types/blob_api_service.py +0 -177
  25. kagglesdk/common/__init__.py +0 -0
  26. kagglesdk/common/services/__init__.py +0 -0
  27. kagglesdk/common/services/operations_service.py +0 -46
  28. kagglesdk/common/types/__init__.py +0 -0
  29. kagglesdk/common/types/file_download.py +0 -102
  30. kagglesdk/common/types/http_redirect.py +0 -105
  31. kagglesdk/common/types/operations.py +0 -194
  32. kagglesdk/common/types/operations_service.py +0 -48
  33. kagglesdk/community/__init__.py +0 -0
  34. kagglesdk/community/types/__init__.py +0 -0
  35. kagglesdk/community/types/content_enums.py +0 -44
  36. kagglesdk/community/types/organization.py +0 -410
  37. kagglesdk/competitions/__init__.py +0 -0
  38. kagglesdk/competitions/services/__init__.py +0 -0
  39. kagglesdk/competitions/services/competition_api_service.py +0 -178
  40. kagglesdk/competitions/types/__init__.py +0 -0
  41. kagglesdk/competitions/types/competition.py +0 -14
  42. kagglesdk/competitions/types/competition_api_service.py +0 -2393
  43. kagglesdk/competitions/types/competition_enums.py +0 -53
  44. kagglesdk/competitions/types/search_competitions.py +0 -28
  45. kagglesdk/competitions/types/submission_status.py +0 -9
  46. kagglesdk/datasets/__init__.py +0 -0
  47. kagglesdk/datasets/databundles/__init__.py +0 -0
  48. kagglesdk/datasets/databundles/types/__init__.py +0 -0
  49. kagglesdk/datasets/databundles/types/databundle_api_types.py +0 -540
  50. kagglesdk/datasets/services/__init__.py +0 -0
  51. kagglesdk/datasets/services/dataset_api_service.py +0 -195
  52. kagglesdk/datasets/types/__init__.py +0 -0
  53. kagglesdk/datasets/types/dataset_api_service.py +0 -3047
  54. kagglesdk/datasets/types/dataset_enums.py +0 -103
  55. kagglesdk/datasets/types/dataset_service.py +0 -145
  56. kagglesdk/datasets/types/dataset_types.py +0 -646
  57. kagglesdk/datasets/types/search_datasets.py +0 -6
  58. kagglesdk/discussions/__init__.py +0 -0
  59. kagglesdk/discussions/types/__init__.py +0 -0
  60. kagglesdk/discussions/types/search_discussions.py +0 -43
  61. kagglesdk/discussions/types/writeup_enums.py +0 -11
  62. kagglesdk/education/__init__.py +0 -0
  63. kagglesdk/education/services/__init__.py +0 -0
  64. kagglesdk/education/services/education_api_service.py +0 -19
  65. kagglesdk/education/types/__init__.py +0 -0
  66. kagglesdk/education/types/education_api_service.py +0 -248
  67. kagglesdk/education/types/education_service.py +0 -139
  68. kagglesdk/kaggle_client.py +0 -101
  69. kagglesdk/kaggle_creds.py +0 -148
  70. kagglesdk/kaggle_env.py +0 -104
  71. kagglesdk/kaggle_http_client.py +0 -261
  72. kagglesdk/kaggle_oauth.py +0 -200
  73. kagglesdk/kaggle_object.py +0 -344
  74. kagglesdk/kernels/__init__.py +0 -0
  75. kagglesdk/kernels/services/__init__.py +0 -0
  76. kagglesdk/kernels/services/kernels_api_service.py +0 -146
  77. kagglesdk/kernels/types/__init__.py +0 -0
  78. kagglesdk/kernels/types/kernels_api_service.py +0 -2451
  79. kagglesdk/kernels/types/kernels_enums.py +0 -39
  80. kagglesdk/kernels/types/search_kernels.py +0 -6
  81. kagglesdk/licenses/__init__.py +0 -0
  82. kagglesdk/licenses/types/__init__.py +0 -0
  83. kagglesdk/licenses/types/licenses_types.py +0 -182
  84. kagglesdk/models/__init__.py +0 -0
  85. kagglesdk/models/services/__init__.py +0 -0
  86. kagglesdk/models/services/model_api_service.py +0 -280
  87. kagglesdk/models/services/model_service.py +0 -19
  88. kagglesdk/models/types/__init__.py +0 -0
  89. kagglesdk/models/types/model_api_service.py +0 -4069
  90. kagglesdk/models/types/model_enums.py +0 -68
  91. kagglesdk/models/types/model_service.py +0 -275
  92. kagglesdk/models/types/model_types.py +0 -1338
  93. kagglesdk/models/types/search_models.py +0 -8
  94. kagglesdk/search/__init__.py +0 -0
  95. kagglesdk/search/services/__init__.py +0 -0
  96. kagglesdk/search/services/search_api_service.py +0 -19
  97. kagglesdk/search/types/__init__.py +0 -0
  98. kagglesdk/search/types/search_api_service.py +0 -2435
  99. kagglesdk/search/types/search_content_shared.py +0 -50
  100. kagglesdk/search/types/search_enums.py +0 -45
  101. kagglesdk/search/types/search_service.py +0 -303
  102. kagglesdk/security/__init__.py +0 -0
  103. kagglesdk/security/services/__init__.py +0 -0
  104. kagglesdk/security/services/iam_service.py +0 -31
  105. kagglesdk/security/services/oauth_service.py +0 -58
  106. kagglesdk/security/types/__init__.py +0 -0
  107. kagglesdk/security/types/authentication.py +0 -171
  108. kagglesdk/security/types/iam_service.py +0 -496
  109. kagglesdk/security/types/oauth_service.py +0 -1181
  110. kagglesdk/security/types/roles.py +0 -8
  111. kagglesdk/security/types/security_types.py +0 -159
  112. kagglesdk/test/__init__.py +0 -0
  113. kagglesdk/test/test_client.py +0 -41
  114. kagglesdk/users/__init__.py +0 -0
  115. kagglesdk/users/services/__init__.py +0 -0
  116. kagglesdk/users/services/account_service.py +0 -31
  117. kagglesdk/users/services/group_api_service.py +0 -31
  118. kagglesdk/users/types/__init__.py +0 -0
  119. kagglesdk/users/types/account_service.py +0 -345
  120. kagglesdk/users/types/group_api_service.py +0 -315
  121. kagglesdk/users/types/group_types.py +0 -165
  122. kagglesdk/users/types/groups_enum.py +0 -8
  123. kagglesdk/users/types/progression_service.py +0 -9
  124. kagglesdk/users/types/search_users.py +0 -23
  125. kagglesdk/users/types/user_avatar.py +0 -226
  126. kagglesdk/users/types/users_enums.py +0 -22
  127. {kaggle-1.8.0.dist-info → kaggle-1.8.3.dist-info}/entry_points.txt +0 -0
  128. {kaggle-1.8.0.dist-info → kaggle-1.8.3.dist-info}/licenses/LICENSE.txt +0 -0
@@ -1,177 +0,0 @@
1
- import enum
2
- from kagglesdk.kaggle_object import *
3
- from typing import Optional
4
-
5
- class ApiBlobType(enum.Enum):
6
- API_BLOB_TYPE_UNSPECIFIED = 0
7
- DATASET = 1
8
- MODEL = 2
9
- INBOX = 3
10
-
11
- class ApiStartBlobUploadRequest(KaggleObject):
12
- r"""
13
- Attributes:
14
- type (ApiBlobType)
15
- The type of the blob.
16
- name (str)
17
- Name (e.g. file name) of the blob.
18
- content_type (str)
19
- Content/MIME type (e.g. 'text/plain').
20
- content_length (int)
21
- Size in bytes of the blob.
22
- last_modified_epoch_seconds (int)
23
- Optional user-reported time when the blob was last updated/modified.
24
- """
25
-
26
- def __init__(self):
27
- self._type = ApiBlobType.API_BLOB_TYPE_UNSPECIFIED
28
- self._name = ""
29
- self._content_type = None
30
- self._content_length = 0
31
- self._last_modified_epoch_seconds = None
32
- self._freeze()
33
-
34
- @property
35
- def type(self) -> 'ApiBlobType':
36
- """The type of the blob."""
37
- return self._type
38
-
39
- @type.setter
40
- def type(self, type: 'ApiBlobType'):
41
- if type is None:
42
- del self.type
43
- return
44
- if not isinstance(type, ApiBlobType):
45
- raise TypeError('type must be of type ApiBlobType')
46
- self._type = type
47
-
48
- @property
49
- def name(self) -> str:
50
- """Name (e.g. file name) of the blob."""
51
- return self._name
52
-
53
- @name.setter
54
- def name(self, name: str):
55
- if name is None:
56
- del self.name
57
- return
58
- if not isinstance(name, str):
59
- raise TypeError('name must be of type str')
60
- self._name = name
61
-
62
- @property
63
- def content_type(self) -> str:
64
- """Content/MIME type (e.g. 'text/plain')."""
65
- return self._content_type or ""
66
-
67
- @content_type.setter
68
- def content_type(self, content_type: Optional[str]):
69
- if content_type is None:
70
- del self.content_type
71
- return
72
- if not isinstance(content_type, str):
73
- raise TypeError('content_type must be of type str')
74
- self._content_type = content_type
75
-
76
- @property
77
- def content_length(self) -> int:
78
- """Size in bytes of the blob."""
79
- return self._content_length
80
-
81
- @content_length.setter
82
- def content_length(self, content_length: int):
83
- if content_length is None:
84
- del self.content_length
85
- return
86
- if not isinstance(content_length, int):
87
- raise TypeError('content_length must be of type int')
88
- self._content_length = content_length
89
-
90
- @property
91
- def last_modified_epoch_seconds(self) -> int:
92
- """Optional user-reported time when the blob was last updated/modified."""
93
- return self._last_modified_epoch_seconds or 0
94
-
95
- @last_modified_epoch_seconds.setter
96
- def last_modified_epoch_seconds(self, last_modified_epoch_seconds: Optional[int]):
97
- if last_modified_epoch_seconds is None:
98
- del self.last_modified_epoch_seconds
99
- return
100
- if not isinstance(last_modified_epoch_seconds, int):
101
- raise TypeError('last_modified_epoch_seconds must be of type int')
102
- self._last_modified_epoch_seconds = last_modified_epoch_seconds
103
-
104
- def endpoint(self):
105
- path = '/api/v1/blobs/upload'
106
- return path.format_map(self.to_field_map(self))
107
-
108
-
109
- @staticmethod
110
- def method():
111
- return 'POST'
112
-
113
- @staticmethod
114
- def body_fields():
115
- return '*'
116
-
117
-
118
- class ApiStartBlobUploadResponse(KaggleObject):
119
- r"""
120
- Attributes:
121
- token (str)
122
- Opaque string token used to reference the new blob/file.
123
- create_url (str)
124
- URL to use to start the upload.
125
- """
126
-
127
- def __init__(self):
128
- self._token = ""
129
- self._create_url = ""
130
- self._freeze()
131
-
132
- @property
133
- def token(self) -> str:
134
- """Opaque string token used to reference the new blob/file."""
135
- return self._token
136
-
137
- @token.setter
138
- def token(self, token: str):
139
- if token is None:
140
- del self.token
141
- return
142
- if not isinstance(token, str):
143
- raise TypeError('token must be of type str')
144
- self._token = token
145
-
146
- @property
147
- def create_url(self) -> str:
148
- """URL to use to start the upload."""
149
- return self._create_url
150
-
151
- @create_url.setter
152
- def create_url(self, create_url: str):
153
- if create_url is None:
154
- del self.create_url
155
- return
156
- if not isinstance(create_url, str):
157
- raise TypeError('create_url must be of type str')
158
- self._create_url = create_url
159
-
160
- @property
161
- def createUrl(self):
162
- return self.create_url
163
-
164
-
165
- ApiStartBlobUploadRequest._fields = [
166
- FieldMetadata("type", "type", "_type", ApiBlobType, ApiBlobType.API_BLOB_TYPE_UNSPECIFIED, EnumSerializer()),
167
- FieldMetadata("name", "name", "_name", str, "", PredefinedSerializer()),
168
- FieldMetadata("contentType", "content_type", "_content_type", str, None, PredefinedSerializer(), optional=True),
169
- FieldMetadata("contentLength", "content_length", "_content_length", int, 0, PredefinedSerializer()),
170
- FieldMetadata("lastModifiedEpochSeconds", "last_modified_epoch_seconds", "_last_modified_epoch_seconds", int, None, PredefinedSerializer(), optional=True),
171
- ]
172
-
173
- ApiStartBlobUploadResponse._fields = [
174
- FieldMetadata("token", "token", "_token", str, "", PredefinedSerializer()),
175
- FieldMetadata("createUrl", "create_url", "_create_url", str, "", PredefinedSerializer()),
176
- ]
177
-
File without changes
File without changes
@@ -1,46 +0,0 @@
1
- from kagglesdk.common.types.operations import Operation
2
- from kagglesdk.common.types.operations_service import GetOperationRequest
3
- from kagglesdk.kaggle_http_client import KaggleHttpClient
4
-
5
- class OperationsClient(object):
6
- r"""
7
- Manages long-running operations with an API service.
8
-
9
- When an API method normally takes long time to complete, it can be designed
10
- to return [Operation][google.longrunning.Operation] to the client, and the
11
- client can use this interface to receive the real response asynchronously by
12
- polling the operation resource, or pass the operation resource to another API
13
- (such as Pub/Sub API) to receive the response. Any API service that returns
14
- long-running operations should implement the `Operations` interface so
15
- developers can have a consistent client experience.
16
- """
17
-
18
- def __init__(self, client: KaggleHttpClient):
19
- self._client = client
20
-
21
- def get_operation(self, request: GetOperationRequest = None, name: str = None) -> Operation:
22
- r"""
23
- Gets the latest state of a long-running operation. Clients can use this
24
- method to poll the operation result at intervals as recommended by the API
25
- service.
26
-
27
- Args:
28
- request (GetOperationRequest):
29
- The request object; initialized to empty instance if not specified.
30
- May not be specified if any of the flattened field params are specified.
31
- name (str)
32
- This corresponds to the ``name`` field on the ``request`` instance;
33
- if ``request`` is provided, this should not be set.
34
- """
35
-
36
- has_flattened_args = any([name])
37
- if request is not None and has_flattened_args:
38
- raise ValueError('If the `request` argument is set, then none of '
39
- 'the individual field arguments should be set.')
40
-
41
- if request is None:
42
- request = GetOperationRequest()
43
- if name is not None:
44
- request.name = name
45
-
46
- return self._client.call("common.OperationsService", "GetOperation", request, Operation)
File without changes
@@ -1,102 +0,0 @@
1
- from kagglesdk.kaggle_object import *
2
- from typing import Optional
3
-
4
- class FileDownload(KaggleObject):
5
- r"""
6
- Standard response object representing a file download.
7
- See http://go/kaggle-proto-handler-file-downloads
8
- Some field names/descriptions borrowed from
9
- google3/gdata/rosy/proto/data.proto
10
-
11
- Attributes:
12
- content_type (str)
13
- MIME type of the data
14
- TODO(aip.dev/143): (-- api-linter: core::0143::standardized-codes=disabled
15
- --)
16
- file_name (str)
17
- Original file name
18
- token (str)
19
- A unique fingerprint for the file/media data
20
- content_length (int)
21
- Size of the data, in bytes (if known)
22
- """
23
-
24
- def __init__(self):
25
- self._content_type = ""
26
- self._file_name = ""
27
- self._token = ""
28
- self._content_length = None
29
- self._freeze()
30
-
31
- @property
32
- def content_type(self) -> str:
33
- r"""
34
- MIME type of the data
35
- TODO(aip.dev/143): (-- api-linter: core::0143::standardized-codes=disabled
36
- --)
37
- """
38
- return self._content_type
39
-
40
- @content_type.setter
41
- def content_type(self, content_type: str):
42
- if content_type is None:
43
- del self.content_type
44
- return
45
- if not isinstance(content_type, str):
46
- raise TypeError('content_type must be of type str')
47
- self._content_type = content_type
48
-
49
- @property
50
- def file_name(self) -> str:
51
- """Original file name"""
52
- return self._file_name
53
-
54
- @file_name.setter
55
- def file_name(self, file_name: str):
56
- if file_name is None:
57
- del self.file_name
58
- return
59
- if not isinstance(file_name, str):
60
- raise TypeError('file_name must be of type str')
61
- self._file_name = file_name
62
-
63
- @property
64
- def token(self) -> str:
65
- """A unique fingerprint for the file/media data"""
66
- return self._token
67
-
68
- @token.setter
69
- def token(self, token: str):
70
- if token is None:
71
- del self.token
72
- return
73
- if not isinstance(token, str):
74
- raise TypeError('token must be of type str')
75
- self._token = token
76
-
77
- @property
78
- def content_length(self) -> int:
79
- """Size of the data, in bytes (if known)"""
80
- return self._content_length or 0
81
-
82
- @content_length.setter
83
- def content_length(self, content_length: Optional[int]):
84
- if content_length is None:
85
- del self.content_length
86
- return
87
- if not isinstance(content_length, int):
88
- raise TypeError('content_length must be of type int')
89
- self._content_length = content_length
90
-
91
- @classmethod
92
- def prepare_from(cls, http_response):
93
- return http_response
94
-
95
-
96
- FileDownload._fields = [
97
- FieldMetadata("contentType", "content_type", "_content_type", str, "", PredefinedSerializer()),
98
- FieldMetadata("fileName", "file_name", "_file_name", str, "", PredefinedSerializer()),
99
- FieldMetadata("token", "token", "_token", str, "", PredefinedSerializer()),
100
- FieldMetadata("contentLength", "content_length", "_content_length", int, None, PredefinedSerializer(), optional=True),
101
- ]
102
-
@@ -1,105 +0,0 @@
1
- from datetime import timedelta
2
- from kagglesdk.kaggle_object import *
3
- from typing import Optional
4
-
5
- class HttpRedirect(KaggleObject):
6
- r"""
7
- Represents an HTTP redirect (e.g. 301 or 302) response.
8
- Patterned after ASP.NET MVC's RedirectResult.
9
-
10
- Attributes:
11
- url (str)
12
- Destination URL for the redirect.
13
- permanent (bool)
14
- Should it be an HTTP 301 (permanent) redirect or just temporary (HTTP
15
- 302)?.
16
- bypass_encoding (bool)
17
- When `true`, the `url` is already encoded, so bypass `UriHelper.Encode`.
18
- Otherwise, invoke `UriHelper.Encode` on the `url` before returning to the
19
- client.
20
- expiry (timedelta)
21
- Specifies how long the redirected url can be cached.
22
- """
23
-
24
- def __init__(self):
25
- self._url = ""
26
- self._permanent = False
27
- self._bypass_encoding = None
28
- self._expiry = None
29
- self._freeze()
30
-
31
- @property
32
- def url(self) -> str:
33
- """Destination URL for the redirect."""
34
- return self._url
35
-
36
- @url.setter
37
- def url(self, url: str):
38
- if url is None:
39
- del self.url
40
- return
41
- if not isinstance(url, str):
42
- raise TypeError('url must be of type str')
43
- self._url = url
44
-
45
- @property
46
- def permanent(self) -> bool:
47
- r"""
48
- Should it be an HTTP 301 (permanent) redirect or just temporary (HTTP
49
- 302)?.
50
- """
51
- return self._permanent
52
-
53
- @permanent.setter
54
- def permanent(self, permanent: bool):
55
- if permanent is None:
56
- del self.permanent
57
- return
58
- if not isinstance(permanent, bool):
59
- raise TypeError('permanent must be of type bool')
60
- self._permanent = permanent
61
-
62
- @property
63
- def bypass_encoding(self) -> bool:
64
- r"""
65
- When `true`, the `url` is already encoded, so bypass `UriHelper.Encode`.
66
- Otherwise, invoke `UriHelper.Encode` on the `url` before returning to the
67
- client.
68
- """
69
- return self._bypass_encoding or False
70
-
71
- @bypass_encoding.setter
72
- def bypass_encoding(self, bypass_encoding: Optional[bool]):
73
- if bypass_encoding is None:
74
- del self.bypass_encoding
75
- return
76
- if not isinstance(bypass_encoding, bool):
77
- raise TypeError('bypass_encoding must be of type bool')
78
- self._bypass_encoding = bypass_encoding
79
-
80
- @property
81
- def expiry(self) -> timedelta:
82
- """Specifies how long the redirected url can be cached."""
83
- return self._expiry
84
-
85
- @expiry.setter
86
- def expiry(self, expiry: timedelta):
87
- if expiry is None:
88
- del self.expiry
89
- return
90
- if not isinstance(expiry, timedelta):
91
- raise TypeError('expiry must be of type timedelta')
92
- self._expiry = expiry
93
-
94
- @classmethod
95
- def prepare_from(cls, http_response):
96
- return http_response
97
-
98
-
99
- HttpRedirect._fields = [
100
- FieldMetadata("url", "url", "_url", str, "", PredefinedSerializer()),
101
- FieldMetadata("permanent", "permanent", "_permanent", bool, False, PredefinedSerializer()),
102
- FieldMetadata("bypassEncoding", "bypass_encoding", "_bypass_encoding", bool, None, PredefinedSerializer(), optional=True),
103
- FieldMetadata("expiry", "expiry", "_expiry", timedelta, None, TimeDeltaSerializer()),
104
- ]
105
-
@@ -1,194 +0,0 @@
1
- from kagglesdk.kaggle_object import *
2
- from typing import Optional
3
-
4
- class Operation(KaggleObject):
5
- r"""
6
- This resource represents a long-running operation that is the result of a
7
- network API call.
8
-
9
- Attributes:
10
- name (str)
11
- The server-assigned name, which is only unique within the same service that
12
- originally returns it. If you use the default HTTP mapping, the
13
- `name` should be a resource name ending with `operations/{unique_id}`.
14
- metadata (object)
15
- Service-specific metadata associated with the operation. It typically
16
- contains progress information and common metadata such as create time.
17
- Some services might not provide such metadata. Any method that returns a
18
- long-running operation should document the metadata type, if any.
19
- done (bool)
20
- If the value is `false`, it means the operation is still in progress.
21
- If `true`, the operation is completed, and either `error` or `response` is
22
- available.
23
- error (Operation.Status)
24
- The error result of the operation in case of failure or cancellation.
25
- response (object)
26
- The normal, successful response of the operation. If the original
27
- method returns no data on success, such as `Delete`, the response is
28
- `google.protobuf.Empty`. If the original method is standard
29
- `Get`/`Create`/`Update`, the response should be the resource. For other
30
- methods, the response should have the type `XxxResponse`, where `Xxx`
31
- is the original method name. For example, if the original method name
32
- is `TakeSnapshot()`, the inferred response type is
33
- `TakeSnapshotResponse`.
34
- """
35
-
36
- class Status(KaggleObject):
37
- r"""
38
- Attributes:
39
- code (int)
40
- The HTTP status code that corresponds to `google.rpc.Status.code`.
41
- message (str)
42
- This corresponds to `google.rpc.Status.message`.
43
- """
44
-
45
- def __init__(self):
46
- self._code = 0
47
- self._message = ""
48
- self._freeze()
49
-
50
- @property
51
- def code(self) -> int:
52
- """The HTTP status code that corresponds to `google.rpc.Status.code`."""
53
- return self._code
54
-
55
- @code.setter
56
- def code(self, code: int):
57
- if code is None:
58
- del self.code
59
- return
60
- if not isinstance(code, int):
61
- raise TypeError('code must be of type int')
62
- self._code = code
63
-
64
- @property
65
- def message(self) -> str:
66
- """This corresponds to `google.rpc.Status.message`."""
67
- return self._message
68
-
69
- @message.setter
70
- def message(self, message: str):
71
- if message is None:
72
- del self.message
73
- return
74
- if not isinstance(message, str):
75
- raise TypeError('message must be of type str')
76
- self._message = message
77
-
78
-
79
- def __init__(self):
80
- self._name = ""
81
- self._metadata = None
82
- self._done = False
83
- self._error = None
84
- self._response = None
85
- self._freeze()
86
-
87
- @property
88
- def name(self) -> str:
89
- r"""
90
- The server-assigned name, which is only unique within the same service that
91
- originally returns it. If you use the default HTTP mapping, the
92
- `name` should be a resource name ending with `operations/{unique_id}`.
93
- """
94
- return self._name
95
-
96
- @name.setter
97
- def name(self, name: str):
98
- if name is None:
99
- del self.name
100
- return
101
- if not isinstance(name, str):
102
- raise TypeError('name must be of type str')
103
- self._name = name
104
-
105
- @property
106
- def metadata(self) -> object:
107
- r"""
108
- Service-specific metadata associated with the operation. It typically
109
- contains progress information and common metadata such as create time.
110
- Some services might not provide such metadata. Any method that returns a
111
- long-running operation should document the metadata type, if any.
112
- """
113
- return self._metadata
114
-
115
- @metadata.setter
116
- def metadata(self, metadata: object):
117
- if metadata is None:
118
- del self.metadata
119
- return
120
- if not isinstance(metadata, object):
121
- raise TypeError('metadata must be of type object')
122
- self._metadata = metadata
123
-
124
- @property
125
- def done(self) -> bool:
126
- r"""
127
- If the value is `false`, it means the operation is still in progress.
128
- If `true`, the operation is completed, and either `error` or `response` is
129
- available.
130
- """
131
- return self._done
132
-
133
- @done.setter
134
- def done(self, done: bool):
135
- if done is None:
136
- del self.done
137
- return
138
- if not isinstance(done, bool):
139
- raise TypeError('done must be of type bool')
140
- self._done = done
141
-
142
- @property
143
- def error(self) -> Optional['Operation.Status']:
144
- """The error result of the operation in case of failure or cancellation."""
145
- return self._error or None
146
-
147
- @error.setter
148
- def error(self, error: Optional['Operation.Status']):
149
- if error is None:
150
- del self.error
151
- return
152
- if not isinstance(error, Operation.Status):
153
- raise TypeError('error must be of type Operation.Status')
154
- del self.response
155
- self._error = error
156
-
157
- @property
158
- def response(self) -> object:
159
- r"""
160
- The normal, successful response of the operation. If the original
161
- method returns no data on success, such as `Delete`, the response is
162
- `google.protobuf.Empty`. If the original method is standard
163
- `Get`/`Create`/`Update`, the response should be the resource. For other
164
- methods, the response should have the type `XxxResponse`, where `Xxx`
165
- is the original method name. For example, if the original method name
166
- is `TakeSnapshot()`, the inferred response type is
167
- `TakeSnapshotResponse`.
168
- """
169
- return self._response or None
170
-
171
- @response.setter
172
- def response(self, response: object):
173
- if response is None:
174
- del self.response
175
- return
176
- if not isinstance(response, object):
177
- raise TypeError('response must be of type object')
178
- del self.error
179
- self._response = response
180
-
181
-
182
- Operation.Status._fields = [
183
- FieldMetadata("code", "code", "_code", int, 0, PredefinedSerializer()),
184
- FieldMetadata("message", "message", "_message", str, "", PredefinedSerializer()),
185
- ]
186
-
187
- Operation._fields = [
188
- FieldMetadata("name", "name", "_name", str, "", PredefinedSerializer()),
189
- FieldMetadata("metadata", "metadata", "_metadata", object, None, PredefinedSerializer()),
190
- FieldMetadata("done", "done", "_done", bool, False, PredefinedSerializer()),
191
- FieldMetadata("error", "error", "_error", Operation.Status, None, KaggleObjectSerializer(), optional=True),
192
- FieldMetadata("response", "response", "_response", object, None, PredefinedSerializer(), optional=True),
193
- ]
194
-
@@ -1,48 +0,0 @@
1
- from kagglesdk.kaggle_object import *
2
-
3
- class GetOperationRequest(KaggleObject):
4
- r"""
5
- The request message for
6
- [Operations.GetOperation][google.longrunning.Operations.GetOperation].
7
-
8
- Attributes:
9
- name (str)
10
- The name of the operation resource.
11
- """
12
-
13
- def __init__(self):
14
- self._name = ""
15
- self._freeze()
16
-
17
- @property
18
- def name(self) -> str:
19
- """The name of the operation resource."""
20
- return self._name
21
-
22
- @name.setter
23
- def name(self, name: str):
24
- if name is None:
25
- del self.name
26
- return
27
- if not isinstance(name, str):
28
- raise TypeError('name must be of type str')
29
- self._name = name
30
-
31
- def endpoint(self):
32
- path = '/api/v1/operations/get'
33
- return path.format_map(self.to_field_map(self))
34
-
35
-
36
- @staticmethod
37
- def method():
38
- return 'POST'
39
-
40
- @staticmethod
41
- def body_fields():
42
- return '*'
43
-
44
-
45
- GetOperationRequest._fields = [
46
- FieldMetadata("name", "name", "_name", str, "", PredefinedSerializer()),
47
- ]
48
-
File without changes
File without changes