shaped 2.0.1__py3-none-any.whl → 2.0.4__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 (341) hide show
  1. shaped/__init__.py +59 -4
  2. shaped/autogen/__init__.py +527 -66
  3. shaped/autogen/api/__init__.py +4 -3
  4. shaped/autogen/api/engine_api.py +1467 -0
  5. shaped/autogen/api/{dataset_api.py → query_api.py} +159 -194
  6. shaped/autogen/api/table_api.py +1494 -0
  7. shaped/autogen/api/{model_management_api.py → view_api.py} +179 -181
  8. shaped/autogen/api_client.py +18 -11
  9. shaped/autogen/configuration.py +22 -9
  10. shaped/autogen/exceptions.py +25 -5
  11. shaped/autogen/models/__init__.py +247 -52
  12. shaped/autogen/models/ai_enrichment_view_config.py +123 -0
  13. shaped/autogen/models/{path.py → algorithm.py} +19 -19
  14. shaped/autogen/models/amplitude_table_config.py +106 -0
  15. shaped/autogen/models/ascending.py +148 -0
  16. shaped/autogen/models/attn_dropout_prob.py +136 -0
  17. shaped/autogen/models/attribute_journey.py +124 -0
  18. shaped/autogen/models/attribute_value.py +178 -0
  19. shaped/autogen/models/autoscaling_config.py +95 -0
  20. shaped/autogen/models/aws_pinpoint_table_config.py +108 -0
  21. shaped/autogen/models/batch_size.py +136 -0
  22. shaped/autogen/models/batch_size1.py +136 -0
  23. shaped/autogen/models/batch_size2.py +136 -0
  24. shaped/autogen/models/big_query_table_config.py +147 -0
  25. shaped/autogen/models/bm25.py +136 -0
  26. shaped/autogen/models/boosted_reorder_step.py +125 -0
  27. shaped/autogen/models/canary_rollout.py +99 -0
  28. shaped/autogen/models/candidate_attributes_retrieve_step.py +113 -0
  29. shaped/autogen/models/candidate_ids_retrieve_step.py +113 -0
  30. shaped/autogen/models/candidate_retrieval_strategy.py +41 -0
  31. shaped/autogen/models/clickhouse_table_config.py +146 -0
  32. shaped/autogen/models/column_order_retrieve_step.py +123 -0
  33. shaped/autogen/models/column_ordering.py +91 -0
  34. shaped/autogen/models/create_table_response.py +87 -0
  35. shaped/autogen/models/create_view_response.py +87 -0
  36. shaped/autogen/models/custom_table_config.py +135 -0
  37. shaped/autogen/models/data_compute_config.py +89 -0
  38. shaped/autogen/models/data_config.py +145 -0
  39. shaped/autogen/models/data_config_interaction_table.py +146 -0
  40. shaped/autogen/models/data_split_config.py +88 -0
  41. shaped/autogen/models/data_split_strategy.py +37 -0
  42. shaped/autogen/models/data_tier.py +37 -0
  43. shaped/autogen/models/default.py +246 -0
  44. shaped/autogen/models/delete_engine_response.py +87 -0
  45. shaped/autogen/models/delete_table_response.py +87 -0
  46. shaped/autogen/models/delete_view_response.py +87 -0
  47. shaped/autogen/models/deployment_config.py +117 -0
  48. shaped/autogen/models/distance_function.py +38 -0
  49. shaped/autogen/models/diversity_reorder_step.py +137 -0
  50. shaped/autogen/models/dropout_rate.py +136 -0
  51. shaped/autogen/models/dynamo_db_table_config.py +160 -0
  52. shaped/autogen/models/dynamo_db_table_config_scan_kwargs_value.py +138 -0
  53. shaped/autogen/models/embedder_batch_size.py +136 -0
  54. shaped/autogen/models/embedding_config.py +93 -0
  55. shaped/autogen/models/embedding_dim.py +136 -0
  56. shaped/autogen/models/embedding_dims.py +136 -0
  57. shaped/autogen/models/embedding_size.py +136 -0
  58. shaped/autogen/models/encoder.py +140 -0
  59. shaped/autogen/models/encoding_pooling_strategy.py +38 -0
  60. shaped/autogen/models/engine.py +109 -0
  61. shaped/autogen/models/engine_config_v2.py +152 -0
  62. shaped/autogen/models/engine_details_response.py +120 -0
  63. shaped/autogen/models/engine_schema.py +113 -0
  64. shaped/autogen/models/engine_schema_user_inner.py +146 -0
  65. shaped/autogen/models/entity_config.py +109 -0
  66. shaped/autogen/models/entity_journey.py +161 -0
  67. shaped/autogen/models/entity_type.py +38 -0
  68. shaped/autogen/models/evaluation_config.py +92 -0
  69. shaped/autogen/models/exploration_reorder_step.py +125 -0
  70. shaped/autogen/models/expression_filter_step.py +106 -0
  71. shaped/autogen/models/factors.py +136 -0
  72. shaped/autogen/models/factors1.py +136 -0
  73. shaped/autogen/models/feature.py +90 -0
  74. shaped/autogen/models/feature_type.py +60 -0
  75. shaped/autogen/models/file_table_config.py +112 -0
  76. shaped/autogen/models/filter_config.py +99 -0
  77. shaped/autogen/models/filter_dataset.py +164 -0
  78. shaped/autogen/models/filter_index_type.py +36 -0
  79. shaped/autogen/models/filter_retrieve_step.py +113 -0
  80. shaped/autogen/models/filter_step_explanation.py +165 -0
  81. shaped/autogen/models/filter_table.py +140 -0
  82. shaped/autogen/models/filter_type.py +134 -0
  83. shaped/autogen/models/global_filter.py +102 -0
  84. shaped/autogen/models/hidden_dropout_prob.py +136 -0
  85. shaped/autogen/models/hidden_size.py +136 -0
  86. shaped/autogen/models/hidden_size1.py +136 -0
  87. shaped/autogen/models/http_problem_response.py +115 -0
  88. shaped/autogen/models/http_validation_error.py +2 -2
  89. shaped/autogen/models/hugging_face_encoder.py +115 -0
  90. shaped/autogen/models/iceberg_table_config.py +154 -0
  91. shaped/autogen/models/index_config.py +101 -0
  92. shaped/autogen/models/inner_entity_id.py +144 -0
  93. shaped/autogen/models/inner_size.py +136 -0
  94. shaped/autogen/models/inner_size1.py +136 -0
  95. shaped/autogen/models/inner_uid.py +144 -0
  96. shaped/autogen/models/interaction_config.py +122 -0
  97. shaped/autogen/models/interaction_pooling_encoder.py +104 -0
  98. shaped/autogen/models/interaction_round_robin_encoder.py +104 -0
  99. shaped/autogen/models/item_attribute_pooling_encoder.py +111 -0
  100. shaped/autogen/models/journey.py +140 -0
  101. shaped/autogen/models/kafka_table_config.py +129 -0
  102. shaped/autogen/models/kinesis_table_config.py +140 -0
  103. shaped/autogen/models/kinesis_table_config_column_schema_value.py +136 -0
  104. shaped/autogen/models/label.py +90 -0
  105. shaped/autogen/models/label_type.py +36 -0
  106. shaped/autogen/models/laplace_smoothing.py +136 -0
  107. shaped/autogen/models/latency_scaling_policy.py +112 -0
  108. shaped/autogen/models/learning_rate.py +136 -0
  109. shaped/autogen/models/learning_rate1.py +136 -0
  110. shaped/autogen/models/learning_rate2.py +136 -0
  111. shaped/autogen/models/learning_rate3.py +136 -0
  112. shaped/autogen/models/lexical_search_mode.py +99 -0
  113. shaped/autogen/models/list_engines_response.py +95 -0
  114. shaped/autogen/models/list_tables_response.py +95 -0
  115. shaped/autogen/models/list_views_response.py +95 -0
  116. shaped/autogen/models/location_inner.py +138 -0
  117. shaped/autogen/models/loss_types.py +37 -0
  118. shaped/autogen/models/lr.py +136 -0
  119. shaped/autogen/models/lr1.py +136 -0
  120. shaped/autogen/models/lr2.py +136 -0
  121. shaped/autogen/models/max_depth.py +136 -0
  122. shaped/autogen/models/max_leaves.py +136 -0
  123. shaped/autogen/models/max_seq_length.py +136 -0
  124. shaped/autogen/models/max_seq_length1.py +136 -0
  125. shaped/autogen/models/max_seq_length2.py +136 -0
  126. shaped/autogen/models/mode.py +134 -0
  127. shaped/autogen/models/mode1.py +136 -0
  128. shaped/autogen/models/mode2.py +150 -0
  129. shaped/autogen/models/models_inner.py +308 -0
  130. shaped/autogen/models/mongo_db_table_config.py +147 -0
  131. shaped/autogen/models/mssql_table_config.py +155 -0
  132. shaped/autogen/models/{my_sql_dataset_config.py → my_sql_table_config.py} +45 -28
  133. shaped/autogen/models/n_epochs.py +136 -0
  134. shaped/autogen/models/n_epochs1.py +136 -0
  135. shaped/autogen/models/n_epochs2.py +136 -0
  136. shaped/autogen/models/n_estimators.py +136 -0
  137. shaped/autogen/models/n_heads.py +136 -0
  138. shaped/autogen/models/n_layers.py +136 -0
  139. shaped/autogen/models/neg_per_positive.py +136 -0
  140. shaped/autogen/models/negative_samples_count.py +136 -0
  141. shaped/autogen/models/ngram_tokenizer.py +103 -0
  142. shaped/autogen/models/no_op_config.py +117 -0
  143. shaped/autogen/models/num_blocks.py +136 -0
  144. shaped/autogen/models/num_heads.py +136 -0
  145. shaped/autogen/models/num_leaves.py +136 -0
  146. shaped/autogen/models/objective.py +40 -0
  147. shaped/autogen/models/objective1.py +134 -0
  148. shaped/autogen/models/online_store_config.py +89 -0
  149. shaped/autogen/models/pagination_config.py +87 -0
  150. shaped/autogen/models/parameter_definition.py +96 -0
  151. shaped/autogen/models/parameters_value.py +240 -0
  152. shaped/autogen/models/passthrough_score.py +104 -0
  153. shaped/autogen/models/personal_filter.py +104 -0
  154. shaped/autogen/models/pipeline_stage_explanation.py +118 -0
  155. shaped/autogen/models/policy.py +134 -0
  156. shaped/autogen/models/pool_fn.py +152 -0
  157. shaped/autogen/models/pooling_function.py +37 -0
  158. shaped/autogen/models/{postgres_dataset_config.py → postgres_table_config.py} +66 -28
  159. shaped/autogen/models/posthog_table_config.py +133 -0
  160. shaped/autogen/models/prebuilt_filter_step.py +113 -0
  161. shaped/autogen/models/precomputed_item_embedding.py +99 -0
  162. shaped/autogen/models/precomputed_user_embedding.py +99 -0
  163. shaped/autogen/models/query.py +136 -0
  164. shaped/autogen/models/query1.py +136 -0
  165. shaped/autogen/models/query_any_of.py +172 -0
  166. shaped/autogen/models/query_config.py +140 -0
  167. shaped/autogen/models/query_definition.py +106 -0
  168. shaped/autogen/models/query_encoder.py +194 -0
  169. shaped/autogen/models/query_explanation.py +201 -0
  170. shaped/autogen/models/query_request.py +121 -0
  171. shaped/autogen/models/query_result.py +113 -0
  172. shaped/autogen/models/query_table_config.py +99 -0
  173. shaped/autogen/models/rank_item_attribute_values_query_config.py +122 -0
  174. shaped/autogen/models/rank_query_config.py +167 -0
  175. shaped/autogen/models/rank_query_config_filter_inner.py +149 -0
  176. shaped/autogen/models/rank_query_config_reorder_inner.py +186 -0
  177. shaped/autogen/models/rank_query_config_retrieve_inner.py +265 -0
  178. shaped/autogen/models/recreate_rollout.py +97 -0
  179. shaped/autogen/models/{redshift_dataset_config.py → redshift_table_config.py} +48 -25
  180. shaped/autogen/models/reference_table_config.py +113 -0
  181. shaped/autogen/models/regularization.py +136 -0
  182. shaped/autogen/models/reorder_inner.py +149 -0
  183. shaped/autogen/models/reorder_step_explanation.py +207 -0
  184. shaped/autogen/models/request.py +378 -0
  185. shaped/autogen/models/request1.py +140 -0
  186. shaped/autogen/models/requests_per_second_scaling_policy.py +112 -0
  187. shaped/autogen/models/resource_config.py +100 -0
  188. shaped/autogen/models/response_get_view_details_views_view_name_get.py +134 -0
  189. shaped/autogen/models/result.py +132 -0
  190. shaped/autogen/models/result_embeddings_value.py +127 -0
  191. shaped/autogen/models/retrieval_scores_value.py +127 -0
  192. shaped/autogen/models/retrieve_inner.py +196 -0
  193. shaped/autogen/models/retrieve_step_explanation.py +172 -0
  194. shaped/autogen/models/retriever.py +196 -0
  195. shaped/autogen/models/retriever1.py +196 -0
  196. shaped/autogen/models/rollout_config.py +91 -0
  197. shaped/autogen/models/rudderstack_table_config.py +106 -0
  198. shaped/autogen/models/sampling_strategy.py +36 -0
  199. shaped/autogen/models/saved_query_info_response.py +103 -0
  200. shaped/autogen/models/saved_query_list_response.py +87 -0
  201. shaped/autogen/models/saved_query_request.py +115 -0
  202. shaped/autogen/models/schema_config.py +117 -0
  203. shaped/autogen/models/score.py +134 -0
  204. shaped/autogen/models/score_ensemble.py +127 -0
  205. shaped/autogen/models/score_ensemble_policy_config.py +165 -0
  206. shaped/autogen/models/score_ensemble_policy_config_policies_inner.py +755 -0
  207. shaped/autogen/models/score_step_explanation.py +224 -0
  208. shaped/autogen/models/search_config.py +105 -0
  209. shaped/autogen/models/segment_table_config.py +106 -0
  210. shaped/autogen/models/sequence_length.py +136 -0
  211. shaped/autogen/models/server_config.py +100 -0
  212. shaped/autogen/models/setup_engine_response.py +87 -0
  213. shaped/autogen/models/shaped_internal_recsys_policies_als_model_policy_als_model_policy_config.py +154 -0
  214. shaped/autogen/models/shaped_internal_recsys_policies_beeformer_model_policy_beeformer_model_policy_beeformer_model_policy_config.py +160 -0
  215. shaped/autogen/models/shaped_internal_recsys_policies_bert_model_policy_bert_model_policy_bert_model_policy_config.py +215 -0
  216. shaped/autogen/models/shaped_internal_recsys_policies_chronological_model_policy_chronological_model_policy_config.py +156 -0
  217. shaped/autogen/models/shaped_internal_recsys_policies_elsa_model_policy_elsa_model_policy_elsa_model_policy_config.py +141 -0
  218. shaped/autogen/models/shaped_internal_recsys_policies_gsasrec_model_policy_gsasrec_model_policy_gsas_rec_model_policy_config.py +211 -0
  219. shaped/autogen/models/shaped_internal_recsys_policies_item2vec_model_policy_item2_vec_model_policy_config.py +140 -0
  220. shaped/autogen/models/shaped_internal_recsys_policies_item_content_similarity_model_policy_item_content_similarity_model_policy_config.py +195 -0
  221. shaped/autogen/models/shaped_internal_recsys_policies_lightgbm_model_policy_lightgbm_model_policy_light_gbm_model_policy_config.py +245 -0
  222. shaped/autogen/models/shaped_internal_recsys_policies_ngram_model_policy_ngram_model_policy_config.py +119 -0
  223. shaped/autogen/models/shaped_internal_recsys_policies_popular_model_policy_popular_model_policy_config.py +161 -0
  224. shaped/autogen/models/shaped_internal_recsys_policies_random_model_policy_random_model_policy_config.py +108 -0
  225. shaped/autogen/models/shaped_internal_recsys_policies_recently_popular_policy_recently_popular_policy_config.py +143 -0
  226. shaped/autogen/models/shaped_internal_recsys_policies_rising_popular_policy_rising_popular_policy_config.py +123 -0
  227. shaped/autogen/models/shaped_internal_recsys_policies_sasrec_model_policy_sasrec_model_policy_sas_rec_model_policy_config.py +230 -0
  228. shaped/autogen/models/shaped_internal_recsys_policies_svd_model_policy_svd_model_policy_config.py +119 -0
  229. shaped/autogen/models/shaped_internal_recsys_policies_two_tower_model_policy_two_tower_model_policy_two_tower_model_policy_config.py +165 -0
  230. shaped/autogen/models/shaped_internal_recsys_policies_user_item_content_similarity_model_policy_user_item_content_similarity_model_policy_config.py +153 -0
  231. shaped/autogen/models/shaped_internal_recsys_policies_widedeep_model_policy_wide_deep_model_policy_config.py +137 -0
  232. shaped/autogen/models/shaped_internal_recsys_policies_xgboost_model_policy_xg_boost_model_policy_config.py +155 -0
  233. shaped/autogen/models/shopify_table_config.py +156 -0
  234. shaped/autogen/models/similarity_retrieve_step.py +123 -0
  235. shaped/autogen/models/{snowflake_dataset_config.py → snowflake_table_config.py} +47 -18
  236. shaped/autogen/models/sql_transform_type.py +37 -0
  237. shaped/autogen/models/sql_view_config.py +111 -0
  238. shaped/autogen/models/stemmer_tokenizer.py +105 -0
  239. shaped/autogen/models/step_explanation.py +137 -0
  240. shaped/autogen/models/steps_inner.py +179 -0
  241. shaped/autogen/models/strategy.py +134 -0
  242. shaped/autogen/models/table.py +102 -0
  243. shaped/autogen/models/table_deployment_type.py +38 -0
  244. shaped/autogen/models/table_insert_arguments.py +87 -0
  245. shaped/autogen/models/table_insert_response.py +87 -0
  246. shaped/autogen/models/text_encoding.py +148 -0
  247. shaped/autogen/models/text_search_retrieve_step.py +121 -0
  248. shaped/autogen/models/time_frequency.py +136 -0
  249. shaped/autogen/models/time_window.py +136 -0
  250. shaped/autogen/models/time_window_in_days.py +154 -0
  251. shaped/autogen/models/tokenizer.py +149 -0
  252. shaped/autogen/models/trained_model_encoder.py +99 -0
  253. shaped/autogen/models/training_compute_config.py +99 -0
  254. shaped/autogen/models/training_config.py +121 -0
  255. shaped/autogen/models/training_config_models_inner.py +540 -0
  256. shaped/autogen/models/training_strategy.py +37 -0
  257. shaped/autogen/models/transform_status.py +41 -0
  258. shaped/autogen/models/trending_mode.py +37 -0
  259. shaped/autogen/models/truncate_filter_step.py +106 -0
  260. shaped/autogen/models/tunable_bool.py +97 -0
  261. shaped/autogen/models/tunable_float.py +118 -0
  262. shaped/autogen/models/tunable_int.py +118 -0
  263. shaped/autogen/models/tunable_int_categorical.py +99 -0
  264. shaped/autogen/models/tunable_string.py +99 -0
  265. shaped/autogen/models/tuning_config.py +89 -0
  266. shaped/autogen/models/type.py +150 -0
  267. shaped/autogen/models/update_table_response.py +87 -0
  268. shaped/autogen/models/update_view_response.py +87 -0
  269. shaped/autogen/models/user_attribute_pooling_encoder.py +124 -0
  270. shaped/autogen/models/user_inner.py +134 -0
  271. shaped/autogen/models/val_split.py +136 -0
  272. shaped/autogen/models/validation_error.py +13 -3
  273. shaped/autogen/models/validation_error_loc_inner.py +150 -0
  274. shaped/autogen/models/value_type.py +7 -5
  275. shaped/autogen/models/vector_search_mode.py +101 -0
  276. shaped/autogen/models/view.py +104 -0
  277. shaped/autogen/models/view_details_ai.py +140 -0
  278. shaped/autogen/models/view_details_ai_schema_value.py +153 -0
  279. shaped/autogen/models/view_details_sql.py +140 -0
  280. shaped/autogen/models/view_status.py +41 -0
  281. shaped/autogen/models/weight_decay.py +136 -0
  282. shaped/autogen/models/whitespace_tokenizer.py +97 -0
  283. shaped/autogen/models/window_size.py +136 -0
  284. shaped/autogen/rest.py +10 -4
  285. shaped/cli/shaped_cli.py +163 -35
  286. shaped/client.py +591 -171
  287. shaped/config_builders.py +705 -0
  288. shaped/query_builder.py +781 -0
  289. {shaped-2.0.1.dist-info → shaped-2.0.4.dist-info}/METADATA +141 -6
  290. shaped-2.0.4.dist-info/RECORD +296 -0
  291. {shaped-2.0.1.dist-info → shaped-2.0.4.dist-info}/WHEEL +1 -1
  292. shaped-2.0.4.dist-info/entry_points.txt +2 -0
  293. shaped/autogen/api/model_inference_api.py +0 -2825
  294. shaped/autogen/models/amplitude_dataset_config.py +0 -96
  295. shaped/autogen/models/aws_pinpoint_dataset_config.py +0 -96
  296. shaped/autogen/models/big_query_dataset_config.py +0 -114
  297. shaped/autogen/models/complement_items_request.py +0 -99
  298. shaped/autogen/models/complement_items_response.py +0 -89
  299. shaped/autogen/models/connectors_inner.py +0 -134
  300. shaped/autogen/models/create_dataset_arguments.py +0 -263
  301. shaped/autogen/models/create_embedding_response.py +0 -87
  302. shaped/autogen/models/create_item_embedding_request.py +0 -89
  303. shaped/autogen/models/create_model_arguments.py +0 -107
  304. shaped/autogen/models/create_model_response.py +0 -87
  305. shaped/autogen/models/create_user_embedding_request.py +0 -89
  306. shaped/autogen/models/custom_dataset_config.py +0 -115
  307. shaped/autogen/models/dataset_config.py +0 -101
  308. shaped/autogen/models/dataset_schema_type.py +0 -47
  309. shaped/autogen/models/datasets_inner.py +0 -91
  310. shaped/autogen/models/delete_model_response.py +0 -87
  311. shaped/autogen/models/fetch_config.py +0 -95
  312. shaped/autogen/models/file_config.py +0 -105
  313. shaped/autogen/models/file_source_config.py +0 -89
  314. shaped/autogen/models/inference_config.py +0 -101
  315. shaped/autogen/models/insert_model_response.py +0 -87
  316. shaped/autogen/models/interaction.py +0 -87
  317. shaped/autogen/models/list_datasets_response.py +0 -95
  318. shaped/autogen/models/list_models_response.py +0 -95
  319. shaped/autogen/models/model_config.py +0 -99
  320. shaped/autogen/models/model_response.py +0 -95
  321. shaped/autogen/models/mongo_db_dataset_config.py +0 -119
  322. shaped/autogen/models/post_rank_request.py +0 -117
  323. shaped/autogen/models/rank_attribute_response.py +0 -89
  324. shaped/autogen/models/rank_grid_attribute_request.py +0 -91
  325. shaped/autogen/models/rank_grid_attribute_request1.py +0 -93
  326. shaped/autogen/models/rank_grid_attribute_response.py +0 -91
  327. shaped/autogen/models/rank_response.py +0 -91
  328. shaped/autogen/models/retrieve_request.py +0 -101
  329. shaped/autogen/models/retrieve_response.py +0 -91
  330. shaped/autogen/models/retriever_top_k_override.py +0 -97
  331. shaped/autogen/models/rudder_stack_dataset_config.py +0 -96
  332. shaped/autogen/models/segment_dataset_config.py +0 -96
  333. shaped/autogen/models/similar_item_request.py +0 -101
  334. shaped/autogen/models/similar_response.py +0 -89
  335. shaped/autogen/models/similar_users_request.py +0 -99
  336. shaped/autogen/models/successful_response.py +0 -87
  337. shaped/autogen/models/view_model_response.py +0 -99
  338. shaped-2.0.1.dist-info/RECORD +0 -73
  339. shaped-2.0.1.dist-info/entry_points.txt +0 -2
  340. {shaped-2.0.1.dist-info → shaped-2.0.4.dist-info}/top_level.txt +0 -0
  341. {shaped-2.0.1.dist-info → shaped-2.0.4.dist-info}/zip-safe +0 -0
@@ -0,0 +1,1494 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Shaped API
5
+
6
+ Welcome to Shaped's API reference docs. These provide a detailed view of the endpoints and CLI commands that Shaped provides and brief explanations of how they should be used. The Shaped API has four main endpoints: **Tables** - Provision and manage batch and real-time data connectors. **Views** - Configure SQL transformations and AI enrichment on your input data. Use SQL to combine multiple data sources or use an LLM to add new categories, extract specific attributes from descriptions, etc. **Engines** - Deploy and manage your relevance engines. The Engine API exposes configuration for indexing logic, input datasets, externam embeddings, and more. **Query** - Execute queries against your engines, to return data based on an input query or rerank an existing list. The Query API exposes the retrieve, filter, score, and ranking steps of the 4-stage ranking architecture. The base URL for each endpoint is: `https://api.shaped.ai/v2`
7
+
8
+ The version of the OpenAPI document: 2.0.4
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictStr
20
+ from typing_extensions import Annotated
21
+ from shaped.autogen.models.create_table_response import CreateTableResponse
22
+ from shaped.autogen.models.delete_table_response import DeleteTableResponse
23
+ from shaped.autogen.models.list_tables_response import ListTablesResponse
24
+ from shaped.autogen.models.request import Request
25
+ from shaped.autogen.models.table_insert_arguments import TableInsertArguments
26
+ from shaped.autogen.models.table_insert_response import TableInsertResponse
27
+ from shaped.autogen.models.update_table_response import UpdateTableResponse
28
+
29
+ from shaped.autogen.api_client import ApiClient, RequestSerialized
30
+ from shaped.autogen.api_response import ApiResponse
31
+ from shaped.autogen.rest import RESTResponseType
32
+
33
+
34
+ class TableApi:
35
+ """NOTE: This class is auto generated by OpenAPI Generator
36
+ Ref: https://openapi-generator.tech
37
+
38
+ Do not edit the class manually.
39
+ """
40
+
41
+ def __init__(self, api_client=None) -> None:
42
+ if api_client is None:
43
+ api_client = ApiClient.get_default()
44
+ self.api_client = api_client
45
+
46
+
47
+ @validate_call
48
+ def delete_table_route_tables_table_name_delete(
49
+ self,
50
+ table_name: Annotated[StrictStr, Field(description="Name of the table to delete.")],
51
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
52
+ _request_timeout: Union[
53
+ None,
54
+ Annotated[StrictFloat, Field(gt=0)],
55
+ Tuple[
56
+ Annotated[StrictFloat, Field(gt=0)],
57
+ Annotated[StrictFloat, Field(gt=0)]
58
+ ]
59
+ ] = None,
60
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
61
+ _content_type: Optional[StrictStr] = None,
62
+ _headers: Optional[Dict[StrictStr, Any]] = None,
63
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
64
+ ) -> DeleteTableResponse:
65
+ """Delete Table
66
+
67
+ Delete the table with identifier: {table_name}.
68
+
69
+ :param table_name: Name of the table to delete. (required)
70
+ :type table_name: str
71
+ :param x_api_key: API key for authentication. (required)
72
+ :type x_api_key: str
73
+ :param _request_timeout: timeout setting for this request. If one
74
+ number provided, it will be total request
75
+ timeout. It can also be a pair (tuple) of
76
+ (connection, read) timeouts.
77
+ :type _request_timeout: int, tuple(int, int), optional
78
+ :param _request_auth: set to override the auth_settings for an a single
79
+ request; this effectively ignores the
80
+ authentication in the spec for a single request.
81
+ :type _request_auth: dict, optional
82
+ :param _content_type: force content-type for the request.
83
+ :type _content_type: str, Optional
84
+ :param _headers: set to override the headers for a single
85
+ request; this effectively ignores the headers
86
+ in the spec for a single request.
87
+ :type _headers: dict, optional
88
+ :param _host_index: set to override the host_index for a single
89
+ request; this effectively ignores the host_index
90
+ in the spec for a single request.
91
+ :type _host_index: int, optional
92
+ :return: Returns the result object.
93
+ """ # noqa: E501
94
+
95
+ _param = self._delete_table_route_tables_table_name_delete_serialize(
96
+ table_name=table_name,
97
+ x_api_key=x_api_key,
98
+ _request_auth=_request_auth,
99
+ _content_type=_content_type,
100
+ _headers=_headers,
101
+ _host_index=_host_index
102
+ )
103
+
104
+ _response_types_map: Dict[str, Optional[str]] = {
105
+ '200': "DeleteTableResponse",
106
+ '404': "HttpProblemResponse",
107
+ '422': "HTTPValidationError",
108
+ }
109
+ response_data = self.api_client.call_api(
110
+ *_param,
111
+ _request_timeout=_request_timeout
112
+ )
113
+ response_data.read()
114
+ return self.api_client.response_deserialize(
115
+ response_data=response_data,
116
+ response_types_map=_response_types_map,
117
+ ).data
118
+
119
+
120
+ @validate_call
121
+ def delete_table_route_tables_table_name_delete_with_http_info(
122
+ self,
123
+ table_name: Annotated[StrictStr, Field(description="Name of the table to delete.")],
124
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
125
+ _request_timeout: Union[
126
+ None,
127
+ Annotated[StrictFloat, Field(gt=0)],
128
+ Tuple[
129
+ Annotated[StrictFloat, Field(gt=0)],
130
+ Annotated[StrictFloat, Field(gt=0)]
131
+ ]
132
+ ] = None,
133
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
134
+ _content_type: Optional[StrictStr] = None,
135
+ _headers: Optional[Dict[StrictStr, Any]] = None,
136
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
137
+ ) -> ApiResponse[DeleteTableResponse]:
138
+ """Delete Table
139
+
140
+ Delete the table with identifier: {table_name}.
141
+
142
+ :param table_name: Name of the table to delete. (required)
143
+ :type table_name: str
144
+ :param x_api_key: API key for authentication. (required)
145
+ :type x_api_key: str
146
+ :param _request_timeout: timeout setting for this request. If one
147
+ number provided, it will be total request
148
+ timeout. It can also be a pair (tuple) of
149
+ (connection, read) timeouts.
150
+ :type _request_timeout: int, tuple(int, int), optional
151
+ :param _request_auth: set to override the auth_settings for an a single
152
+ request; this effectively ignores the
153
+ authentication in the spec for a single request.
154
+ :type _request_auth: dict, optional
155
+ :param _content_type: force content-type for the request.
156
+ :type _content_type: str, Optional
157
+ :param _headers: set to override the headers for a single
158
+ request; this effectively ignores the headers
159
+ in the spec for a single request.
160
+ :type _headers: dict, optional
161
+ :param _host_index: set to override the host_index for a single
162
+ request; this effectively ignores the host_index
163
+ in the spec for a single request.
164
+ :type _host_index: int, optional
165
+ :return: Returns the result object.
166
+ """ # noqa: E501
167
+
168
+ _param = self._delete_table_route_tables_table_name_delete_serialize(
169
+ table_name=table_name,
170
+ x_api_key=x_api_key,
171
+ _request_auth=_request_auth,
172
+ _content_type=_content_type,
173
+ _headers=_headers,
174
+ _host_index=_host_index
175
+ )
176
+
177
+ _response_types_map: Dict[str, Optional[str]] = {
178
+ '200': "DeleteTableResponse",
179
+ '404': "HttpProblemResponse",
180
+ '422': "HTTPValidationError",
181
+ }
182
+ response_data = self.api_client.call_api(
183
+ *_param,
184
+ _request_timeout=_request_timeout
185
+ )
186
+ response_data.read()
187
+ return self.api_client.response_deserialize(
188
+ response_data=response_data,
189
+ response_types_map=_response_types_map,
190
+ )
191
+
192
+
193
+ @validate_call
194
+ def delete_table_route_tables_table_name_delete_without_preload_content(
195
+ self,
196
+ table_name: Annotated[StrictStr, Field(description="Name of the table to delete.")],
197
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
198
+ _request_timeout: Union[
199
+ None,
200
+ Annotated[StrictFloat, Field(gt=0)],
201
+ Tuple[
202
+ Annotated[StrictFloat, Field(gt=0)],
203
+ Annotated[StrictFloat, Field(gt=0)]
204
+ ]
205
+ ] = None,
206
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
207
+ _content_type: Optional[StrictStr] = None,
208
+ _headers: Optional[Dict[StrictStr, Any]] = None,
209
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
210
+ ) -> RESTResponseType:
211
+ """Delete Table
212
+
213
+ Delete the table with identifier: {table_name}.
214
+
215
+ :param table_name: Name of the table to delete. (required)
216
+ :type table_name: str
217
+ :param x_api_key: API key for authentication. (required)
218
+ :type x_api_key: str
219
+ :param _request_timeout: timeout setting for this request. If one
220
+ number provided, it will be total request
221
+ timeout. It can also be a pair (tuple) of
222
+ (connection, read) timeouts.
223
+ :type _request_timeout: int, tuple(int, int), optional
224
+ :param _request_auth: set to override the auth_settings for an a single
225
+ request; this effectively ignores the
226
+ authentication in the spec for a single request.
227
+ :type _request_auth: dict, optional
228
+ :param _content_type: force content-type for the request.
229
+ :type _content_type: str, Optional
230
+ :param _headers: set to override the headers for a single
231
+ request; this effectively ignores the headers
232
+ in the spec for a single request.
233
+ :type _headers: dict, optional
234
+ :param _host_index: set to override the host_index for a single
235
+ request; this effectively ignores the host_index
236
+ in the spec for a single request.
237
+ :type _host_index: int, optional
238
+ :return: Returns the result object.
239
+ """ # noqa: E501
240
+
241
+ _param = self._delete_table_route_tables_table_name_delete_serialize(
242
+ table_name=table_name,
243
+ x_api_key=x_api_key,
244
+ _request_auth=_request_auth,
245
+ _content_type=_content_type,
246
+ _headers=_headers,
247
+ _host_index=_host_index
248
+ )
249
+
250
+ _response_types_map: Dict[str, Optional[str]] = {
251
+ '200': "DeleteTableResponse",
252
+ '404': "HttpProblemResponse",
253
+ '422': "HTTPValidationError",
254
+ }
255
+ response_data = self.api_client.call_api(
256
+ *_param,
257
+ _request_timeout=_request_timeout
258
+ )
259
+ return response_data.response
260
+
261
+
262
+ def _delete_table_route_tables_table_name_delete_serialize(
263
+ self,
264
+ table_name,
265
+ x_api_key,
266
+ _request_auth,
267
+ _content_type,
268
+ _headers,
269
+ _host_index,
270
+ ) -> RequestSerialized:
271
+
272
+ _host = None
273
+
274
+ _collection_formats: Dict[str, str] = {
275
+ }
276
+
277
+ _path_params: Dict[str, str] = {}
278
+ _query_params: List[Tuple[str, str]] = []
279
+ _header_params: Dict[str, Optional[str]] = _headers or {}
280
+ _form_params: List[Tuple[str, str]] = []
281
+ _files: Dict[
282
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
283
+ ] = {}
284
+ _body_params: Optional[bytes] = None
285
+
286
+ # process the path parameters
287
+ if table_name is not None:
288
+ _path_params['table_name'] = table_name
289
+ # process the query parameters
290
+ # process the header parameters
291
+ if x_api_key is not None:
292
+ _header_params['x-api-key'] = x_api_key
293
+ # process the form parameters
294
+ # process the body parameter
295
+
296
+
297
+ # set the HTTP header `Accept`
298
+ if 'Accept' not in _header_params:
299
+ _header_params['Accept'] = self.api_client.select_header_accept(
300
+ [
301
+ 'application/json'
302
+ ]
303
+ )
304
+
305
+
306
+ # authentication setting
307
+ _auth_settings: List[str] = [
308
+ ]
309
+
310
+ return self.api_client.param_serialize(
311
+ method='DELETE',
312
+ resource_path='/tables/{table_name}',
313
+ path_params=_path_params,
314
+ query_params=_query_params,
315
+ header_params=_header_params,
316
+ body=_body_params,
317
+ post_params=_form_params,
318
+ files=_files,
319
+ auth_settings=_auth_settings,
320
+ collection_formats=_collection_formats,
321
+ _host=_host,
322
+ _request_auth=_request_auth
323
+ )
324
+
325
+
326
+
327
+
328
+ @validate_call
329
+ def get_tables_tables_get(
330
+ self,
331
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
332
+ _request_timeout: Union[
333
+ None,
334
+ Annotated[StrictFloat, Field(gt=0)],
335
+ Tuple[
336
+ Annotated[StrictFloat, Field(gt=0)],
337
+ Annotated[StrictFloat, Field(gt=0)]
338
+ ]
339
+ ] = None,
340
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
341
+ _content_type: Optional[StrictStr] = None,
342
+ _headers: Optional[Dict[StrictStr, Any]] = None,
343
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
344
+ ) -> ListTablesResponse:
345
+ """List Tables
346
+
347
+ List the tables in your account and basic metadata like schema type and status.
348
+
349
+ :param x_api_key: API key for authentication. (required)
350
+ :type x_api_key: str
351
+ :param _request_timeout: timeout setting for this request. If one
352
+ number provided, it will be total request
353
+ timeout. It can also be a pair (tuple) of
354
+ (connection, read) timeouts.
355
+ :type _request_timeout: int, tuple(int, int), optional
356
+ :param _request_auth: set to override the auth_settings for an a single
357
+ request; this effectively ignores the
358
+ authentication in the spec for a single request.
359
+ :type _request_auth: dict, optional
360
+ :param _content_type: force content-type for the request.
361
+ :type _content_type: str, Optional
362
+ :param _headers: set to override the headers for a single
363
+ request; this effectively ignores the headers
364
+ in the spec for a single request.
365
+ :type _headers: dict, optional
366
+ :param _host_index: set to override the host_index for a single
367
+ request; this effectively ignores the host_index
368
+ in the spec for a single request.
369
+ :type _host_index: int, optional
370
+ :return: Returns the result object.
371
+ """ # noqa: E501
372
+
373
+ _param = self._get_tables_tables_get_serialize(
374
+ x_api_key=x_api_key,
375
+ _request_auth=_request_auth,
376
+ _content_type=_content_type,
377
+ _headers=_headers,
378
+ _host_index=_host_index
379
+ )
380
+
381
+ _response_types_map: Dict[str, Optional[str]] = {
382
+ '200': "ListTablesResponse",
383
+ '422': "HTTPValidationError",
384
+ }
385
+ response_data = self.api_client.call_api(
386
+ *_param,
387
+ _request_timeout=_request_timeout
388
+ )
389
+ response_data.read()
390
+ return self.api_client.response_deserialize(
391
+ response_data=response_data,
392
+ response_types_map=_response_types_map,
393
+ ).data
394
+
395
+
396
+ @validate_call
397
+ def get_tables_tables_get_with_http_info(
398
+ self,
399
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
400
+ _request_timeout: Union[
401
+ None,
402
+ Annotated[StrictFloat, Field(gt=0)],
403
+ Tuple[
404
+ Annotated[StrictFloat, Field(gt=0)],
405
+ Annotated[StrictFloat, Field(gt=0)]
406
+ ]
407
+ ] = None,
408
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
409
+ _content_type: Optional[StrictStr] = None,
410
+ _headers: Optional[Dict[StrictStr, Any]] = None,
411
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
412
+ ) -> ApiResponse[ListTablesResponse]:
413
+ """List Tables
414
+
415
+ List the tables in your account and basic metadata like schema type and status.
416
+
417
+ :param x_api_key: API key for authentication. (required)
418
+ :type x_api_key: str
419
+ :param _request_timeout: timeout setting for this request. If one
420
+ number provided, it will be total request
421
+ timeout. It can also be a pair (tuple) of
422
+ (connection, read) timeouts.
423
+ :type _request_timeout: int, tuple(int, int), optional
424
+ :param _request_auth: set to override the auth_settings for an a single
425
+ request; this effectively ignores the
426
+ authentication in the spec for a single request.
427
+ :type _request_auth: dict, optional
428
+ :param _content_type: force content-type for the request.
429
+ :type _content_type: str, Optional
430
+ :param _headers: set to override the headers for a single
431
+ request; this effectively ignores the headers
432
+ in the spec for a single request.
433
+ :type _headers: dict, optional
434
+ :param _host_index: set to override the host_index for a single
435
+ request; this effectively ignores the host_index
436
+ in the spec for a single request.
437
+ :type _host_index: int, optional
438
+ :return: Returns the result object.
439
+ """ # noqa: E501
440
+
441
+ _param = self._get_tables_tables_get_serialize(
442
+ x_api_key=x_api_key,
443
+ _request_auth=_request_auth,
444
+ _content_type=_content_type,
445
+ _headers=_headers,
446
+ _host_index=_host_index
447
+ )
448
+
449
+ _response_types_map: Dict[str, Optional[str]] = {
450
+ '200': "ListTablesResponse",
451
+ '422': "HTTPValidationError",
452
+ }
453
+ response_data = self.api_client.call_api(
454
+ *_param,
455
+ _request_timeout=_request_timeout
456
+ )
457
+ response_data.read()
458
+ return self.api_client.response_deserialize(
459
+ response_data=response_data,
460
+ response_types_map=_response_types_map,
461
+ )
462
+
463
+
464
+ @validate_call
465
+ def get_tables_tables_get_without_preload_content(
466
+ self,
467
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40, description="API key for authentication.")],
468
+ _request_timeout: Union[
469
+ None,
470
+ Annotated[StrictFloat, Field(gt=0)],
471
+ Tuple[
472
+ Annotated[StrictFloat, Field(gt=0)],
473
+ Annotated[StrictFloat, Field(gt=0)]
474
+ ]
475
+ ] = None,
476
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
477
+ _content_type: Optional[StrictStr] = None,
478
+ _headers: Optional[Dict[StrictStr, Any]] = None,
479
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
480
+ ) -> RESTResponseType:
481
+ """List Tables
482
+
483
+ List the tables in your account and basic metadata like schema type and status.
484
+
485
+ :param x_api_key: API key for authentication. (required)
486
+ :type x_api_key: str
487
+ :param _request_timeout: timeout setting for this request. If one
488
+ number provided, it will be total request
489
+ timeout. It can also be a pair (tuple) of
490
+ (connection, read) timeouts.
491
+ :type _request_timeout: int, tuple(int, int), optional
492
+ :param _request_auth: set to override the auth_settings for an a single
493
+ request; this effectively ignores the
494
+ authentication in the spec for a single request.
495
+ :type _request_auth: dict, optional
496
+ :param _content_type: force content-type for the request.
497
+ :type _content_type: str, Optional
498
+ :param _headers: set to override the headers for a single
499
+ request; this effectively ignores the headers
500
+ in the spec for a single request.
501
+ :type _headers: dict, optional
502
+ :param _host_index: set to override the host_index for a single
503
+ request; this effectively ignores the host_index
504
+ in the spec for a single request.
505
+ :type _host_index: int, optional
506
+ :return: Returns the result object.
507
+ """ # noqa: E501
508
+
509
+ _param = self._get_tables_tables_get_serialize(
510
+ x_api_key=x_api_key,
511
+ _request_auth=_request_auth,
512
+ _content_type=_content_type,
513
+ _headers=_headers,
514
+ _host_index=_host_index
515
+ )
516
+
517
+ _response_types_map: Dict[str, Optional[str]] = {
518
+ '200': "ListTablesResponse",
519
+ '422': "HTTPValidationError",
520
+ }
521
+ response_data = self.api_client.call_api(
522
+ *_param,
523
+ _request_timeout=_request_timeout
524
+ )
525
+ return response_data.response
526
+
527
+
528
+ def _get_tables_tables_get_serialize(
529
+ self,
530
+ x_api_key,
531
+ _request_auth,
532
+ _content_type,
533
+ _headers,
534
+ _host_index,
535
+ ) -> RequestSerialized:
536
+
537
+ _host = None
538
+
539
+ _collection_formats: Dict[str, str] = {
540
+ }
541
+
542
+ _path_params: Dict[str, str] = {}
543
+ _query_params: List[Tuple[str, str]] = []
544
+ _header_params: Dict[str, Optional[str]] = _headers or {}
545
+ _form_params: List[Tuple[str, str]] = []
546
+ _files: Dict[
547
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
548
+ ] = {}
549
+ _body_params: Optional[bytes] = None
550
+
551
+ # process the path parameters
552
+ # process the query parameters
553
+ # process the header parameters
554
+ if x_api_key is not None:
555
+ _header_params['x-api-key'] = x_api_key
556
+ # process the form parameters
557
+ # process the body parameter
558
+
559
+
560
+ # set the HTTP header `Accept`
561
+ if 'Accept' not in _header_params:
562
+ _header_params['Accept'] = self.api_client.select_header_accept(
563
+ [
564
+ 'application/json'
565
+ ]
566
+ )
567
+
568
+
569
+ # authentication setting
570
+ _auth_settings: List[str] = [
571
+ ]
572
+
573
+ return self.api_client.param_serialize(
574
+ method='GET',
575
+ resource_path='/tables',
576
+ path_params=_path_params,
577
+ query_params=_query_params,
578
+ header_params=_header_params,
579
+ body=_body_params,
580
+ post_params=_form_params,
581
+ files=_files,
582
+ auth_settings=_auth_settings,
583
+ collection_formats=_collection_formats,
584
+ _host=_host,
585
+ _request_auth=_request_auth
586
+ )
587
+
588
+
589
+
590
+
591
+ @validate_call
592
+ def patch_update_table_tables_patch(
593
+ self,
594
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40)],
595
+ request: Request,
596
+ _request_timeout: Union[
597
+ None,
598
+ Annotated[StrictFloat, Field(gt=0)],
599
+ Tuple[
600
+ Annotated[StrictFloat, Field(gt=0)],
601
+ Annotated[StrictFloat, Field(gt=0)]
602
+ ]
603
+ ] = None,
604
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
605
+ _content_type: Optional[StrictStr] = None,
606
+ _headers: Optional[Dict[StrictStr, Any]] = None,
607
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
608
+ ) -> UpdateTableResponse:
609
+ """Update Table
610
+
611
+ Update the config of an existing table.
612
+
613
+ :param x_api_key: (required)
614
+ :type x_api_key: str
615
+ :param request: (required)
616
+ :type request: Request
617
+ :param _request_timeout: timeout setting for this request. If one
618
+ number provided, it will be total request
619
+ timeout. It can also be a pair (tuple) of
620
+ (connection, read) timeouts.
621
+ :type _request_timeout: int, tuple(int, int), optional
622
+ :param _request_auth: set to override the auth_settings for an a single
623
+ request; this effectively ignores the
624
+ authentication in the spec for a single request.
625
+ :type _request_auth: dict, optional
626
+ :param _content_type: force content-type for the request.
627
+ :type _content_type: str, Optional
628
+ :param _headers: set to override the headers for a single
629
+ request; this effectively ignores the headers
630
+ in the spec for a single request.
631
+ :type _headers: dict, optional
632
+ :param _host_index: set to override the host_index for a single
633
+ request; this effectively ignores the host_index
634
+ in the spec for a single request.
635
+ :type _host_index: int, optional
636
+ :return: Returns the result object.
637
+ """ # noqa: E501
638
+
639
+ _param = self._patch_update_table_tables_patch_serialize(
640
+ x_api_key=x_api_key,
641
+ request=request,
642
+ _request_auth=_request_auth,
643
+ _content_type=_content_type,
644
+ _headers=_headers,
645
+ _host_index=_host_index
646
+ )
647
+
648
+ _response_types_map: Dict[str, Optional[str]] = {
649
+ '200': "UpdateTableResponse",
650
+ '400': "HttpProblemResponse",
651
+ '404': "HttpProblemResponse",
652
+ '422': "HttpProblemResponse",
653
+ }
654
+ response_data = self.api_client.call_api(
655
+ *_param,
656
+ _request_timeout=_request_timeout
657
+ )
658
+ response_data.read()
659
+ return self.api_client.response_deserialize(
660
+ response_data=response_data,
661
+ response_types_map=_response_types_map,
662
+ ).data
663
+
664
+
665
+ @validate_call
666
+ def patch_update_table_tables_patch_with_http_info(
667
+ self,
668
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40)],
669
+ request: Request,
670
+ _request_timeout: Union[
671
+ None,
672
+ Annotated[StrictFloat, Field(gt=0)],
673
+ Tuple[
674
+ Annotated[StrictFloat, Field(gt=0)],
675
+ Annotated[StrictFloat, Field(gt=0)]
676
+ ]
677
+ ] = None,
678
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
679
+ _content_type: Optional[StrictStr] = None,
680
+ _headers: Optional[Dict[StrictStr, Any]] = None,
681
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
682
+ ) -> ApiResponse[UpdateTableResponse]:
683
+ """Update Table
684
+
685
+ Update the config of an existing table.
686
+
687
+ :param x_api_key: (required)
688
+ :type x_api_key: str
689
+ :param request: (required)
690
+ :type request: Request
691
+ :param _request_timeout: timeout setting for this request. If one
692
+ number provided, it will be total request
693
+ timeout. It can also be a pair (tuple) of
694
+ (connection, read) timeouts.
695
+ :type _request_timeout: int, tuple(int, int), optional
696
+ :param _request_auth: set to override the auth_settings for an a single
697
+ request; this effectively ignores the
698
+ authentication in the spec for a single request.
699
+ :type _request_auth: dict, optional
700
+ :param _content_type: force content-type for the request.
701
+ :type _content_type: str, Optional
702
+ :param _headers: set to override the headers for a single
703
+ request; this effectively ignores the headers
704
+ in the spec for a single request.
705
+ :type _headers: dict, optional
706
+ :param _host_index: set to override the host_index for a single
707
+ request; this effectively ignores the host_index
708
+ in the spec for a single request.
709
+ :type _host_index: int, optional
710
+ :return: Returns the result object.
711
+ """ # noqa: E501
712
+
713
+ _param = self._patch_update_table_tables_patch_serialize(
714
+ x_api_key=x_api_key,
715
+ request=request,
716
+ _request_auth=_request_auth,
717
+ _content_type=_content_type,
718
+ _headers=_headers,
719
+ _host_index=_host_index
720
+ )
721
+
722
+ _response_types_map: Dict[str, Optional[str]] = {
723
+ '200': "UpdateTableResponse",
724
+ '400': "HttpProblemResponse",
725
+ '404': "HttpProblemResponse",
726
+ '422': "HttpProblemResponse",
727
+ }
728
+ response_data = self.api_client.call_api(
729
+ *_param,
730
+ _request_timeout=_request_timeout
731
+ )
732
+ response_data.read()
733
+ return self.api_client.response_deserialize(
734
+ response_data=response_data,
735
+ response_types_map=_response_types_map,
736
+ )
737
+
738
+
739
+ @validate_call
740
+ def patch_update_table_tables_patch_without_preload_content(
741
+ self,
742
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40)],
743
+ request: Request,
744
+ _request_timeout: Union[
745
+ None,
746
+ Annotated[StrictFloat, Field(gt=0)],
747
+ Tuple[
748
+ Annotated[StrictFloat, Field(gt=0)],
749
+ Annotated[StrictFloat, Field(gt=0)]
750
+ ]
751
+ ] = None,
752
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
753
+ _content_type: Optional[StrictStr] = None,
754
+ _headers: Optional[Dict[StrictStr, Any]] = None,
755
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
756
+ ) -> RESTResponseType:
757
+ """Update Table
758
+
759
+ Update the config of an existing table.
760
+
761
+ :param x_api_key: (required)
762
+ :type x_api_key: str
763
+ :param request: (required)
764
+ :type request: Request
765
+ :param _request_timeout: timeout setting for this request. If one
766
+ number provided, it will be total request
767
+ timeout. It can also be a pair (tuple) of
768
+ (connection, read) timeouts.
769
+ :type _request_timeout: int, tuple(int, int), optional
770
+ :param _request_auth: set to override the auth_settings for an a single
771
+ request; this effectively ignores the
772
+ authentication in the spec for a single request.
773
+ :type _request_auth: dict, optional
774
+ :param _content_type: force content-type for the request.
775
+ :type _content_type: str, Optional
776
+ :param _headers: set to override the headers for a single
777
+ request; this effectively ignores the headers
778
+ in the spec for a single request.
779
+ :type _headers: dict, optional
780
+ :param _host_index: set to override the host_index for a single
781
+ request; this effectively ignores the host_index
782
+ in the spec for a single request.
783
+ :type _host_index: int, optional
784
+ :return: Returns the result object.
785
+ """ # noqa: E501
786
+
787
+ _param = self._patch_update_table_tables_patch_serialize(
788
+ x_api_key=x_api_key,
789
+ request=request,
790
+ _request_auth=_request_auth,
791
+ _content_type=_content_type,
792
+ _headers=_headers,
793
+ _host_index=_host_index
794
+ )
795
+
796
+ _response_types_map: Dict[str, Optional[str]] = {
797
+ '200': "UpdateTableResponse",
798
+ '400': "HttpProblemResponse",
799
+ '404': "HttpProblemResponse",
800
+ '422': "HttpProblemResponse",
801
+ }
802
+ response_data = self.api_client.call_api(
803
+ *_param,
804
+ _request_timeout=_request_timeout
805
+ )
806
+ return response_data.response
807
+
808
+
809
+ def _patch_update_table_tables_patch_serialize(
810
+ self,
811
+ x_api_key,
812
+ request,
813
+ _request_auth,
814
+ _content_type,
815
+ _headers,
816
+ _host_index,
817
+ ) -> RequestSerialized:
818
+
819
+ _host = None
820
+
821
+ _collection_formats: Dict[str, str] = {
822
+ }
823
+
824
+ _path_params: Dict[str, str] = {}
825
+ _query_params: List[Tuple[str, str]] = []
826
+ _header_params: Dict[str, Optional[str]] = _headers or {}
827
+ _form_params: List[Tuple[str, str]] = []
828
+ _files: Dict[
829
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
830
+ ] = {}
831
+ _body_params: Optional[bytes] = None
832
+
833
+ # process the path parameters
834
+ # process the query parameters
835
+ # process the header parameters
836
+ if x_api_key is not None:
837
+ _header_params['x-api-key'] = x_api_key
838
+ # process the form parameters
839
+ # process the body parameter
840
+ if request is not None:
841
+ _body_params = request
842
+
843
+
844
+ # set the HTTP header `Accept`
845
+ if 'Accept' not in _header_params:
846
+ _header_params['Accept'] = self.api_client.select_header_accept(
847
+ [
848
+ 'application/json'
849
+ ]
850
+ )
851
+
852
+ # set the HTTP header `Content-Type`
853
+ if _content_type:
854
+ _header_params['Content-Type'] = _content_type
855
+ else:
856
+ _default_content_type = (
857
+ self.api_client.select_header_content_type(
858
+ [
859
+ 'application/json'
860
+ ]
861
+ )
862
+ )
863
+ if _default_content_type is not None:
864
+ _header_params['Content-Type'] = _default_content_type
865
+
866
+ # authentication setting
867
+ _auth_settings: List[str] = [
868
+ ]
869
+
870
+ return self.api_client.param_serialize(
871
+ method='PATCH',
872
+ resource_path='/tables',
873
+ path_params=_path_params,
874
+ query_params=_query_params,
875
+ header_params=_header_params,
876
+ body=_body_params,
877
+ post_params=_form_params,
878
+ files=_files,
879
+ auth_settings=_auth_settings,
880
+ collection_formats=_collection_formats,
881
+ _host=_host,
882
+ _request_auth=_request_auth
883
+ )
884
+
885
+
886
+
887
+
888
+ @validate_call
889
+ def post_create_table_tables_post(
890
+ self,
891
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40)],
892
+ request: Request,
893
+ _request_timeout: Union[
894
+ None,
895
+ Annotated[StrictFloat, Field(gt=0)],
896
+ Tuple[
897
+ Annotated[StrictFloat, Field(gt=0)],
898
+ Annotated[StrictFloat, Field(gt=0)]
899
+ ]
900
+ ] = None,
901
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
902
+ _content_type: Optional[StrictStr] = None,
903
+ _headers: Optional[Dict[StrictStr, Any]] = None,
904
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
905
+ ) -> CreateTableResponse:
906
+ """Create Table
907
+
908
+ Creates a new Table. Use this endpoint to configure the schema, column structure, and metadata of the table. Use **Insert Table Rows** to add rows to your table. If you want to upload a local dataset, use the CLI: `shaped create_dataset_from_uri` Schema type: Different sources have different configuration. The `schema_type` argument specifies the type of table you are creating (Snowflake, SQL, Amplitude, etc). Unique keys and replication keys: Tables are append-only. In case of duplicates, we use the `unique_keys` and `replication_key` attributes to determine the correct value for a record.
909
+
910
+ :param x_api_key: (required)
911
+ :type x_api_key: str
912
+ :param request: (required)
913
+ :type request: Request
914
+ :param _request_timeout: timeout setting for this request. If one
915
+ number provided, it will be total request
916
+ timeout. It can also be a pair (tuple) of
917
+ (connection, read) timeouts.
918
+ :type _request_timeout: int, tuple(int, int), optional
919
+ :param _request_auth: set to override the auth_settings for an a single
920
+ request; this effectively ignores the
921
+ authentication in the spec for a single request.
922
+ :type _request_auth: dict, optional
923
+ :param _content_type: force content-type for the request.
924
+ :type _content_type: str, Optional
925
+ :param _headers: set to override the headers for a single
926
+ request; this effectively ignores the headers
927
+ in the spec for a single request.
928
+ :type _headers: dict, optional
929
+ :param _host_index: set to override the host_index for a single
930
+ request; this effectively ignores the host_index
931
+ in the spec for a single request.
932
+ :type _host_index: int, optional
933
+ :return: Returns the result object.
934
+ """ # noqa: E501
935
+
936
+ _param = self._post_create_table_tables_post_serialize(
937
+ x_api_key=x_api_key,
938
+ request=request,
939
+ _request_auth=_request_auth,
940
+ _content_type=_content_type,
941
+ _headers=_headers,
942
+ _host_index=_host_index
943
+ )
944
+
945
+ _response_types_map: Dict[str, Optional[str]] = {
946
+ '200': "CreateTableResponse",
947
+ '400': "HttpProblemResponse",
948
+ '409': "HttpProblemResponse",
949
+ '422': "HttpProblemResponse",
950
+ }
951
+ response_data = self.api_client.call_api(
952
+ *_param,
953
+ _request_timeout=_request_timeout
954
+ )
955
+ response_data.read()
956
+ return self.api_client.response_deserialize(
957
+ response_data=response_data,
958
+ response_types_map=_response_types_map,
959
+ ).data
960
+
961
+
962
+ @validate_call
963
+ def post_create_table_tables_post_with_http_info(
964
+ self,
965
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40)],
966
+ request: Request,
967
+ _request_timeout: Union[
968
+ None,
969
+ Annotated[StrictFloat, Field(gt=0)],
970
+ Tuple[
971
+ Annotated[StrictFloat, Field(gt=0)],
972
+ Annotated[StrictFloat, Field(gt=0)]
973
+ ]
974
+ ] = None,
975
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
976
+ _content_type: Optional[StrictStr] = None,
977
+ _headers: Optional[Dict[StrictStr, Any]] = None,
978
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
979
+ ) -> ApiResponse[CreateTableResponse]:
980
+ """Create Table
981
+
982
+ Creates a new Table. Use this endpoint to configure the schema, column structure, and metadata of the table. Use **Insert Table Rows** to add rows to your table. If you want to upload a local dataset, use the CLI: `shaped create_dataset_from_uri` Schema type: Different sources have different configuration. The `schema_type` argument specifies the type of table you are creating (Snowflake, SQL, Amplitude, etc). Unique keys and replication keys: Tables are append-only. In case of duplicates, we use the `unique_keys` and `replication_key` attributes to determine the correct value for a record.
983
+
984
+ :param x_api_key: (required)
985
+ :type x_api_key: str
986
+ :param request: (required)
987
+ :type request: Request
988
+ :param _request_timeout: timeout setting for this request. If one
989
+ number provided, it will be total request
990
+ timeout. It can also be a pair (tuple) of
991
+ (connection, read) timeouts.
992
+ :type _request_timeout: int, tuple(int, int), optional
993
+ :param _request_auth: set to override the auth_settings for an a single
994
+ request; this effectively ignores the
995
+ authentication in the spec for a single request.
996
+ :type _request_auth: dict, optional
997
+ :param _content_type: force content-type for the request.
998
+ :type _content_type: str, Optional
999
+ :param _headers: set to override the headers for a single
1000
+ request; this effectively ignores the headers
1001
+ in the spec for a single request.
1002
+ :type _headers: dict, optional
1003
+ :param _host_index: set to override the host_index for a single
1004
+ request; this effectively ignores the host_index
1005
+ in the spec for a single request.
1006
+ :type _host_index: int, optional
1007
+ :return: Returns the result object.
1008
+ """ # noqa: E501
1009
+
1010
+ _param = self._post_create_table_tables_post_serialize(
1011
+ x_api_key=x_api_key,
1012
+ request=request,
1013
+ _request_auth=_request_auth,
1014
+ _content_type=_content_type,
1015
+ _headers=_headers,
1016
+ _host_index=_host_index
1017
+ )
1018
+
1019
+ _response_types_map: Dict[str, Optional[str]] = {
1020
+ '200': "CreateTableResponse",
1021
+ '400': "HttpProblemResponse",
1022
+ '409': "HttpProblemResponse",
1023
+ '422': "HttpProblemResponse",
1024
+ }
1025
+ response_data = self.api_client.call_api(
1026
+ *_param,
1027
+ _request_timeout=_request_timeout
1028
+ )
1029
+ response_data.read()
1030
+ return self.api_client.response_deserialize(
1031
+ response_data=response_data,
1032
+ response_types_map=_response_types_map,
1033
+ )
1034
+
1035
+
1036
+ @validate_call
1037
+ def post_create_table_tables_post_without_preload_content(
1038
+ self,
1039
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40)],
1040
+ request: Request,
1041
+ _request_timeout: Union[
1042
+ None,
1043
+ Annotated[StrictFloat, Field(gt=0)],
1044
+ Tuple[
1045
+ Annotated[StrictFloat, Field(gt=0)],
1046
+ Annotated[StrictFloat, Field(gt=0)]
1047
+ ]
1048
+ ] = None,
1049
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1050
+ _content_type: Optional[StrictStr] = None,
1051
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1052
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1053
+ ) -> RESTResponseType:
1054
+ """Create Table
1055
+
1056
+ Creates a new Table. Use this endpoint to configure the schema, column structure, and metadata of the table. Use **Insert Table Rows** to add rows to your table. If you want to upload a local dataset, use the CLI: `shaped create_dataset_from_uri` Schema type: Different sources have different configuration. The `schema_type` argument specifies the type of table you are creating (Snowflake, SQL, Amplitude, etc). Unique keys and replication keys: Tables are append-only. In case of duplicates, we use the `unique_keys` and `replication_key` attributes to determine the correct value for a record.
1057
+
1058
+ :param x_api_key: (required)
1059
+ :type x_api_key: str
1060
+ :param request: (required)
1061
+ :type request: Request
1062
+ :param _request_timeout: timeout setting for this request. If one
1063
+ number provided, it will be total request
1064
+ timeout. It can also be a pair (tuple) of
1065
+ (connection, read) timeouts.
1066
+ :type _request_timeout: int, tuple(int, int), optional
1067
+ :param _request_auth: set to override the auth_settings for an a single
1068
+ request; this effectively ignores the
1069
+ authentication in the spec for a single request.
1070
+ :type _request_auth: dict, optional
1071
+ :param _content_type: force content-type for the request.
1072
+ :type _content_type: str, Optional
1073
+ :param _headers: set to override the headers for a single
1074
+ request; this effectively ignores the headers
1075
+ in the spec for a single request.
1076
+ :type _headers: dict, optional
1077
+ :param _host_index: set to override the host_index for a single
1078
+ request; this effectively ignores the host_index
1079
+ in the spec for a single request.
1080
+ :type _host_index: int, optional
1081
+ :return: Returns the result object.
1082
+ """ # noqa: E501
1083
+
1084
+ _param = self._post_create_table_tables_post_serialize(
1085
+ x_api_key=x_api_key,
1086
+ request=request,
1087
+ _request_auth=_request_auth,
1088
+ _content_type=_content_type,
1089
+ _headers=_headers,
1090
+ _host_index=_host_index
1091
+ )
1092
+
1093
+ _response_types_map: Dict[str, Optional[str]] = {
1094
+ '200': "CreateTableResponse",
1095
+ '400': "HttpProblemResponse",
1096
+ '409': "HttpProblemResponse",
1097
+ '422': "HttpProblemResponse",
1098
+ }
1099
+ response_data = self.api_client.call_api(
1100
+ *_param,
1101
+ _request_timeout=_request_timeout
1102
+ )
1103
+ return response_data.response
1104
+
1105
+
1106
+ def _post_create_table_tables_post_serialize(
1107
+ self,
1108
+ x_api_key,
1109
+ request,
1110
+ _request_auth,
1111
+ _content_type,
1112
+ _headers,
1113
+ _host_index,
1114
+ ) -> RequestSerialized:
1115
+
1116
+ _host = None
1117
+
1118
+ _collection_formats: Dict[str, str] = {
1119
+ }
1120
+
1121
+ _path_params: Dict[str, str] = {}
1122
+ _query_params: List[Tuple[str, str]] = []
1123
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1124
+ _form_params: List[Tuple[str, str]] = []
1125
+ _files: Dict[
1126
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1127
+ ] = {}
1128
+ _body_params: Optional[bytes] = None
1129
+
1130
+ # process the path parameters
1131
+ # process the query parameters
1132
+ # process the header parameters
1133
+ if x_api_key is not None:
1134
+ _header_params['x-api-key'] = x_api_key
1135
+ # process the form parameters
1136
+ # process the body parameter
1137
+ if request is not None:
1138
+ _body_params = request
1139
+
1140
+
1141
+ # set the HTTP header `Accept`
1142
+ if 'Accept' not in _header_params:
1143
+ _header_params['Accept'] = self.api_client.select_header_accept(
1144
+ [
1145
+ 'application/json'
1146
+ ]
1147
+ )
1148
+
1149
+ # set the HTTP header `Content-Type`
1150
+ if _content_type:
1151
+ _header_params['Content-Type'] = _content_type
1152
+ else:
1153
+ _default_content_type = (
1154
+ self.api_client.select_header_content_type(
1155
+ [
1156
+ 'application/json'
1157
+ ]
1158
+ )
1159
+ )
1160
+ if _default_content_type is not None:
1161
+ _header_params['Content-Type'] = _default_content_type
1162
+
1163
+ # authentication setting
1164
+ _auth_settings: List[str] = [
1165
+ ]
1166
+
1167
+ return self.api_client.param_serialize(
1168
+ method='POST',
1169
+ resource_path='/tables',
1170
+ path_params=_path_params,
1171
+ query_params=_query_params,
1172
+ header_params=_header_params,
1173
+ body=_body_params,
1174
+ post_params=_form_params,
1175
+ files=_files,
1176
+ auth_settings=_auth_settings,
1177
+ collection_formats=_collection_formats,
1178
+ _host=_host,
1179
+ _request_auth=_request_auth
1180
+ )
1181
+
1182
+
1183
+
1184
+
1185
+ @validate_call
1186
+ def post_table_insert_tables_table_name_insert_post(
1187
+ self,
1188
+ table_name: Annotated[StrictStr, Field(description="Name of the table to insert data into.")],
1189
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40)],
1190
+ table_insert_arguments: TableInsertArguments,
1191
+ _request_timeout: Union[
1192
+ None,
1193
+ Annotated[StrictFloat, Field(gt=0)],
1194
+ Tuple[
1195
+ Annotated[StrictFloat, Field(gt=0)],
1196
+ Annotated[StrictFloat, Field(gt=0)]
1197
+ ]
1198
+ ] = None,
1199
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1200
+ _content_type: Optional[StrictStr] = None,
1201
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1202
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1203
+ ) -> TableInsertResponse:
1204
+ """Table Insert
1205
+
1206
+ Insert dictionary data into Shaped table. The schema must match the schema of the table or it'll throw an error. Tables are append-only. In case of duplicates, we use the `unique_keys` and `replication_key` attributes to determine the correct value for a record. Batch tables are updated every 15 minutes while real-time tables are updated immediately.
1207
+
1208
+ :param table_name: Name of the table to insert data into. (required)
1209
+ :type table_name: str
1210
+ :param x_api_key: (required)
1211
+ :type x_api_key: str
1212
+ :param table_insert_arguments: (required)
1213
+ :type table_insert_arguments: TableInsertArguments
1214
+ :param _request_timeout: timeout setting for this request. If one
1215
+ number provided, it will be total request
1216
+ timeout. It can also be a pair (tuple) of
1217
+ (connection, read) timeouts.
1218
+ :type _request_timeout: int, tuple(int, int), optional
1219
+ :param _request_auth: set to override the auth_settings for an a single
1220
+ request; this effectively ignores the
1221
+ authentication in the spec for a single request.
1222
+ :type _request_auth: dict, optional
1223
+ :param _content_type: force content-type for the request.
1224
+ :type _content_type: str, Optional
1225
+ :param _headers: set to override the headers for a single
1226
+ request; this effectively ignores the headers
1227
+ in the spec for a single request.
1228
+ :type _headers: dict, optional
1229
+ :param _host_index: set to override the host_index for a single
1230
+ request; this effectively ignores the host_index
1231
+ in the spec for a single request.
1232
+ :type _host_index: int, optional
1233
+ :return: Returns the result object.
1234
+ """ # noqa: E501
1235
+
1236
+ _param = self._post_table_insert_tables_table_name_insert_post_serialize(
1237
+ table_name=table_name,
1238
+ x_api_key=x_api_key,
1239
+ table_insert_arguments=table_insert_arguments,
1240
+ _request_auth=_request_auth,
1241
+ _content_type=_content_type,
1242
+ _headers=_headers,
1243
+ _host_index=_host_index
1244
+ )
1245
+
1246
+ _response_types_map: Dict[str, Optional[str]] = {
1247
+ '200': "TableInsertResponse",
1248
+ '400': "HttpProblemResponse",
1249
+ '404': "HttpProblemResponse",
1250
+ '422': "HTTPValidationError",
1251
+ }
1252
+ response_data = self.api_client.call_api(
1253
+ *_param,
1254
+ _request_timeout=_request_timeout
1255
+ )
1256
+ response_data.read()
1257
+ return self.api_client.response_deserialize(
1258
+ response_data=response_data,
1259
+ response_types_map=_response_types_map,
1260
+ ).data
1261
+
1262
+
1263
+ @validate_call
1264
+ def post_table_insert_tables_table_name_insert_post_with_http_info(
1265
+ self,
1266
+ table_name: Annotated[StrictStr, Field(description="Name of the table to insert data into.")],
1267
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40)],
1268
+ table_insert_arguments: TableInsertArguments,
1269
+ _request_timeout: Union[
1270
+ None,
1271
+ Annotated[StrictFloat, Field(gt=0)],
1272
+ Tuple[
1273
+ Annotated[StrictFloat, Field(gt=0)],
1274
+ Annotated[StrictFloat, Field(gt=0)]
1275
+ ]
1276
+ ] = None,
1277
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1278
+ _content_type: Optional[StrictStr] = None,
1279
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1280
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1281
+ ) -> ApiResponse[TableInsertResponse]:
1282
+ """Table Insert
1283
+
1284
+ Insert dictionary data into Shaped table. The schema must match the schema of the table or it'll throw an error. Tables are append-only. In case of duplicates, we use the `unique_keys` and `replication_key` attributes to determine the correct value for a record. Batch tables are updated every 15 minutes while real-time tables are updated immediately.
1285
+
1286
+ :param table_name: Name of the table to insert data into. (required)
1287
+ :type table_name: str
1288
+ :param x_api_key: (required)
1289
+ :type x_api_key: str
1290
+ :param table_insert_arguments: (required)
1291
+ :type table_insert_arguments: TableInsertArguments
1292
+ :param _request_timeout: timeout setting for this request. If one
1293
+ number provided, it will be total request
1294
+ timeout. It can also be a pair (tuple) of
1295
+ (connection, read) timeouts.
1296
+ :type _request_timeout: int, tuple(int, int), optional
1297
+ :param _request_auth: set to override the auth_settings for an a single
1298
+ request; this effectively ignores the
1299
+ authentication in the spec for a single request.
1300
+ :type _request_auth: dict, optional
1301
+ :param _content_type: force content-type for the request.
1302
+ :type _content_type: str, Optional
1303
+ :param _headers: set to override the headers for a single
1304
+ request; this effectively ignores the headers
1305
+ in the spec for a single request.
1306
+ :type _headers: dict, optional
1307
+ :param _host_index: set to override the host_index for a single
1308
+ request; this effectively ignores the host_index
1309
+ in the spec for a single request.
1310
+ :type _host_index: int, optional
1311
+ :return: Returns the result object.
1312
+ """ # noqa: E501
1313
+
1314
+ _param = self._post_table_insert_tables_table_name_insert_post_serialize(
1315
+ table_name=table_name,
1316
+ x_api_key=x_api_key,
1317
+ table_insert_arguments=table_insert_arguments,
1318
+ _request_auth=_request_auth,
1319
+ _content_type=_content_type,
1320
+ _headers=_headers,
1321
+ _host_index=_host_index
1322
+ )
1323
+
1324
+ _response_types_map: Dict[str, Optional[str]] = {
1325
+ '200': "TableInsertResponse",
1326
+ '400': "HttpProblemResponse",
1327
+ '404': "HttpProblemResponse",
1328
+ '422': "HTTPValidationError",
1329
+ }
1330
+ response_data = self.api_client.call_api(
1331
+ *_param,
1332
+ _request_timeout=_request_timeout
1333
+ )
1334
+ response_data.read()
1335
+ return self.api_client.response_deserialize(
1336
+ response_data=response_data,
1337
+ response_types_map=_response_types_map,
1338
+ )
1339
+
1340
+
1341
+ @validate_call
1342
+ def post_table_insert_tables_table_name_insert_post_without_preload_content(
1343
+ self,
1344
+ table_name: Annotated[StrictStr, Field(description="Name of the table to insert data into.")],
1345
+ x_api_key: Annotated[str, Field(min_length=40, strict=True, max_length=40)],
1346
+ table_insert_arguments: TableInsertArguments,
1347
+ _request_timeout: Union[
1348
+ None,
1349
+ Annotated[StrictFloat, Field(gt=0)],
1350
+ Tuple[
1351
+ Annotated[StrictFloat, Field(gt=0)],
1352
+ Annotated[StrictFloat, Field(gt=0)]
1353
+ ]
1354
+ ] = None,
1355
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1356
+ _content_type: Optional[StrictStr] = None,
1357
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1358
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1359
+ ) -> RESTResponseType:
1360
+ """Table Insert
1361
+
1362
+ Insert dictionary data into Shaped table. The schema must match the schema of the table or it'll throw an error. Tables are append-only. In case of duplicates, we use the `unique_keys` and `replication_key` attributes to determine the correct value for a record. Batch tables are updated every 15 minutes while real-time tables are updated immediately.
1363
+
1364
+ :param table_name: Name of the table to insert data into. (required)
1365
+ :type table_name: str
1366
+ :param x_api_key: (required)
1367
+ :type x_api_key: str
1368
+ :param table_insert_arguments: (required)
1369
+ :type table_insert_arguments: TableInsertArguments
1370
+ :param _request_timeout: timeout setting for this request. If one
1371
+ number provided, it will be total request
1372
+ timeout. It can also be a pair (tuple) of
1373
+ (connection, read) timeouts.
1374
+ :type _request_timeout: int, tuple(int, int), optional
1375
+ :param _request_auth: set to override the auth_settings for an a single
1376
+ request; this effectively ignores the
1377
+ authentication in the spec for a single request.
1378
+ :type _request_auth: dict, optional
1379
+ :param _content_type: force content-type for the request.
1380
+ :type _content_type: str, Optional
1381
+ :param _headers: set to override the headers for a single
1382
+ request; this effectively ignores the headers
1383
+ in the spec for a single request.
1384
+ :type _headers: dict, optional
1385
+ :param _host_index: set to override the host_index for a single
1386
+ request; this effectively ignores the host_index
1387
+ in the spec for a single request.
1388
+ :type _host_index: int, optional
1389
+ :return: Returns the result object.
1390
+ """ # noqa: E501
1391
+
1392
+ _param = self._post_table_insert_tables_table_name_insert_post_serialize(
1393
+ table_name=table_name,
1394
+ x_api_key=x_api_key,
1395
+ table_insert_arguments=table_insert_arguments,
1396
+ _request_auth=_request_auth,
1397
+ _content_type=_content_type,
1398
+ _headers=_headers,
1399
+ _host_index=_host_index
1400
+ )
1401
+
1402
+ _response_types_map: Dict[str, Optional[str]] = {
1403
+ '200': "TableInsertResponse",
1404
+ '400': "HttpProblemResponse",
1405
+ '404': "HttpProblemResponse",
1406
+ '422': "HTTPValidationError",
1407
+ }
1408
+ response_data = self.api_client.call_api(
1409
+ *_param,
1410
+ _request_timeout=_request_timeout
1411
+ )
1412
+ return response_data.response
1413
+
1414
+
1415
+ def _post_table_insert_tables_table_name_insert_post_serialize(
1416
+ self,
1417
+ table_name,
1418
+ x_api_key,
1419
+ table_insert_arguments,
1420
+ _request_auth,
1421
+ _content_type,
1422
+ _headers,
1423
+ _host_index,
1424
+ ) -> RequestSerialized:
1425
+
1426
+ _host = None
1427
+
1428
+ _collection_formats: Dict[str, str] = {
1429
+ }
1430
+
1431
+ _path_params: Dict[str, str] = {}
1432
+ _query_params: List[Tuple[str, str]] = []
1433
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1434
+ _form_params: List[Tuple[str, str]] = []
1435
+ _files: Dict[
1436
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1437
+ ] = {}
1438
+ _body_params: Optional[bytes] = None
1439
+
1440
+ # process the path parameters
1441
+ if table_name is not None:
1442
+ _path_params['table_name'] = table_name
1443
+ # process the query parameters
1444
+ # process the header parameters
1445
+ if x_api_key is not None:
1446
+ _header_params['x-api-key'] = x_api_key
1447
+ # process the form parameters
1448
+ # process the body parameter
1449
+ if table_insert_arguments is not None:
1450
+ _body_params = table_insert_arguments
1451
+
1452
+
1453
+ # set the HTTP header `Accept`
1454
+ if 'Accept' not in _header_params:
1455
+ _header_params['Accept'] = self.api_client.select_header_accept(
1456
+ [
1457
+ 'application/json'
1458
+ ]
1459
+ )
1460
+
1461
+ # set the HTTP header `Content-Type`
1462
+ if _content_type:
1463
+ _header_params['Content-Type'] = _content_type
1464
+ else:
1465
+ _default_content_type = (
1466
+ self.api_client.select_header_content_type(
1467
+ [
1468
+ 'application/json'
1469
+ ]
1470
+ )
1471
+ )
1472
+ if _default_content_type is not None:
1473
+ _header_params['Content-Type'] = _default_content_type
1474
+
1475
+ # authentication setting
1476
+ _auth_settings: List[str] = [
1477
+ ]
1478
+
1479
+ return self.api_client.param_serialize(
1480
+ method='POST',
1481
+ resource_path='/tables/{table_name}/insert',
1482
+ path_params=_path_params,
1483
+ query_params=_query_params,
1484
+ header_params=_header_params,
1485
+ body=_body_params,
1486
+ post_params=_form_params,
1487
+ files=_files,
1488
+ auth_settings=_auth_settings,
1489
+ collection_formats=_collection_formats,
1490
+ _host=_host,
1491
+ _request_auth=_request_auth
1492
+ )
1493
+
1494
+