lightning-sdk 0.2.18__py3-none-any.whl → 0.2.19__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 (46) hide show
  1. lightning_sdk/__init__.py +1 -1
  2. lightning_sdk/api/deployment_api.py +2 -0
  3. lightning_sdk/deployment/deployment.py +2 -0
  4. lightning_sdk/lightning_cloud/openapi/__init__.py +8 -0
  5. lightning_sdk/lightning_cloud/openapi/api/__init__.py +1 -0
  6. lightning_sdk/lightning_cloud/openapi/api/blog_posts_service_api.py +533 -0
  7. lightning_sdk/lightning_cloud/openapi/api/cloud_space_service_api.py +113 -0
  8. lightning_sdk/lightning_cloud/openapi/models/__init__.py +7 -0
  9. lightning_sdk/lightning_cloud/openapi/models/blogposts_id_body.py +253 -0
  10. lightning_sdk/lightning_cloud/openapi/models/deployments_id_body.py +27 -1
  11. lightning_sdk/lightning_cloud/openapi/models/id_transfer_body.py +123 -0
  12. lightning_sdk/lightning_cloud/openapi/models/orgs_id_body.py +157 -157
  13. lightning_sdk/lightning_cloud/openapi/models/projects_id_body.py +79 -1
  14. lightning_sdk/lightning_cloud/openapi/models/v1_blog_post.py +331 -0
  15. lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_environment_template.py +27 -1
  16. lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_environment_template_config.py +27 -1
  17. lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_state.py +1 -0
  18. lightning_sdk/lightning_cloud/openapi/models/v1_create_blog_post_request.py +253 -0
  19. lightning_sdk/lightning_cloud/openapi/models/v1_daily_usage.py +81 -3
  20. lightning_sdk/lightning_cloud/openapi/models/v1_delete_blog_post_response.py +123 -0
  21. lightning_sdk/lightning_cloud/openapi/models/v1_deployment.py +27 -1
  22. lightning_sdk/lightning_cloud/openapi/models/v1_get_organization_storage_metadata_response.py +79 -1
  23. lightning_sdk/lightning_cloud/openapi/models/v1_get_project_storage_metadata_response.py +133 -3
  24. lightning_sdk/lightning_cloud/openapi/models/v1_get_user_storage_breakdown_response.py +27 -1
  25. lightning_sdk/lightning_cloud/openapi/models/v1_google_cloud_direct_v1.py +53 -1
  26. lightning_sdk/lightning_cloud/openapi/models/v1_list_blog_posts_response.py +175 -0
  27. lightning_sdk/lightning_cloud/openapi/models/v1_message.py +27 -1
  28. lightning_sdk/lightning_cloud/openapi/models/v1_organization.py +157 -157
  29. lightning_sdk/lightning_cloud/openapi/models/v1_product_license.py +27 -1
  30. lightning_sdk/lightning_cloud/openapi/models/v1_project.py +53 -1
  31. lightning_sdk/lightning_cloud/openapi/models/v1_project_membership.py +27 -1
  32. lightning_sdk/lightning_cloud/openapi/models/v1_project_settings.py +79 -1
  33. lightning_sdk/lightning_cloud/openapi/models/v1_project_storage.py +79 -27
  34. lightning_sdk/lightning_cloud/openapi/models/v1_rule_resource.py +1 -0
  35. lightning_sdk/lightning_cloud/openapi/models/v1_storage_asset_type.py +2 -0
  36. lightning_sdk/lightning_cloud/openapi/models/v1_transfer_cloud_space_response.py +97 -0
  37. lightning_sdk/lightning_cloud/openapi/models/v1_usage.py +79 -1
  38. lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +197 -67
  39. lightning_sdk/serve.py +1 -0
  40. lightning_sdk/services/license.py +87 -22
  41. {lightning_sdk-0.2.18.dist-info → lightning_sdk-0.2.19.dist-info}/METADATA +1 -1
  42. {lightning_sdk-0.2.18.dist-info → lightning_sdk-0.2.19.dist-info}/RECORD +46 -38
  43. {lightning_sdk-0.2.18.dist-info → lightning_sdk-0.2.19.dist-info}/LICENSE +0 -0
  44. {lightning_sdk-0.2.18.dist-info → lightning_sdk-0.2.19.dist-info}/WHEEL +0 -0
  45. {lightning_sdk-0.2.18.dist-info → lightning_sdk-0.2.19.dist-info}/entry_points.txt +0 -0
  46. {lightning_sdk-0.2.18.dist-info → lightning_sdk-0.2.19.dist-info}/top_level.txt +0 -0
lightning_sdk/__init__.py CHANGED
@@ -31,6 +31,6 @@ __all__ = [
31
31
  "User",
32
32
  ]
33
33
 
34
- __version__ = "0.2.18"
34
+ __version__ = "0.2.19"
35
35
  _check_version_and_prompt_upgrade(__version__)
36
36
  _set_tqdm_envvars_noninteractive()
@@ -225,6 +225,7 @@ class DeploymentApi:
225
225
  self,
226
226
  deployment: V1Deployment,
227
227
  from_onboarding: Optional[bool] = None,
228
+ from_litserve: Optional[bool] = None,
228
229
  ) -> V1Deployment:
229
230
  return self._client.jobs_service_create_deployment(
230
231
  project_id=deployment.project_id,
@@ -238,6 +239,7 @@ class DeploymentApi:
238
239
  spec=deployment.spec,
239
240
  strategy=deployment.strategy,
240
241
  from_onboarding=from_onboarding,
242
+ from_litserve=from_litserve,
241
243
  ),
242
244
  )
243
245
 
@@ -129,6 +129,7 @@ class Deployment:
129
129
  quantity: Optional[int] = None,
130
130
  include_credentials: Optional[bool] = None,
131
131
  from_onboarding: Optional[bool] = None,
132
+ from_litserve: Optional[bool] = None,
132
133
  ) -> None:
133
134
  """The Lightning AI Deployment.
134
135
 
@@ -228,6 +229,7 @@ class Deployment:
228
229
  strategy=to_strategy(release_strategy),
229
230
  ),
230
231
  from_onboarding=from_onboarding,
232
+ from_litserve=from_litserve,
231
233
  )
232
234
 
233
235
  # Overrides the name
@@ -27,6 +27,7 @@ from lightning_sdk.lightning_cloud.openapi.api.analytics_service_api import Anal
27
27
  from lightning_sdk.lightning_cloud.openapi.api.assistants_service_api import AssistantsServiceApi
28
28
  from lightning_sdk.lightning_cloud.openapi.api.auth_service_api import AuthServiceApi
29
29
  from lightning_sdk.lightning_cloud.openapi.api.billing_service_api import BillingServiceApi
30
+ from lightning_sdk.lightning_cloud.openapi.api.blog_posts_service_api import BlogPostsServiceApi
30
31
  from lightning_sdk.lightning_cloud.openapi.api.cloud_space_environment_template_service_api import CloudSpaceEnvironmentTemplateServiceApi
31
32
  from lightning_sdk.lightning_cloud.openapi.api.cloud_space_service_api import CloudSpaceServiceApi
32
33
  from lightning_sdk.lightning_cloud.openapi.api.cluster_service_api import ClusterServiceApi
@@ -79,6 +80,7 @@ from lightning_sdk.lightning_cloud.openapi.models.assistant_id_conversations_bod
79
80
  from lightning_sdk.lightning_cloud.openapi.models.billing_checkout_body import BillingCheckoutBody
80
81
  from lightning_sdk.lightning_cloud.openapi.models.billing_transfer_body import BillingTransferBody
81
82
  from lightning_sdk.lightning_cloud.openapi.models.billing_transfer_body1 import BillingTransferBody1
83
+ from lightning_sdk.lightning_cloud.openapi.models.blogposts_id_body import BlogpostsIdBody
82
84
  from lightning_sdk.lightning_cloud.openapi.models.captures_id_body import CapturesIdBody
83
85
  from lightning_sdk.lightning_cloud.openapi.models.cloud_space_id_versionpublications_body import CloudSpaceIdVersionpublicationsBody
84
86
  from lightning_sdk.lightning_cloud.openapi.models.cloud_space_id_versionpublications_body1 import CloudSpaceIdVersionpublicationsBody1
@@ -142,6 +144,7 @@ from lightning_sdk.lightning_cloud.openapi.models.id_reportlogsactivity_body imp
142
144
  from lightning_sdk.lightning_cloud.openapi.models.id_reportrestarttimings_body import IdReportrestarttimingsBody
143
145
  from lightning_sdk.lightning_cloud.openapi.models.id_start_body import IdStartBody
144
146
  from lightning_sdk.lightning_cloud.openapi.models.id_storage_body import IdStorageBody
147
+ from lightning_sdk.lightning_cloud.openapi.models.id_transfer_body import IdTransferBody
145
148
  from lightning_sdk.lightning_cloud.openapi.models.id_uploads_body import IdUploadsBody
146
149
  from lightning_sdk.lightning_cloud.openapi.models.id_uploads_body1 import IdUploadsBody1
147
150
  from lightning_sdk.lightning_cloud.openapi.models.id_visibility_body import IdVisibilityBody
@@ -263,6 +266,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_billing_feature import V1Bi
263
266
  from lightning_sdk.lightning_cloud.openapi.models.v1_billing_period import V1BillingPeriod
264
267
  from lightning_sdk.lightning_cloud.openapi.models.v1_billing_subscription import V1BillingSubscription
265
268
  from lightning_sdk.lightning_cloud.openapi.models.v1_billing_tier import V1BillingTier
269
+ from lightning_sdk.lightning_cloud.openapi.models.v1_blog_post import V1BlogPost
266
270
  from lightning_sdk.lightning_cloud.openapi.models.v1_body import V1Body
267
271
  from lightning_sdk.lightning_cloud.openapi.models.v1_build_spec import V1BuildSpec
268
272
  from lightning_sdk.lightning_cloud.openapi.models.v1_cpu_system_metrics import V1CPUSystemMetrics
@@ -342,6 +346,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_count_metrics_streams_respo
342
346
  from lightning_sdk.lightning_cloud.openapi.models.v1_create_agent_multipart_upload_response import V1CreateAgentMultipartUploadResponse
343
347
  from lightning_sdk.lightning_cloud.openapi.models.v1_create_billing_portal_session_request import V1CreateBillingPortalSessionRequest
344
348
  from lightning_sdk.lightning_cloud.openapi.models.v1_create_billing_portal_session_response import V1CreateBillingPortalSessionResponse
349
+ from lightning_sdk.lightning_cloud.openapi.models.v1_create_blog_post_request import V1CreateBlogPostRequest
345
350
  from lightning_sdk.lightning_cloud.openapi.models.v1_create_checkout_session_request import V1CreateCheckoutSessionRequest
346
351
  from lightning_sdk.lightning_cloud.openapi.models.v1_create_checkout_session_response import V1CreateCheckoutSessionResponse
347
352
  from lightning_sdk.lightning_cloud.openapi.models.v1_create_cloud_space_app_instance_response import V1CreateCloudSpaceAppInstanceResponse
@@ -383,6 +388,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_dataset import V1Dataset
383
388
  from lightning_sdk.lightning_cloud.openapi.models.v1_dataset_type import V1DatasetType
384
389
  from lightning_sdk.lightning_cloud.openapi.models.v1_delete_affiliate_link_response import V1DeleteAffiliateLinkResponse
385
390
  from lightning_sdk.lightning_cloud.openapi.models.v1_delete_assistant_response import V1DeleteAssistantResponse
391
+ from lightning_sdk.lightning_cloud.openapi.models.v1_delete_blog_post_response import V1DeleteBlogPostResponse
386
392
  from lightning_sdk.lightning_cloud.openapi.models.v1_delete_cloud_space_app_response import V1DeleteCloudSpaceAppResponse
387
393
  from lightning_sdk.lightning_cloud.openapi.models.v1_delete_cloud_space_environment_template_response import V1DeleteCloudSpaceEnvironmentTemplateResponse
388
394
  from lightning_sdk.lightning_cloud.openapi.models.v1_delete_cloud_space_response import V1DeleteCloudSpaceResponse
@@ -610,6 +616,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_list_affiliate_links_respon
610
616
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_agent_job_artifacts_response import V1ListAgentJobArtifactsResponse
611
617
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_agent_jobs_response import V1ListAgentJobsResponse
612
618
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_assistants_response import V1ListAssistantsResponse
619
+ from lightning_sdk.lightning_cloud.openapi.models.v1_list_blog_posts_response import V1ListBlogPostsResponse
613
620
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_cloud_space_apps_response import V1ListCloudSpaceAppsResponse
614
621
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_cloud_space_cold_start_metrics_response import V1ListCloudSpaceColdStartMetricsResponse
615
622
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_cloud_space_environment_templates_response import V1ListCloudSpaceEnvironmentTemplatesResponse
@@ -892,6 +899,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_system_metrics_list import
892
899
  from lightning_sdk.lightning_cloud.openapi.models.v1_telemetry import V1Telemetry
893
900
  from lightning_sdk.lightning_cloud.openapi.models.v1_timestamp_code_telemetry import V1TimestampCodeTelemetry
894
901
  from lightning_sdk.lightning_cloud.openapi.models.v1_transaction import V1Transaction
902
+ from lightning_sdk.lightning_cloud.openapi.models.v1_transfer_cloud_space_response import V1TransferCloudSpaceResponse
895
903
  from lightning_sdk.lightning_cloud.openapi.models.v1_transfer_org_balance_response import V1TransferOrgBalanceResponse
896
904
  from lightning_sdk.lightning_cloud.openapi.models.v1_transfer_project_balance_response import V1TransferProjectBalanceResponse
897
905
  from lightning_sdk.lightning_cloud.openapi.models.v1_transfer_user_balance_request import V1TransferUserBalanceRequest
@@ -8,6 +8,7 @@ from lightning_sdk.lightning_cloud.openapi.api.analytics_service_api import Anal
8
8
  from lightning_sdk.lightning_cloud.openapi.api.assistants_service_api import AssistantsServiceApi
9
9
  from lightning_sdk.lightning_cloud.openapi.api.auth_service_api import AuthServiceApi
10
10
  from lightning_sdk.lightning_cloud.openapi.api.billing_service_api import BillingServiceApi
11
+ from lightning_sdk.lightning_cloud.openapi.api.blog_posts_service_api import BlogPostsServiceApi
11
12
  from lightning_sdk.lightning_cloud.openapi.api.cloud_space_environment_template_service_api import CloudSpaceEnvironmentTemplateServiceApi
12
13
  from lightning_sdk.lightning_cloud.openapi.api.cloud_space_service_api import CloudSpaceServiceApi
13
14
  from lightning_sdk.lightning_cloud.openapi.api.cluster_service_api import ClusterServiceApi
@@ -0,0 +1,533 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ external/v1/auth_service.proto
5
+
6
+ No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7
+
8
+ OpenAPI spec version: version not set
9
+
10
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
11
+
12
+ NOTE
13
+ ----
14
+ standard swagger-codegen-cli for this python client has been modified
15
+ by custom templates. The purpose of these templates is to include
16
+ typing information in the API and Model code. Please refer to the
17
+ main grid repository for more info
18
+ """
19
+
20
+ from __future__ import absolute_import
21
+
22
+ import re # noqa: F401
23
+ from typing import TYPE_CHECKING, Any
24
+
25
+ # python 2 and python 3 compatibility library
26
+ import six
27
+
28
+ from lightning_sdk.lightning_cloud.openapi.api_client import ApiClient
29
+
30
+ if TYPE_CHECKING:
31
+ from datetime import datetime
32
+ from lightning_sdk.lightning_cloud.openapi.models import *
33
+
34
+ class BlogPostsServiceApi(object):
35
+ """NOTE: This class is auto generated by the swagger code generator program.
36
+
37
+ Do not edit the class manually.
38
+ Ref: https://github.com/swagger-api/swagger-codegen
39
+ """
40
+
41
+ def __init__(self, api_client=None):
42
+ if api_client is None:
43
+ api_client = ApiClient()
44
+ self.api_client = api_client
45
+
46
+ def blog_posts_service_create_blog_post(self, body: 'V1CreateBlogPostRequest', **kwargs) -> 'V1BlogPost': # noqa: E501
47
+ """blog_posts_service_create_blog_post # noqa: E501
48
+
49
+ This method makes a synchronous HTTP request by default. To make an
50
+ asynchronous HTTP request, please pass async_req=True
51
+ >>> thread = api.blog_posts_service_create_blog_post(body, async_req=True)
52
+ >>> result = thread.get()
53
+
54
+ :param async_req bool
55
+ :param V1CreateBlogPostRequest body: (required)
56
+ :return: V1BlogPost
57
+ If the method is called asynchronously,
58
+ returns the request thread.
59
+ """
60
+ kwargs['_return_http_data_only'] = True
61
+ if kwargs.get('async_req'):
62
+ return self.blog_posts_service_create_blog_post_with_http_info(body, **kwargs) # noqa: E501
63
+ else:
64
+ (data) = self.blog_posts_service_create_blog_post_with_http_info(body, **kwargs) # noqa: E501
65
+ return data
66
+
67
+ def blog_posts_service_create_blog_post_with_http_info(self, body: 'V1CreateBlogPostRequest', **kwargs) -> 'V1BlogPost': # noqa: E501
68
+ """blog_posts_service_create_blog_post # noqa: E501
69
+
70
+ This method makes a synchronous HTTP request by default. To make an
71
+ asynchronous HTTP request, please pass async_req=True
72
+ >>> thread = api.blog_posts_service_create_blog_post_with_http_info(body, async_req=True)
73
+ >>> result = thread.get()
74
+
75
+ :param async_req bool
76
+ :param V1CreateBlogPostRequest body: (required)
77
+ :return: V1BlogPost
78
+ If the method is called asynchronously,
79
+ returns the request thread.
80
+ """
81
+
82
+ all_params = ['body'] # noqa: E501
83
+ all_params.append('async_req')
84
+ all_params.append('_return_http_data_only')
85
+ all_params.append('_preload_content')
86
+ all_params.append('_request_timeout')
87
+
88
+ params = locals()
89
+ for key, val in six.iteritems(params['kwargs']):
90
+ if key not in all_params:
91
+ raise TypeError(
92
+ "Got an unexpected keyword argument '%s'"
93
+ " to method blog_posts_service_create_blog_post" % key
94
+ )
95
+ params[key] = val
96
+ del params['kwargs']
97
+ # verify the required parameter 'body' is set
98
+ if ('body' not in params or
99
+ params['body'] is None):
100
+ raise ValueError("Missing the required parameter `body` when calling `blog_posts_service_create_blog_post`") # noqa: E501
101
+
102
+ collection_formats = {}
103
+
104
+ path_params = {}
105
+
106
+ query_params = []
107
+
108
+ header_params = {}
109
+
110
+ form_params = []
111
+ local_var_files = {}
112
+
113
+ body_params = None
114
+ if 'body' in params:
115
+ body_params = params['body']
116
+ # HTTP header `Accept`
117
+ header_params['Accept'] = self.api_client.select_header_accept(
118
+ ['application/json']) # noqa: E501
119
+
120
+ # HTTP header `Content-Type`
121
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
122
+ ['application/json']) # noqa: E501
123
+
124
+ # Authentication setting
125
+ auth_settings = [] # noqa: E501
126
+
127
+ return self.api_client.call_api(
128
+ '/v1/blog-posts', 'POST',
129
+ path_params,
130
+ query_params,
131
+ header_params,
132
+ body=body_params,
133
+ post_params=form_params,
134
+ files=local_var_files,
135
+ response_type='V1BlogPost', # noqa: E501
136
+ auth_settings=auth_settings,
137
+ async_req=params.get('async_req'),
138
+ _return_http_data_only=params.get('_return_http_data_only'),
139
+ _preload_content=params.get('_preload_content', True),
140
+ _request_timeout=params.get('_request_timeout'),
141
+ collection_formats=collection_formats)
142
+
143
+ def blog_posts_service_delete_blog_post(self, id: 'str', **kwargs) -> 'V1DeleteBlogPostResponse': # noqa: E501
144
+ """blog_posts_service_delete_blog_post # noqa: E501
145
+
146
+ This method makes a synchronous HTTP request by default. To make an
147
+ asynchronous HTTP request, please pass async_req=True
148
+ >>> thread = api.blog_posts_service_delete_blog_post(id, async_req=True)
149
+ >>> result = thread.get()
150
+
151
+ :param async_req bool
152
+ :param str id: (required)
153
+ :return: V1DeleteBlogPostResponse
154
+ If the method is called asynchronously,
155
+ returns the request thread.
156
+ """
157
+ kwargs['_return_http_data_only'] = True
158
+ if kwargs.get('async_req'):
159
+ return self.blog_posts_service_delete_blog_post_with_http_info(id, **kwargs) # noqa: E501
160
+ else:
161
+ (data) = self.blog_posts_service_delete_blog_post_with_http_info(id, **kwargs) # noqa: E501
162
+ return data
163
+
164
+ def blog_posts_service_delete_blog_post_with_http_info(self, id: 'str', **kwargs) -> 'V1DeleteBlogPostResponse': # noqa: E501
165
+ """blog_posts_service_delete_blog_post # noqa: E501
166
+
167
+ This method makes a synchronous HTTP request by default. To make an
168
+ asynchronous HTTP request, please pass async_req=True
169
+ >>> thread = api.blog_posts_service_delete_blog_post_with_http_info(id, async_req=True)
170
+ >>> result = thread.get()
171
+
172
+ :param async_req bool
173
+ :param str id: (required)
174
+ :return: V1DeleteBlogPostResponse
175
+ If the method is called asynchronously,
176
+ returns the request thread.
177
+ """
178
+
179
+ all_params = ['id'] # noqa: E501
180
+ all_params.append('async_req')
181
+ all_params.append('_return_http_data_only')
182
+ all_params.append('_preload_content')
183
+ all_params.append('_request_timeout')
184
+
185
+ params = locals()
186
+ for key, val in six.iteritems(params['kwargs']):
187
+ if key not in all_params:
188
+ raise TypeError(
189
+ "Got an unexpected keyword argument '%s'"
190
+ " to method blog_posts_service_delete_blog_post" % key
191
+ )
192
+ params[key] = val
193
+ del params['kwargs']
194
+ # verify the required parameter 'id' is set
195
+ if ('id' not in params or
196
+ params['id'] is None):
197
+ raise ValueError("Missing the required parameter `id` when calling `blog_posts_service_delete_blog_post`") # noqa: E501
198
+
199
+ collection_formats = {}
200
+
201
+ path_params = {}
202
+ if 'id' in params:
203
+ path_params['id'] = params['id'] # noqa: E501
204
+
205
+ query_params = []
206
+
207
+ header_params = {}
208
+
209
+ form_params = []
210
+ local_var_files = {}
211
+
212
+ body_params = None
213
+ # HTTP header `Accept`
214
+ header_params['Accept'] = self.api_client.select_header_accept(
215
+ ['application/json']) # noqa: E501
216
+
217
+ # Authentication setting
218
+ auth_settings = [] # noqa: E501
219
+
220
+ return self.api_client.call_api(
221
+ '/v1/blog-posts/{id}', 'DELETE',
222
+ path_params,
223
+ query_params,
224
+ header_params,
225
+ body=body_params,
226
+ post_params=form_params,
227
+ files=local_var_files,
228
+ response_type='V1DeleteBlogPostResponse', # noqa: E501
229
+ auth_settings=auth_settings,
230
+ async_req=params.get('async_req'),
231
+ _return_http_data_only=params.get('_return_http_data_only'),
232
+ _preload_content=params.get('_preload_content', True),
233
+ _request_timeout=params.get('_request_timeout'),
234
+ collection_formats=collection_formats)
235
+
236
+ def blog_posts_service_get_blog_post(self, id: 'str', **kwargs) -> 'V1BlogPost': # noqa: E501
237
+ """blog_posts_service_get_blog_post # noqa: E501
238
+
239
+ This method makes a synchronous HTTP request by default. To make an
240
+ asynchronous HTTP request, please pass async_req=True
241
+ >>> thread = api.blog_posts_service_get_blog_post(id, async_req=True)
242
+ >>> result = thread.get()
243
+
244
+ :param async_req bool
245
+ :param str id: (required)
246
+ :return: V1BlogPost
247
+ If the method is called asynchronously,
248
+ returns the request thread.
249
+ """
250
+ kwargs['_return_http_data_only'] = True
251
+ if kwargs.get('async_req'):
252
+ return self.blog_posts_service_get_blog_post_with_http_info(id, **kwargs) # noqa: E501
253
+ else:
254
+ (data) = self.blog_posts_service_get_blog_post_with_http_info(id, **kwargs) # noqa: E501
255
+ return data
256
+
257
+ def blog_posts_service_get_blog_post_with_http_info(self, id: 'str', **kwargs) -> 'V1BlogPost': # noqa: E501
258
+ """blog_posts_service_get_blog_post # noqa: E501
259
+
260
+ This method makes a synchronous HTTP request by default. To make an
261
+ asynchronous HTTP request, please pass async_req=True
262
+ >>> thread = api.blog_posts_service_get_blog_post_with_http_info(id, async_req=True)
263
+ >>> result = thread.get()
264
+
265
+ :param async_req bool
266
+ :param str id: (required)
267
+ :return: V1BlogPost
268
+ If the method is called asynchronously,
269
+ returns the request thread.
270
+ """
271
+
272
+ all_params = ['id'] # noqa: E501
273
+ all_params.append('async_req')
274
+ all_params.append('_return_http_data_only')
275
+ all_params.append('_preload_content')
276
+ all_params.append('_request_timeout')
277
+
278
+ params = locals()
279
+ for key, val in six.iteritems(params['kwargs']):
280
+ if key not in all_params:
281
+ raise TypeError(
282
+ "Got an unexpected keyword argument '%s'"
283
+ " to method blog_posts_service_get_blog_post" % key
284
+ )
285
+ params[key] = val
286
+ del params['kwargs']
287
+ # verify the required parameter 'id' is set
288
+ if ('id' not in params or
289
+ params['id'] is None):
290
+ raise ValueError("Missing the required parameter `id` when calling `blog_posts_service_get_blog_post`") # noqa: E501
291
+
292
+ collection_formats = {}
293
+
294
+ path_params = {}
295
+ if 'id' in params:
296
+ path_params['id'] = params['id'] # noqa: E501
297
+
298
+ query_params = []
299
+
300
+ header_params = {}
301
+
302
+ form_params = []
303
+ local_var_files = {}
304
+
305
+ body_params = None
306
+ # HTTP header `Accept`
307
+ header_params['Accept'] = self.api_client.select_header_accept(
308
+ ['application/json']) # noqa: E501
309
+
310
+ # Authentication setting
311
+ auth_settings = [] # noqa: E501
312
+
313
+ return self.api_client.call_api(
314
+ '/v1/blog-posts/{id}', 'GET',
315
+ path_params,
316
+ query_params,
317
+ header_params,
318
+ body=body_params,
319
+ post_params=form_params,
320
+ files=local_var_files,
321
+ response_type='V1BlogPost', # noqa: E501
322
+ auth_settings=auth_settings,
323
+ async_req=params.get('async_req'),
324
+ _return_http_data_only=params.get('_return_http_data_only'),
325
+ _preload_content=params.get('_preload_content', True),
326
+ _request_timeout=params.get('_request_timeout'),
327
+ collection_formats=collection_formats)
328
+
329
+ def blog_posts_service_list_blog_posts(self, **kwargs) -> 'V1ListBlogPostsResponse': # noqa: E501
330
+ """blog_posts_service_list_blog_posts # noqa: E501
331
+
332
+ This method makes a synchronous HTTP request by default. To make an
333
+ asynchronous HTTP request, please pass async_req=True
334
+ >>> thread = api.blog_posts_service_list_blog_posts(async_req=True)
335
+ >>> result = thread.get()
336
+
337
+ :param async_req bool
338
+ :param str category:
339
+ :param str page_token:
340
+ :param str limit:
341
+ :param bool include_unpublished:
342
+ :return: V1ListBlogPostsResponse
343
+ If the method is called asynchronously,
344
+ returns the request thread.
345
+ """
346
+ kwargs['_return_http_data_only'] = True
347
+ if kwargs.get('async_req'):
348
+ return self.blog_posts_service_list_blog_posts_with_http_info(**kwargs) # noqa: E501
349
+ else:
350
+ (data) = self.blog_posts_service_list_blog_posts_with_http_info(**kwargs) # noqa: E501
351
+ return data
352
+
353
+ def blog_posts_service_list_blog_posts_with_http_info(self, **kwargs) -> 'V1ListBlogPostsResponse': # noqa: E501
354
+ """blog_posts_service_list_blog_posts # noqa: E501
355
+
356
+ This method makes a synchronous HTTP request by default. To make an
357
+ asynchronous HTTP request, please pass async_req=True
358
+ >>> thread = api.blog_posts_service_list_blog_posts_with_http_info(async_req=True)
359
+ >>> result = thread.get()
360
+
361
+ :param async_req bool
362
+ :param str category:
363
+ :param str page_token:
364
+ :param str limit:
365
+ :param bool include_unpublished:
366
+ :return: V1ListBlogPostsResponse
367
+ If the method is called asynchronously,
368
+ returns the request thread.
369
+ """
370
+
371
+ all_params = ['category', 'page_token', 'limit', 'include_unpublished'] # noqa: E501
372
+ all_params.append('async_req')
373
+ all_params.append('_return_http_data_only')
374
+ all_params.append('_preload_content')
375
+ all_params.append('_request_timeout')
376
+
377
+ params = locals()
378
+ for key, val in six.iteritems(params['kwargs']):
379
+ if key not in all_params:
380
+ raise TypeError(
381
+ "Got an unexpected keyword argument '%s'"
382
+ " to method blog_posts_service_list_blog_posts" % key
383
+ )
384
+ params[key] = val
385
+ del params['kwargs']
386
+
387
+ collection_formats = {}
388
+
389
+ path_params = {}
390
+
391
+ query_params = []
392
+ if 'category' in params:
393
+ query_params.append(('category', params['category'])) # noqa: E501
394
+ if 'page_token' in params:
395
+ query_params.append(('pageToken', params['page_token'])) # noqa: E501
396
+ if 'limit' in params:
397
+ query_params.append(('limit', params['limit'])) # noqa: E501
398
+ if 'include_unpublished' in params:
399
+ query_params.append(('includeUnpublished', params['include_unpublished'])) # noqa: E501
400
+
401
+ header_params = {}
402
+
403
+ form_params = []
404
+ local_var_files = {}
405
+
406
+ body_params = None
407
+ # HTTP header `Accept`
408
+ header_params['Accept'] = self.api_client.select_header_accept(
409
+ ['application/json']) # noqa: E501
410
+
411
+ # Authentication setting
412
+ auth_settings = [] # noqa: E501
413
+
414
+ return self.api_client.call_api(
415
+ '/v1/blog-posts', 'GET',
416
+ path_params,
417
+ query_params,
418
+ header_params,
419
+ body=body_params,
420
+ post_params=form_params,
421
+ files=local_var_files,
422
+ response_type='V1ListBlogPostsResponse', # noqa: E501
423
+ auth_settings=auth_settings,
424
+ async_req=params.get('async_req'),
425
+ _return_http_data_only=params.get('_return_http_data_only'),
426
+ _preload_content=params.get('_preload_content', True),
427
+ _request_timeout=params.get('_request_timeout'),
428
+ collection_formats=collection_formats)
429
+
430
+ def blog_posts_service_update_blog_post(self, body: 'BlogpostsIdBody', id: 'str', **kwargs) -> 'V1BlogPost': # noqa: E501
431
+ """blog_posts_service_update_blog_post # noqa: E501
432
+
433
+ This method makes a synchronous HTTP request by default. To make an
434
+ asynchronous HTTP request, please pass async_req=True
435
+ >>> thread = api.blog_posts_service_update_blog_post(body, id, async_req=True)
436
+ >>> result = thread.get()
437
+
438
+ :param async_req bool
439
+ :param BlogpostsIdBody body: (required)
440
+ :param str id: (required)
441
+ :return: V1BlogPost
442
+ If the method is called asynchronously,
443
+ returns the request thread.
444
+ """
445
+ kwargs['_return_http_data_only'] = True
446
+ if kwargs.get('async_req'):
447
+ return self.blog_posts_service_update_blog_post_with_http_info(body, id, **kwargs) # noqa: E501
448
+ else:
449
+ (data) = self.blog_posts_service_update_blog_post_with_http_info(body, id, **kwargs) # noqa: E501
450
+ return data
451
+
452
+ def blog_posts_service_update_blog_post_with_http_info(self, body: 'BlogpostsIdBody', id: 'str', **kwargs) -> 'V1BlogPost': # noqa: E501
453
+ """blog_posts_service_update_blog_post # noqa: E501
454
+
455
+ This method makes a synchronous HTTP request by default. To make an
456
+ asynchronous HTTP request, please pass async_req=True
457
+ >>> thread = api.blog_posts_service_update_blog_post_with_http_info(body, id, async_req=True)
458
+ >>> result = thread.get()
459
+
460
+ :param async_req bool
461
+ :param BlogpostsIdBody body: (required)
462
+ :param str id: (required)
463
+ :return: V1BlogPost
464
+ If the method is called asynchronously,
465
+ returns the request thread.
466
+ """
467
+
468
+ all_params = ['body', 'id'] # noqa: E501
469
+ all_params.append('async_req')
470
+ all_params.append('_return_http_data_only')
471
+ all_params.append('_preload_content')
472
+ all_params.append('_request_timeout')
473
+
474
+ params = locals()
475
+ for key, val in six.iteritems(params['kwargs']):
476
+ if key not in all_params:
477
+ raise TypeError(
478
+ "Got an unexpected keyword argument '%s'"
479
+ " to method blog_posts_service_update_blog_post" % key
480
+ )
481
+ params[key] = val
482
+ del params['kwargs']
483
+ # verify the required parameter 'body' is set
484
+ if ('body' not in params or
485
+ params['body'] is None):
486
+ raise ValueError("Missing the required parameter `body` when calling `blog_posts_service_update_blog_post`") # noqa: E501
487
+ # verify the required parameter 'id' is set
488
+ if ('id' not in params or
489
+ params['id'] is None):
490
+ raise ValueError("Missing the required parameter `id` when calling `blog_posts_service_update_blog_post`") # noqa: E501
491
+
492
+ collection_formats = {}
493
+
494
+ path_params = {}
495
+ if 'id' in params:
496
+ path_params['id'] = params['id'] # noqa: E501
497
+
498
+ query_params = []
499
+
500
+ header_params = {}
501
+
502
+ form_params = []
503
+ local_var_files = {}
504
+
505
+ body_params = None
506
+ if 'body' in params:
507
+ body_params = params['body']
508
+ # HTTP header `Accept`
509
+ header_params['Accept'] = self.api_client.select_header_accept(
510
+ ['application/json']) # noqa: E501
511
+
512
+ # HTTP header `Content-Type`
513
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
514
+ ['application/json']) # noqa: E501
515
+
516
+ # Authentication setting
517
+ auth_settings = [] # noqa: E501
518
+
519
+ return self.api_client.call_api(
520
+ '/v1/blog-posts/{id}', 'PUT',
521
+ path_params,
522
+ query_params,
523
+ header_params,
524
+ body=body_params,
525
+ post_params=form_params,
526
+ files=local_var_files,
527
+ response_type='V1BlogPost', # noqa: E501
528
+ auth_settings=auth_settings,
529
+ async_req=params.get('async_req'),
530
+ _return_http_data_only=params.get('_return_http_data_only'),
531
+ _preload_content=params.get('_preload_content', True),
532
+ _request_timeout=params.get('_request_timeout'),
533
+ collection_formats=collection_formats)