api-sdk-rb 1.11.111 → 1.11.133

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 (180) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +207 -381
  3. data/docs/{GetPartnerCreditTransactions200Response.md → AccountCreditTransactionListResponse.md} +2 -2
  4. data/docs/{GetUserAdapterConnections200Response.md → AdapterConnectionListResponse.md} +2 -2
  5. data/docs/{RemoveUserAdapterConnection200Response.md → AdapterConnectionRemovalResponse.md} +2 -2
  6. data/docs/{SetUserAdapterConnection200Response.md → AdapterConnectionResponse.md} +2 -2
  7. data/docs/{AddAiAnswersKnowledgeDocument201Response.md → AiAnswersKnowledgeDocumentResponse.md} +2 -2
  8. data/docs/BrandKitApi.md +74 -74
  9. data/docs/BrandKitTokens.md +2 -0
  10. data/docs/BrandKitView.md +1 -1
  11. data/docs/BrandTextStyle.md +22 -0
  12. data/docs/CanvasesApi.md +45 -45
  13. data/docs/{CreateCompositionDatabaseRecord201Response.md → CompositionDatabaseRecordResponse.md} +2 -2
  14. data/docs/CompositionsApi.md +615 -349
  15. data/docs/{CreateCompositionContentItem201Response.md → ContentItemWriteResultResponse.md} +2 -2
  16. data/docs/CreditsApi.md +20 -20
  17. data/docs/{CreateCompositionFromWidget201Response.md → DeleteUpload200Response.md} +3 -3
  18. data/docs/{UploadsIdDelete200ResponseData.md → DeleteUpload200ResponseData.md} +2 -2
  19. data/docs/{GetPartnerDesignDefaults200Response.md → DesignDefaultsResponse.md} +2 -2
  20. data/docs/EntitlementsApi.md +18 -18
  21. data/docs/{OperationsIdGetResponse.md → GetOperationResponse.md} +3 -3
  22. data/docs/{OperationsIdGetResponseData.md → GetOperationResponseData.md} +3 -3
  23. data/docs/GetOperationResponseDataMetadata.md +24 -0
  24. data/docs/InvoicesApi.md +9 -9
  25. data/docs/{UploadsGet200Response.md → ListUploads200Response.md} +2 -2
  26. data/docs/{GetManagedUserLimits200Response.md → ManagedUserLimitsResponse.md} +2 -2
  27. data/docs/{DeleteManagedUser200Response.md → ManagedUserRemovalResponse.md} +2 -2
  28. data/docs/ManagedUsersApi.md +261 -171
  29. data/docs/OperationsApi.md +11 -11
  30. data/docs/PartnersApi.md +388 -388
  31. data/docs/PatchBrandKitRequest.md +2 -0
  32. data/docs/PublicEmbedApi.md +95 -95
  33. data/docs/PublicWorkflowEventsRequestEventsInner.md +3 -1
  34. data/docs/{GetPublicWorkflow200Response.md → PublicWorkflowResponse.md} +2 -2
  35. data/docs/TokensApi.md +11 -9
  36. data/docs/Upload.md +1 -1
  37. data/docs/UploadLimits.md +3 -3
  38. data/docs/UploadsApi.md +85 -85
  39. data/docs/UsersApi.md +125 -125
  40. data/docs/WidgetClarification.md +22 -0
  41. data/docs/WidgetClarificationOption.md +22 -0
  42. data/docs/WidgetClarificationQuestion.md +26 -0
  43. data/docs/WidgetNextStep.md +24 -0
  44. data/docs/WidgetPlan.md +26 -0
  45. data/docs/WidgetPlanDecisions.md +32 -0
  46. data/docs/WidgetPlanDecisionsAdaptersInner.md +20 -0
  47. data/docs/WidgetPlanDecisionsLibrariesInner.md +22 -0
  48. data/docs/WidgetPlanDecisionsResponsive.md +22 -0
  49. data/docs/WidgetPlanTask.md +24 -0
  50. data/docs/WidgetsApi.md +38 -38
  51. data/docs/{CreateWorkspaceWorkflowFromPreset201Response.md → WorkflowDetailResponse.md} +2 -2
  52. data/docs/WorkflowFailureReason.md +15 -0
  53. data/docs/WorkflowFailureReasonCounter.md +22 -0
  54. data/docs/{SaveWorkspaceWorkflow200Response.md → WorkflowResponse.md} +2 -2
  55. data/docs/WorkflowStats.md +4 -2
  56. data/docs/WorkflowsApi.md +197 -413
  57. data/lib/api-sdk-rb/api/brand_kit_api.rb +61 -61
  58. data/lib/api-sdk-rb/api/canvases_api.rb +39 -39
  59. data/lib/api-sdk-rb/api/compositions_api.rb +770 -441
  60. data/lib/api-sdk-rb/api/credits_api.rb +20 -20
  61. data/lib/api-sdk-rb/api/entitlements_api.rb +14 -14
  62. data/lib/api-sdk-rb/api/invoices_api.rb +10 -10
  63. data/lib/api-sdk-rb/api/managed_users_api.rb +278 -172
  64. data/lib/api-sdk-rb/api/operations_api.rb +10 -10
  65. data/lib/api-sdk-rb/api/partners_api.rb +389 -389
  66. data/lib/api-sdk-rb/api/public_embed_api.rb +95 -95
  67. data/lib/api-sdk-rb/api/tokens_api.rb +8 -6
  68. data/lib/api-sdk-rb/api/uploads_api.rb +96 -96
  69. data/lib/api-sdk-rb/api/users_api.rb +132 -132
  70. data/lib/api-sdk-rb/api/widgets_api.rb +40 -40
  71. data/lib/api-sdk-rb/api/workflows_api.rb +246 -468
  72. data/lib/api-sdk-rb/configuration.rb +0 -60
  73. data/lib/api-sdk-rb/models/{get_user_adapter_connections200_response.rb → account_credit_transaction_list_response.rb} +4 -4
  74. data/lib/api-sdk-rb/models/{get_partner_credit_transactions200_response.rb → adapter_connection_list_response.rb} +4 -4
  75. data/lib/api-sdk-rb/models/{save_workspace_workflow200_response.rb → adapter_connection_removal_response.rb} +4 -4
  76. data/lib/api-sdk-rb/models/{set_user_adapter_connection200_response.rb → adapter_connection_response.rb} +3 -3
  77. data/lib/api-sdk-rb/models/{add_ai_answers_knowledge_document201_response.rb → ai_answers_knowledge_document_response.rb} +3 -3
  78. data/lib/api-sdk-rb/models/brand_kit_tokens.rb +33 -2
  79. data/lib/api-sdk-rb/models/brand_kit_view.rb +1 -1
  80. data/lib/api-sdk-rb/models/brand_text_style.rb +344 -0
  81. data/lib/api-sdk-rb/models/{create_composition_database_record201_response.rb → composition_database_record_response.rb} +3 -3
  82. data/lib/api-sdk-rb/models/{create_composition_content_item201_response.rb → content_item_write_result_response.rb} +3 -3
  83. data/lib/api-sdk-rb/models/{operations_id_get_response.rb → delete_upload200_response.rb} +4 -5
  84. data/lib/api-sdk-rb/models/{uploads_id_delete200_response_data.rb → delete_upload200_response_data.rb} +3 -3
  85. data/lib/api-sdk-rb/models/{get_partner_design_defaults200_response.rb → design_defaults_response.rb} +3 -3
  86. data/lib/api-sdk-rb/models/get_operation_response.rb +247 -0
  87. data/lib/api-sdk-rb/models/{operations_id_get_response_data.rb → get_operation_response_data.rb} +5 -8
  88. data/lib/api-sdk-rb/models/get_operation_response_data_metadata.rb +283 -0
  89. data/lib/api-sdk-rb/models/{uploads_get200_response.rb → list_uploads200_response.rb} +3 -3
  90. data/lib/api-sdk-rb/models/{get_managed_user_limits200_response.rb → managed_user_limits_response.rb} +3 -3
  91. data/lib/api-sdk-rb/models/{uploads_id_delete200_response.rb → managed_user_removal_response.rb} +4 -4
  92. data/lib/api-sdk-rb/models/patch_brand_kit_request.rb +32 -1
  93. data/lib/api-sdk-rb/models/public_workflow_events_request_events_inner.rb +26 -4
  94. data/lib/api-sdk-rb/models/{get_public_workflow200_response.rb → public_workflow_response.rb} +3 -3
  95. data/lib/api-sdk-rb/models/upload.rb +1 -1
  96. data/lib/api-sdk-rb/models/upload_limits.rb +3 -3
  97. data/lib/api-sdk-rb/models/widget_clarification.rb +279 -0
  98. data/lib/api-sdk-rb/models/{create_composition_from_widget201_response.rb → widget_clarification_option.rb} +40 -30
  99. data/lib/api-sdk-rb/models/widget_clarification_question.rb +329 -0
  100. data/lib/api-sdk-rb/models/widget_next_step.rb +307 -0
  101. data/lib/api-sdk-rb/models/widget_plan.rb +306 -0
  102. data/lib/api-sdk-rb/models/widget_plan_decisions.rb +346 -0
  103. data/lib/api-sdk-rb/models/widget_plan_decisions_adapters_inner.rb +237 -0
  104. data/lib/api-sdk-rb/models/{create_workspace_workflow_from_preset201_response.rb → widget_plan_decisions_libraries_inner.rb} +39 -30
  105. data/lib/api-sdk-rb/models/widget_plan_decisions_responsive.rb +311 -0
  106. data/lib/api-sdk-rb/models/widget_plan_task.rb +320 -0
  107. data/lib/api-sdk-rb/models/{delete_managed_user200_response.rb → workflow_detail_response.rb} +4 -4
  108. data/lib/api-sdk-rb/models/workflow_failure_reason.rb +42 -0
  109. data/lib/api-sdk-rb/models/workflow_failure_reason_counter.rb +277 -0
  110. data/lib/api-sdk-rb/models/workflow_response.rb +246 -0
  111. data/lib/api-sdk-rb/models/workflow_stats.rb +17 -5
  112. data/lib/api-sdk-rb/version.rb +1 -1
  113. data/lib/api-sdk-rb.rb +32 -21
  114. data/spec/api/brand_kit_api_spec.rb +18 -18
  115. data/spec/api/canvases_api_spec.rb +10 -10
  116. data/spec/api/compositions_api_spec.rb +144 -83
  117. data/spec/api/credits_api_spec.rb +5 -5
  118. data/spec/api/entitlements_api_spec.rb +4 -4
  119. data/spec/api/invoices_api_spec.rb +2 -2
  120. data/spec/api/managed_users_api_spec.rb +63 -42
  121. data/spec/api/operations_api_spec.rb +3 -3
  122. data/spec/api/partners_api_spec.rb +91 -91
  123. data/spec/api/public_embed_api_spec.rb +23 -23
  124. data/spec/api/tokens_api_spec.rb +3 -2
  125. data/spec/api/uploads_api_spec.rb +24 -24
  126. data/spec/api/users_api_spec.rb +30 -30
  127. data/spec/api/widgets_api_spec.rb +9 -9
  128. data/spec/api/workflows_api_spec.rb +50 -89
  129. data/spec/models/{get_user_adapter_connections200_response_spec.rb → account_credit_transaction_list_response_spec.rb} +6 -6
  130. data/spec/models/{get_public_workflow200_response_spec.rb → adapter_connection_list_response_spec.rb} +6 -6
  131. data/spec/models/{save_workspace_workflow200_response_spec.rb → adapter_connection_removal_response_spec.rb} +6 -6
  132. data/spec/models/{delete_managed_user200_response_spec.rb → adapter_connection_response_spec.rb} +6 -6
  133. data/spec/models/ai_answers_knowledge_document_response_spec.rb +48 -0
  134. data/spec/models/brand_kit_tokens_spec.rb +6 -0
  135. data/spec/models/{create_composition_from_widget201_response_spec.rb → brand_text_style_spec.rb} +13 -9
  136. data/spec/models/{get_managed_user_limits200_response_spec.rb → composition_database_record_response_spec.rb} +6 -6
  137. data/spec/models/content_item_write_result_response_spec.rb +48 -0
  138. data/spec/models/{uploads_id_delete200_response_data_spec.rb → delete_upload200_response_data_spec.rb} +6 -6
  139. data/spec/models/{operations_id_get_response_spec.rb → delete_upload200_response_spec.rb} +6 -6
  140. data/spec/models/design_defaults_response_spec.rb +48 -0
  141. data/spec/models/get_operation_response_data_metadata_spec.rb +58 -0
  142. data/spec/models/{operations_id_get_response_data_spec.rb → get_operation_response_data_spec.rb} +6 -6
  143. data/spec/models/{uploads_get200_response_spec.rb → get_operation_response_spec.rb} +6 -6
  144. data/spec/models/list_uploads200_response_spec.rb +48 -0
  145. data/spec/models/managed_user_limits_response_spec.rb +48 -0
  146. data/spec/models/{uploads_id_delete200_response_spec.rb → managed_user_removal_response_spec.rb} +6 -6
  147. data/spec/models/patch_brand_kit_request_spec.rb +6 -0
  148. data/spec/models/public_workflow_events_request_events_inner_spec.rb +10 -0
  149. data/spec/models/public_workflow_response_spec.rb +48 -0
  150. data/spec/models/widget_clarification_option_spec.rb +48 -0
  151. data/spec/models/widget_clarification_question_spec.rb +60 -0
  152. data/spec/models/widget_clarification_spec.rb +48 -0
  153. data/spec/models/widget_next_step_spec.rb +58 -0
  154. data/spec/models/widget_plan_decisions_adapters_inner_spec.rb +42 -0
  155. data/spec/models/widget_plan_decisions_libraries_inner_spec.rb +48 -0
  156. data/spec/models/widget_plan_decisions_responsive_spec.rb +48 -0
  157. data/spec/models/widget_plan_decisions_spec.rb +78 -0
  158. data/spec/models/{create_composition_database_record201_response_spec.rb → widget_plan_spec.rb} +21 -9
  159. data/spec/models/widget_plan_task_spec.rb +62 -0
  160. data/spec/models/workflow_detail_response_spec.rb +48 -0
  161. data/spec/models/workflow_failure_reason_counter_spec.rb +48 -0
  162. data/spec/models/workflow_failure_reason_spec.rb +30 -0
  163. data/spec/models/workflow_response_spec.rb +48 -0
  164. data/spec/models/workflow_stats_spec.rb +6 -0
  165. metadata +130 -86
  166. data/docs/PartnerApi.md +0 -12714
  167. data/docs/UploadsIdDelete200Response.md +0 -22
  168. data/docs/WorkspacesApi.md +0 -1527
  169. data/lib/api-sdk-rb/api/partner_api.rb +0 -13791
  170. data/lib/api-sdk-rb/api/workspaces_api.rb +0 -1775
  171. data/lib/api-sdk-rb/models/remove_user_adapter_connection200_response.rb +0 -246
  172. data/spec/api/partner_api_spec.rb +0 -2437
  173. data/spec/api/workspaces_api_spec.rb +0 -339
  174. data/spec/models/add_ai_answers_knowledge_document201_response_spec.rb +0 -48
  175. data/spec/models/create_composition_content_item201_response_spec.rb +0 -48
  176. data/spec/models/create_workspace_workflow_from_preset201_response_spec.rb +0 -48
  177. data/spec/models/get_partner_credit_transactions200_response_spec.rb +0 -48
  178. data/spec/models/get_partner_design_defaults200_response_spec.rb +0 -48
  179. data/spec/models/remove_user_adapter_connection200_response_spec.rb +0 -48
  180. data/spec/models/set_user_adapter_connection200_response_spec.rb +0 -48
@@ -20,19 +20,21 @@ module ApiSdkRb
20
20
  @api_client = api_client
21
21
  end
22
22
  # Validate current authentication token
23
+ # Describes the credential the request was made with: how it signs in (`tokenType`), what it may do (`scopes`) and the account it belongs to (`userId`). A credential that belongs to the platform itself, and not to a customer's account, is held to no scope: it is answered with `tokenType` `service_key`, `scopes` `[\"*:*\"]` and no `userId`.
23
24
  # @param [Hash] opts the optional parameters
24
25
  # @return [ValidateToken200Response]
25
- def validate_token_0(opts = {})
26
- data, _status_code, _headers = validate_token_0_with_http_info(opts)
26
+ def validate_token(opts = {})
27
+ data, _status_code, _headers = validate_token_with_http_info(opts)
27
28
  data
28
29
  end
29
30
 
30
31
  # Validate current authentication token
32
+ # Describes the credential the request was made with: how it signs in (`tokenType`), what it may do (`scopes`) and the account it belongs to (`userId`). A credential that belongs to the platform itself, and not to a customer's account, is held to no scope: it is answered with `tokenType` `service_key`, `scopes` `[\"*:*\"]` and no `userId`.
31
33
  # @param [Hash] opts the optional parameters
32
34
  # @return [Array<(ValidateToken200Response, Integer, Hash)>] ValidateToken200Response data, response status code and response headers
33
- def validate_token_0_with_http_info(opts = {})
35
+ def validate_token_with_http_info(opts = {})
34
36
  if @api_client.config.debugging
35
- @api_client.config.logger.debug 'Calling API: TokensApi.validate_token_0 ...'
37
+ @api_client.config.logger.debug 'Calling API: TokensApi.validate_token ...'
36
38
  end
37
39
  # resource path
38
40
  local_var_path = '/tokens/validate'
@@ -58,7 +60,7 @@ module ApiSdkRb
58
60
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
59
61
 
60
62
  new_options = opts.merge(
61
- :operation => :"TokensApi.validate_token_0",
63
+ :operation => :"TokensApi.validate_token",
62
64
  :header_params => header_params,
63
65
  :query_params => query_params,
64
66
  :form_params => form_params,
@@ -69,7 +71,7 @@ module ApiSdkRb
69
71
 
70
72
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
71
73
  if @api_client.config.debugging
72
- @api_client.config.logger.debug "API called: TokensApi#validate_token_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
74
+ @api_client.config.logger.debug "API called: TokensApi#validate_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
73
75
  end
74
76
  return data, status_code, headers
75
77
  end
@@ -19,49 +19,34 @@ module ApiSdkRb
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # List the account's uploads
23
- # The files the account has uploaded, newest first. Deleted files are not listed. Returns at most `limit` files and has no further pages: a client that needs more narrows the list instead, for example to one managed user's files with `managedUserId` or `managedUserExternalId`. The files that visitors sent through a widget's upload adapter (`source` is `widget-visitor-upload`) are not part of this list, so that a popular widget does not push the account's own files out of it; naming one widget with `widgetId` lists what visitors sent to that widget as well.
22
+ # Delete an upload
23
+ # Removes the stored file and the upload row. A file in Widgetic's own storage gives back the space it took from your storage allowance; a file in your own bucket is removed from your bucket. Deleting an upload that is already gone succeeds the same way as the first delete. An upload that belongs to another account is not found. If the storage cannot be reached the call fails and nothing is marked deleted, so it can be repeated.
24
+ # @param id [String]
24
25
  # @param [Hash] opts the optional parameters
25
- # @option opts [Integer] :limit Maximum number of files to return (default to 50)
26
- # @option opts [String] :managed_user_id List only the files uploaded for this managed user (Widgetic&#39;s id for the user). Send this or &#x60;managedUserExternalId&#x60;, not both.
27
- # @option opts [String] :managed_user_external_id List only the files uploaded for the managed user you registered with this &#x60;externalId&#x60; (your own identifier for the user). Send this or &#x60;managedUserId&#x60;, not both.
28
- # @return [UploadsGet200Response]
29
- def uploads_get_0(opts = {})
30
- data, _status_code, _headers = uploads_get_0_with_http_info(opts)
26
+ # @return [DeleteUpload200Response]
27
+ def delete_upload(id, opts = {})
28
+ data, _status_code, _headers = delete_upload_with_http_info(id, opts)
31
29
  data
32
30
  end
33
31
 
34
- # List the account&#39;s uploads
35
- # The files the account has uploaded, newest first. Deleted files are not listed. Returns at most &#x60;limit&#x60; files and has no further pages: a client that needs more narrows the list instead, for example to one managed user&#39;s files with &#x60;managedUserId&#x60; or &#x60;managedUserExternalId&#x60;. The files that visitors sent through a widget&#39;s upload adapter (&#x60;source&#x60; is &#x60;widget-visitor-upload&#x60;) are not part of this list, so that a popular widget does not push the account&#39;s own files out of it; naming one widget with &#x60;widgetId&#x60; lists what visitors sent to that widget as well.
32
+ # Delete an upload
33
+ # Removes the stored file and the upload row. A file in Widgetic&#39;s own storage gives back the space it took from your storage allowance; a file in your own bucket is removed from your bucket. Deleting an upload that is already gone succeeds the same way as the first delete. An upload that belongs to another account is not found. If the storage cannot be reached the call fails and nothing is marked deleted, so it can be repeated.
34
+ # @param id [String]
36
35
  # @param [Hash] opts the optional parameters
37
- # @option opts [Integer] :limit Maximum number of files to return (default to 50)
38
- # @option opts [String] :managed_user_id List only the files uploaded for this managed user (Widgetic&#39;s id for the user). Send this or &#x60;managedUserExternalId&#x60;, not both.
39
- # @option opts [String] :managed_user_external_id List only the files uploaded for the managed user you registered with this &#x60;externalId&#x60; (your own identifier for the user). Send this or &#x60;managedUserId&#x60;, not both.
40
- # @return [Array<(UploadsGet200Response, Integer, Hash)>] UploadsGet200Response data, response status code and response headers
41
- def uploads_get_0_with_http_info(opts = {})
36
+ # @return [Array<(DeleteUpload200Response, Integer, Hash)>] DeleteUpload200Response data, response status code and response headers
37
+ def delete_upload_with_http_info(id, opts = {})
42
38
  if @api_client.config.debugging
43
- @api_client.config.logger.debug 'Calling API: UploadsApi.uploads_get_0 ...'
39
+ @api_client.config.logger.debug 'Calling API: UploadsApi.delete_upload ...'
44
40
  end
45
- if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
46
- fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UploadsApi.uploads_get_0, must be smaller than or equal to 100.'
47
- end
48
-
49
- if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
50
- fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UploadsApi.uploads_get_0, must be greater than or equal to 1.'
51
- end
52
-
53
- if @api_client.config.client_side_validation && !opts[:'managed_user_external_id'].nil? && opts[:'managed_user_external_id'].to_s.length > 255
54
- fail ArgumentError, 'invalid value for "opts[:"managed_user_external_id"]" when calling UploadsApi.uploads_get_0, the character length must be smaller than or equal to 255.'
41
+ # verify the required parameter 'id' is set
42
+ if @api_client.config.client_side_validation && id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'id' when calling UploadsApi.delete_upload"
55
44
  end
56
-
57
45
  # resource path
58
- local_var_path = '/uploads'
46
+ local_var_path = '/uploads/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
59
47
 
60
48
  # query parameters
61
49
  query_params = opts[:query_params] || {}
62
- query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
63
- query_params[:'managedUserId'] = opts[:'managed_user_id'] if !opts[:'managed_user_id'].nil?
64
- query_params[:'managedUserExternalId'] = opts[:'managed_user_external_id'] if !opts[:'managed_user_external_id'].nil?
65
50
 
66
51
  # header parameters
67
52
  header_params = opts[:header_params] || {}
@@ -75,13 +60,13 @@ module ApiSdkRb
75
60
  post_body = opts[:debug_body]
76
61
 
77
62
  # return_type
78
- return_type = opts[:debug_return_type] || 'UploadsGet200Response'
63
+ return_type = opts[:debug_return_type] || 'DeleteUpload200Response'
79
64
 
80
65
  # auth_names
81
66
  auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
82
67
 
83
68
  new_options = opts.merge(
84
- :operation => :"UploadsApi.uploads_get_0",
69
+ :operation => :"UploadsApi.delete_upload",
85
70
  :header_params => header_params,
86
71
  :query_params => query_params,
87
72
  :form_params => form_params,
@@ -90,35 +75,35 @@ module ApiSdkRb
90
75
  :return_type => return_type
91
76
  )
92
77
 
93
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
78
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
94
79
  if @api_client.config.debugging
95
- @api_client.config.logger.debug "API called: UploadsApi#uploads_get_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
80
+ @api_client.config.logger.debug "API called: UploadsApi#delete_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
96
81
  end
97
82
  return data, status_code, headers
98
83
  end
99
84
 
100
- # Delete an upload
101
- # Removes the stored file and the upload row. A file in Widgetic's own storage gives back the space it took from your storage allowance; a file in your own bucket is removed from your bucket. Deleting an upload that is already gone succeeds the same way as the first delete. An upload that belongs to another account is not found. If the storage cannot be reached the call fails and nothing is marked deleted, so it can be repeated.
102
- # @param id [String]
85
+ # Get an upload by id
86
+ # The details of one of the account's uploads. An upload that belongs to another account is not found.
87
+ # @param id [String] The upload to read
103
88
  # @param [Hash] opts the optional parameters
104
- # @return [UploadsIdDelete200Response]
105
- def uploads_id_delete_0(id, opts = {})
106
- data, _status_code, _headers = uploads_id_delete_0_with_http_info(id, opts)
89
+ # @return [UploadResponse]
90
+ def get_upload(id, opts = {})
91
+ data, _status_code, _headers = get_upload_with_http_info(id, opts)
107
92
  data
108
93
  end
109
94
 
110
- # Delete an upload
111
- # Removes the stored file and the upload row. A file in Widgetic&#39;s own storage gives back the space it took from your storage allowance; a file in your own bucket is removed from your bucket. Deleting an upload that is already gone succeeds the same way as the first delete. An upload that belongs to another account is not found. If the storage cannot be reached the call fails and nothing is marked deleted, so it can be repeated.
112
- # @param id [String]
95
+ # Get an upload by id
96
+ # The details of one of the account&#39;s uploads. An upload that belongs to another account is not found.
97
+ # @param id [String] The upload to read
113
98
  # @param [Hash] opts the optional parameters
114
- # @return [Array<(UploadsIdDelete200Response, Integer, Hash)>] UploadsIdDelete200Response data, response status code and response headers
115
- def uploads_id_delete_0_with_http_info(id, opts = {})
99
+ # @return [Array<(UploadResponse, Integer, Hash)>] UploadResponse data, response status code and response headers
100
+ def get_upload_with_http_info(id, opts = {})
116
101
  if @api_client.config.debugging
117
- @api_client.config.logger.debug 'Calling API: UploadsApi.uploads_id_delete_0 ...'
102
+ @api_client.config.logger.debug 'Calling API: UploadsApi.get_upload ...'
118
103
  end
119
104
  # verify the required parameter 'id' is set
120
105
  if @api_client.config.client_side_validation && id.nil?
121
- fail ArgumentError, "Missing the required parameter 'id' when calling UploadsApi.uploads_id_delete_0"
106
+ fail ArgumentError, "Missing the required parameter 'id' when calling UploadsApi.get_upload"
122
107
  end
123
108
  # resource path
124
109
  local_var_path = '/uploads/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
@@ -138,13 +123,13 @@ module ApiSdkRb
138
123
  post_body = opts[:debug_body]
139
124
 
140
125
  # return_type
141
- return_type = opts[:debug_return_type] || 'UploadsIdDelete200Response'
126
+ return_type = opts[:debug_return_type] || 'UploadResponse'
142
127
 
143
128
  # auth_names
144
129
  auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
145
130
 
146
131
  new_options = opts.merge(
147
- :operation => :"UploadsApi.uploads_id_delete_0",
132
+ :operation => :"UploadsApi.get_upload",
148
133
  :header_params => header_params,
149
134
  :query_params => query_params,
150
135
  :form_params => form_params,
@@ -153,38 +138,32 @@ module ApiSdkRb
153
138
  :return_type => return_type
154
139
  )
155
140
 
156
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
141
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
157
142
  if @api_client.config.debugging
158
- @api_client.config.logger.debug "API called: UploadsApi#uploads_id_delete_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
143
+ @api_client.config.logger.debug "API called: UploadsApi#get_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
159
144
  end
160
145
  return data, status_code, headers
161
146
  end
162
147
 
163
- # Get an upload by id
164
- # The details of one of the account's uploads. An upload that belongs to another account is not found.
165
- # @param id [String] The upload to read
148
+ # Upload size limits and accepted file types
149
+ # The size limit and the accepted file types of the upload endpoints. Read them from here rather than hard-coding thresholds: they are configuration and can change. The limits are the same for every account, whatever its plan: `multipart_max_bytes` for a file sent in one request (10 MB) and `tus_max_bytes` for a resumable upload (250 MB).
166
150
  # @param [Hash] opts the optional parameters
167
- # @return [UploadResponse]
168
- def uploads_id_get_0(id, opts = {})
169
- data, _status_code, _headers = uploads_id_get_0_with_http_info(id, opts)
151
+ # @return [UploadLimitsResponse]
152
+ def get_upload_limits(opts = {})
153
+ data, _status_code, _headers = get_upload_limits_with_http_info(opts)
170
154
  data
171
155
  end
172
156
 
173
- # Get an upload by id
174
- # The details of one of the account&#39;s uploads. An upload that belongs to another account is not found.
175
- # @param id [String] The upload to read
157
+ # Upload size limits and accepted file types
158
+ # The size limit and the accepted file types of the upload endpoints. Read them from here rather than hard-coding thresholds: they are configuration and can change. The limits are the same for every account, whatever its plan: &#x60;multipart_max_bytes&#x60; for a file sent in one request (10 MB) and &#x60;tus_max_bytes&#x60; for a resumable upload (250 MB).
176
159
  # @param [Hash] opts the optional parameters
177
- # @return [Array<(UploadResponse, Integer, Hash)>] UploadResponse data, response status code and response headers
178
- def uploads_id_get_0_with_http_info(id, opts = {})
160
+ # @return [Array<(UploadLimitsResponse, Integer, Hash)>] UploadLimitsResponse data, response status code and response headers
161
+ def get_upload_limits_with_http_info(opts = {})
179
162
  if @api_client.config.debugging
180
- @api_client.config.logger.debug 'Calling API: UploadsApi.uploads_id_get_0 ...'
181
- end
182
- # verify the required parameter 'id' is set
183
- if @api_client.config.client_side_validation && id.nil?
184
- fail ArgumentError, "Missing the required parameter 'id' when calling UploadsApi.uploads_id_get_0"
163
+ @api_client.config.logger.debug 'Calling API: UploadsApi.get_upload_limits ...'
185
164
  end
186
165
  # resource path
187
- local_var_path = '/uploads/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
166
+ local_var_path = '/uploads/limits'
188
167
 
189
168
  # query parameters
190
169
  query_params = opts[:query_params] || {}
@@ -201,13 +180,13 @@ module ApiSdkRb
201
180
  post_body = opts[:debug_body]
202
181
 
203
182
  # return_type
204
- return_type = opts[:debug_return_type] || 'UploadResponse'
183
+ return_type = opts[:debug_return_type] || 'UploadLimitsResponse'
205
184
 
206
185
  # auth_names
207
186
  auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
208
187
 
209
188
  new_options = opts.merge(
210
- :operation => :"UploadsApi.uploads_id_get_0",
189
+ :operation => :"UploadsApi.get_upload_limits",
211
190
  :header_params => header_params,
212
191
  :query_params => query_params,
213
192
  :form_params => form_params,
@@ -218,33 +197,54 @@ module ApiSdkRb
218
197
 
219
198
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
220
199
  if @api_client.config.debugging
221
- @api_client.config.logger.debug "API called: UploadsApi#uploads_id_get_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
200
+ @api_client.config.logger.debug "API called: UploadsApi#get_upload_limits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
222
201
  end
223
202
  return data, status_code, headers
224
203
  end
225
204
 
226
- # Upload size limits and accepted file types
227
- # The size limit and the accepted file types of the upload endpoints. Read them from here rather than hard-coding thresholds: they are configuration and can change. The limits are the same for every account, whatever its plan: `multipart_max_bytes` for a file sent in one request (10 MB) and `tus_max_bytes` for a resumable upload (250 MB).
205
+ # List the account's uploads
206
+ # The files the account has uploaded, newest first. Deleted files are not listed. Returns at most `limit` files and has no further pages: a client that needs more narrows the list instead, for example to one managed user's files with `managedUserId` or `managedUserExternalId`. The files that visitors sent through a widget's upload adapter (`source` is `widget-visitor-upload`) are not part of this list, so that a popular widget does not push the account's own files out of it; naming one widget with `widgetId` lists what visitors sent to that widget as well.
228
207
  # @param [Hash] opts the optional parameters
229
- # @return [UploadLimitsResponse]
230
- def uploads_limits_get_0(opts = {})
231
- data, _status_code, _headers = uploads_limits_get_0_with_http_info(opts)
208
+ # @option opts [Integer] :limit Maximum number of files to return (default to 50)
209
+ # @option opts [String] :managed_user_id List only the files uploaded for this managed user (Widgetic&#39;s id for the user). Send this or &#x60;managedUserExternalId&#x60;, not both.
210
+ # @option opts [String] :managed_user_external_id List only the files uploaded for the managed user you registered with this &#x60;externalId&#x60; (your own identifier for the user). Send this or &#x60;managedUserId&#x60;, not both.
211
+ # @return [ListUploads200Response]
212
+ def list_uploads(opts = {})
213
+ data, _status_code, _headers = list_uploads_with_http_info(opts)
232
214
  data
233
215
  end
234
216
 
235
- # Upload size limits and accepted file types
236
- # The size limit and the accepted file types of the upload endpoints. Read them from here rather than hard-coding thresholds: they are configuration and can change. The limits are the same for every account, whatever its plan: &#x60;multipart_max_bytes&#x60; for a file sent in one request (10 MB) and &#x60;tus_max_bytes&#x60; for a resumable upload (250 MB).
217
+ # List the account&#39;s uploads
218
+ # The files the account has uploaded, newest first. Deleted files are not listed. Returns at most &#x60;limit&#x60; files and has no further pages: a client that needs more narrows the list instead, for example to one managed user&#39;s files with &#x60;managedUserId&#x60; or &#x60;managedUserExternalId&#x60;. The files that visitors sent through a widget&#39;s upload adapter (&#x60;source&#x60; is &#x60;widget-visitor-upload&#x60;) are not part of this list, so that a popular widget does not push the account&#39;s own files out of it; naming one widget with &#x60;widgetId&#x60; lists what visitors sent to that widget as well.
237
219
  # @param [Hash] opts the optional parameters
238
- # @return [Array<(UploadLimitsResponse, Integer, Hash)>] UploadLimitsResponse data, response status code and response headers
239
- def uploads_limits_get_0_with_http_info(opts = {})
220
+ # @option opts [Integer] :limit Maximum number of files to return (default to 50)
221
+ # @option opts [String] :managed_user_id List only the files uploaded for this managed user (Widgetic&#39;s id for the user). Send this or &#x60;managedUserExternalId&#x60;, not both.
222
+ # @option opts [String] :managed_user_external_id List only the files uploaded for the managed user you registered with this &#x60;externalId&#x60; (your own identifier for the user). Send this or &#x60;managedUserId&#x60;, not both.
223
+ # @return [Array<(ListUploads200Response, Integer, Hash)>] ListUploads200Response data, response status code and response headers
224
+ def list_uploads_with_http_info(opts = {})
240
225
  if @api_client.config.debugging
241
- @api_client.config.logger.debug 'Calling API: UploadsApi.uploads_limits_get_0 ...'
226
+ @api_client.config.logger.debug 'Calling API: UploadsApi.list_uploads ...'
242
227
  end
228
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
229
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UploadsApi.list_uploads, must be smaller than or equal to 100.'
230
+ end
231
+
232
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
233
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UploadsApi.list_uploads, must be greater than or equal to 1.'
234
+ end
235
+
236
+ if @api_client.config.client_side_validation && !opts[:'managed_user_external_id'].nil? && opts[:'managed_user_external_id'].to_s.length > 255
237
+ fail ArgumentError, 'invalid value for "opts[:"managed_user_external_id"]" when calling UploadsApi.list_uploads, the character length must be smaller than or equal to 255.'
238
+ end
239
+
243
240
  # resource path
244
- local_var_path = '/uploads/limits'
241
+ local_var_path = '/uploads'
245
242
 
246
243
  # query parameters
247
244
  query_params = opts[:query_params] || {}
245
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
246
+ query_params[:'managedUserId'] = opts[:'managed_user_id'] if !opts[:'managed_user_id'].nil?
247
+ query_params[:'managedUserExternalId'] = opts[:'managed_user_external_id'] if !opts[:'managed_user_external_id'].nil?
248
248
 
249
249
  # header parameters
250
250
  header_params = opts[:header_params] || {}
@@ -258,13 +258,13 @@ module ApiSdkRb
258
258
  post_body = opts[:debug_body]
259
259
 
260
260
  # return_type
261
- return_type = opts[:debug_return_type] || 'UploadLimitsResponse'
261
+ return_type = opts[:debug_return_type] || 'ListUploads200Response'
262
262
 
263
263
  # auth_names
264
264
  auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
265
265
 
266
266
  new_options = opts.merge(
267
- :operation => :"UploadsApi.uploads_limits_get_0",
267
+ :operation => :"UploadsApi.list_uploads",
268
268
  :header_params => header_params,
269
269
  :query_params => query_params,
270
270
  :form_params => form_params,
@@ -275,13 +275,13 @@ module ApiSdkRb
275
275
 
276
276
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
277
277
  if @api_client.config.debugging
278
- @api_client.config.logger.debug "API called: UploadsApi#uploads_limits_get_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
278
+ @api_client.config.logger.debug "API called: UploadsApi#list_uploads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
279
279
  end
280
280
  return data, status_code, headers
281
281
  end
282
282
 
283
283
  # Upload a file
284
- # Stores one file for the account and returns its public address. This is how a user's own images, video and PDFs reach a widget's content. Send a `multipart/form-data` request with the file in the field named `file`. The file counts against the storage of the workspace it is uploaded in, and a full workspace is refused with 413 and `QUOTA_STORAGE_EXCEEDED`. For a person signed in on widgetic.com that is the workspace they are currently working in: inside a team, the team's shared storage; inside their own workspace, their own allowance. An organization API key, and a Shopify store's session, always work in that team's shared storage. A personal API key or an SDK token always uses the account's own allowance. The two never add up and one never lends room to the other. A file over the size limit is refused with 413 and `UPLOAD_TOO_LARGE`, and a type that is not accepted with 415 and `UPLOAD_UNSUPPORTED_TYPE`; `uploadsLimitsGet` lists the size limit and the accepted types. A file is judged by what is in it, not by the type it is sent as. A file that is not the type it claims (a web page sent as `image/png`) is refused with 415 and `UPLOAD_UNSUPPORTED_TYPE`, and a picture sent under the wrong picture type is stored under the type it really is, which `mime_type` in the answer says. An SVG is rewritten as it is stored: script, `foreignObject`, animation and references to other addresses are taken out, it must be UTF-8 and at most 2 MB, and the stored file can be larger or smaller than the one sent. Anything that is not an image, audio or video (a PDF, for example) is served as a download rather than shown in a page. When the full storage is a Shopify store's team's, extra storage cannot be added through Shopify yet, so the message ends by saying so and what to do instead: delete files, or contact support. On a Solo plan it names the Teams plan (which holds more) and `error.details.planPageUrl` is the address of the plan page on Shopify. `error.suggestedAction` says the same in a few words, instead of the usual \"upgrade your storage plan\". Any other team, and a person's own workspace, get the shorter message. To upload the file for one of your managed users, send `managedUserId` (Widgetic's id for the user) or `managedUserExternalId` (your own identifier for the user), not both. The file stays in your account and counts against its allowance; the tag lets you list one user's files with `uploadsGet`. The managed user must be yours and active: one that is not yours, or does not exist, is refused with 404 and `MANAGED_USER_NOT_FOUND`, and one that is switched off with 409 and `MANAGED_USER_INACTIVE`, before the file is stored. The tag is set here and does not change afterwards. Called with an editor session (`createManagedUserEditorSession`), the file is always filed for the session's own managed user and is always media for widget content: naming another managed user is refused with 403 and `MANAGED_USER_SESSION_MISMATCH`, and `contextType`, `source`, `widgetId` and `conversationId` are ignored. A full storage allowance is refused with the same 413 and `QUOTA_STORAGE_EXCEEDED`, but the message only says that it is not available right now (not how much is stored: that is the partner's business) and `error.details.limit` is `storage`. An account that administers a partner with a storage destination (`setPartnerStorageDestination`) has its files stored in the partner's own bucket instead. Such a file takes none of the allowance, its `url` is served from the partner's public address, and its `storage_key` is the key in the partner's bucket. The file is never stored with Widgetic instead: when the destination cannot be used the upload is refused with 503 and `STORAGE_DESTINATION_UNAVAILABLE`, and when the partner's storage rejects the file with 502 and `STORAGE_DESTINATION_WRITE_FAILED`. Partner storage is not optional, and it does not depend on how the file arrives. A partner's own uploads (with its API key, an SDK token, or from the Widgetic website, the resumable route and the media library alike) and the uploads of its customers' editor sessions are kept in the partner's own storage or not at all, so a partner with no destination (or one that removed it after the session was made) has them refused with 409 and `PARTNER_STORAGE_REQUIRED`; they are never stored with Widgetic. An editor session's browser is only told that the feature is not available right now.
284
+ # Stores one file for the account and returns its public address. This is how a user's own images, video and PDFs reach a widget's content. Send a `multipart/form-data` request with the file in the field named `file`. The file counts against the storage of the workspace it is uploaded in, and a full workspace is refused with 413 and `QUOTA_STORAGE_EXCEEDED`. For a person signed in on widgetic.com that is the workspace they are currently working in: inside a team, the team's shared storage; inside their own workspace, their own allowance. An organization API key, and a Shopify store's session, always work in that team's shared storage. A personal API key or an SDK token always uses the account's own allowance. The two never add up and one never lends room to the other. A file over the size limit is refused with 413 and `UPLOAD_TOO_LARGE`, and a type that is not accepted with 415 and `UPLOAD_UNSUPPORTED_TYPE`; `getUploadLimits` lists the size limit and the accepted types. A file is judged by what is in it, not by the type it is sent as. A file that is not the type it claims (a web page sent as `image/png`) is refused with 415 and `UPLOAD_UNSUPPORTED_TYPE`, and a picture sent under the wrong picture type is stored under the type it really is, which `mime_type` in the answer says. An SVG is rewritten as it is stored: script, `foreignObject`, animation and references to other addresses are taken out, it must be UTF-8 and at most 2 MB, and the stored file can be larger or smaller than the one sent. Anything that is not an image, audio or video (a PDF, for example) is served as a download rather than shown in a page. When the full storage is a Shopify store's team's, extra storage cannot be added through Shopify yet, so the message ends by saying so and what to do instead: delete files, or contact support. On a Solo plan it names the Teams plan (which holds more) and `error.details.planPageUrl` is the address of the plan page on Shopify. `error.suggestedAction` says the same in a few words, instead of the usual \"upgrade your storage plan\". Any other team, and a person's own workspace, get the shorter message. To upload the file for one of your managed users, send `managedUserId` (Widgetic's id for the user) or `managedUserExternalId` (your own identifier for the user), not both. The file stays in your account and counts against its allowance; the tag lets you list one user's files with `listUploads`. The managed user must be yours and active: one that is not yours, or does not exist, is refused with 404 and `MANAGED_USER_NOT_FOUND`, and one that is switched off with 409 and `MANAGED_USER_INACTIVE`, before the file is stored. The tag is set here and does not change afterwards. Called with an editor session (`createManagedUserEditorSession`), the file is always filed for the session's own managed user and is always media for widget content: naming another managed user is refused with 403 and `MANAGED_USER_SESSION_MISMATCH`, and `contextType`, `source`, `widgetId` and `conversationId` are ignored. A full storage allowance is refused with the same 413 and `QUOTA_STORAGE_EXCEEDED`, but the message only says that it is not available right now (not how much is stored: that is the partner's business) and `error.details.limit` is `storage`. An account that administers a partner with a storage destination (`setPartnerStorageDestination`) has its files stored in the partner's own bucket instead. Such a file takes none of the allowance, its `url` is served from the partner's public address, and its `storage_key` is the key in the partner's bucket. The file is never stored with Widgetic instead: when the destination cannot be used the upload is refused with 503 and `STORAGE_DESTINATION_UNAVAILABLE`, and when the partner's storage rejects the file with 502 and `STORAGE_DESTINATION_WRITE_FAILED`. Partner storage is not optional, and it does not depend on how the file arrives. A partner's own uploads (with its API key, an SDK token, or from the Widgetic website, the resumable route and the media library alike) and the uploads of its customers' editor sessions are kept in the partner's own storage or not at all, so a partner with no destination (or one that removed it after the session was made) has them refused with 409 and `PARTNER_STORAGE_REQUIRED`; they are never stored with Widgetic. An editor session's browser is only told that the feature is not available right now.
285
285
  # @param file [File] The file to store
286
286
  # @param [Hash] opts the optional parameters
287
287
  # @option opts [String] :context_type What the file is for. Send &#x60;content-property&#x60; for media that becomes widget content (images, video and PDF); the other values are used by Widgetic&#39;s own editor. (default to 'content-property')
@@ -290,13 +290,13 @@ module ApiSdkRb
290
290
  # @option opts [String] :managed_user_external_id The same, by your own identifier for the user, the &#x60;externalId&#x60; you gave when you created the managed user. Send this or &#x60;managedUserId&#x60;, not both.
291
291
  # @option opts [String] :purpose Where in your product you use the file. It is kept with the file, so that a customer&#39;s storage can be counted by purpose (&#x60;getManagedUserStorageUsage&#x60;). Optional; any other value is refused with 400 and &#x60;UPLOAD_INVALID_PURPOSE&#x60;.
292
292
  # @return [UploadResponse]
293
- def uploads_post_0(file, opts = {})
294
- data, _status_code, _headers = uploads_post_0_with_http_info(file, opts)
293
+ def upload_file(file, opts = {})
294
+ data, _status_code, _headers = upload_file_with_http_info(file, opts)
295
295
  data
296
296
  end
297
297
 
298
298
  # Upload a file
299
- # Stores one file for the account and returns its public address. This is how a user&#39;s own images, video and PDFs reach a widget&#39;s content. Send a &#x60;multipart/form-data&#x60; request with the file in the field named &#x60;file&#x60;. The file counts against the storage of the workspace it is uploaded in, and a full workspace is refused with 413 and &#x60;QUOTA_STORAGE_EXCEEDED&#x60;. For a person signed in on widgetic.com that is the workspace they are currently working in: inside a team, the team&#39;s shared storage; inside their own workspace, their own allowance. An organization API key, and a Shopify store&#39;s session, always work in that team&#39;s shared storage. A personal API key or an SDK token always uses the account&#39;s own allowance. The two never add up and one never lends room to the other. A file over the size limit is refused with 413 and &#x60;UPLOAD_TOO_LARGE&#x60;, and a type that is not accepted with 415 and &#x60;UPLOAD_UNSUPPORTED_TYPE&#x60;; &#x60;uploadsLimitsGet&#x60; lists the size limit and the accepted types. A file is judged by what is in it, not by the type it is sent as. A file that is not the type it claims (a web page sent as &#x60;image/png&#x60;) is refused with 415 and &#x60;UPLOAD_UNSUPPORTED_TYPE&#x60;, and a picture sent under the wrong picture type is stored under the type it really is, which &#x60;mime_type&#x60; in the answer says. An SVG is rewritten as it is stored: script, &#x60;foreignObject&#x60;, animation and references to other addresses are taken out, it must be UTF-8 and at most 2 MB, and the stored file can be larger or smaller than the one sent. Anything that is not an image, audio or video (a PDF, for example) is served as a download rather than shown in a page. When the full storage is a Shopify store&#39;s team&#39;s, extra storage cannot be added through Shopify yet, so the message ends by saying so and what to do instead: delete files, or contact support. On a Solo plan it names the Teams plan (which holds more) and &#x60;error.details.planPageUrl&#x60; is the address of the plan page on Shopify. &#x60;error.suggestedAction&#x60; says the same in a few words, instead of the usual \&quot;upgrade your storage plan\&quot;. Any other team, and a person&#39;s own workspace, get the shorter message. To upload the file for one of your managed users, send &#x60;managedUserId&#x60; (Widgetic&#39;s id for the user) or &#x60;managedUserExternalId&#x60; (your own identifier for the user), not both. The file stays in your account and counts against its allowance; the tag lets you list one user&#39;s files with &#x60;uploadsGet&#x60;. The managed user must be yours and active: one that is not yours, or does not exist, is refused with 404 and &#x60;MANAGED_USER_NOT_FOUND&#x60;, and one that is switched off with 409 and &#x60;MANAGED_USER_INACTIVE&#x60;, before the file is stored. The tag is set here and does not change afterwards. Called with an editor session (&#x60;createManagedUserEditorSession&#x60;), the file is always filed for the session&#39;s own managed user and is always media for widget content: naming another managed user is refused with 403 and &#x60;MANAGED_USER_SESSION_MISMATCH&#x60;, and &#x60;contextType&#x60;, &#x60;source&#x60;, &#x60;widgetId&#x60; and &#x60;conversationId&#x60; are ignored. A full storage allowance is refused with the same 413 and &#x60;QUOTA_STORAGE_EXCEEDED&#x60;, but the message only says that it is not available right now (not how much is stored: that is the partner&#39;s business) and &#x60;error.details.limit&#x60; is &#x60;storage&#x60;. An account that administers a partner with a storage destination (&#x60;setPartnerStorageDestination&#x60;) has its files stored in the partner&#39;s own bucket instead. Such a file takes none of the allowance, its &#x60;url&#x60; is served from the partner&#39;s public address, and its &#x60;storage_key&#x60; is the key in the partner&#39;s bucket. The file is never stored with Widgetic instead: when the destination cannot be used the upload is refused with 503 and &#x60;STORAGE_DESTINATION_UNAVAILABLE&#x60;, and when the partner&#39;s storage rejects the file with 502 and &#x60;STORAGE_DESTINATION_WRITE_FAILED&#x60;. Partner storage is not optional, and it does not depend on how the file arrives. A partner&#39;s own uploads (with its API key, an SDK token, or from the Widgetic website, the resumable route and the media library alike) and the uploads of its customers&#39; editor sessions are kept in the partner&#39;s own storage or not at all, so a partner with no destination (or one that removed it after the session was made) has them refused with 409 and &#x60;PARTNER_STORAGE_REQUIRED&#x60;; they are never stored with Widgetic. An editor session&#39;s browser is only told that the feature is not available right now.
299
+ # Stores one file for the account and returns its public address. This is how a user&#39;s own images, video and PDFs reach a widget&#39;s content. Send a &#x60;multipart/form-data&#x60; request with the file in the field named &#x60;file&#x60;. The file counts against the storage of the workspace it is uploaded in, and a full workspace is refused with 413 and &#x60;QUOTA_STORAGE_EXCEEDED&#x60;. For a person signed in on widgetic.com that is the workspace they are currently working in: inside a team, the team&#39;s shared storage; inside their own workspace, their own allowance. An organization API key, and a Shopify store&#39;s session, always work in that team&#39;s shared storage. A personal API key or an SDK token always uses the account&#39;s own allowance. The two never add up and one never lends room to the other. A file over the size limit is refused with 413 and &#x60;UPLOAD_TOO_LARGE&#x60;, and a type that is not accepted with 415 and &#x60;UPLOAD_UNSUPPORTED_TYPE&#x60;; &#x60;getUploadLimits&#x60; lists the size limit and the accepted types. A file is judged by what is in it, not by the type it is sent as. A file that is not the type it claims (a web page sent as &#x60;image/png&#x60;) is refused with 415 and &#x60;UPLOAD_UNSUPPORTED_TYPE&#x60;, and a picture sent under the wrong picture type is stored under the type it really is, which &#x60;mime_type&#x60; in the answer says. An SVG is rewritten as it is stored: script, &#x60;foreignObject&#x60;, animation and references to other addresses are taken out, it must be UTF-8 and at most 2 MB, and the stored file can be larger or smaller than the one sent. Anything that is not an image, audio or video (a PDF, for example) is served as a download rather than shown in a page. When the full storage is a Shopify store&#39;s team&#39;s, extra storage cannot be added through Shopify yet, so the message ends by saying so and what to do instead: delete files, or contact support. On a Solo plan it names the Teams plan (which holds more) and &#x60;error.details.planPageUrl&#x60; is the address of the plan page on Shopify. &#x60;error.suggestedAction&#x60; says the same in a few words, instead of the usual \&quot;upgrade your storage plan\&quot;. Any other team, and a person&#39;s own workspace, get the shorter message. To upload the file for one of your managed users, send &#x60;managedUserId&#x60; (Widgetic&#39;s id for the user) or &#x60;managedUserExternalId&#x60; (your own identifier for the user), not both. The file stays in your account and counts against its allowance; the tag lets you list one user&#39;s files with &#x60;listUploads&#x60;. The managed user must be yours and active: one that is not yours, or does not exist, is refused with 404 and &#x60;MANAGED_USER_NOT_FOUND&#x60;, and one that is switched off with 409 and &#x60;MANAGED_USER_INACTIVE&#x60;, before the file is stored. The tag is set here and does not change afterwards. Called with an editor session (&#x60;createManagedUserEditorSession&#x60;), the file is always filed for the session&#39;s own managed user and is always media for widget content: naming another managed user is refused with 403 and &#x60;MANAGED_USER_SESSION_MISMATCH&#x60;, and &#x60;contextType&#x60;, &#x60;source&#x60;, &#x60;widgetId&#x60; and &#x60;conversationId&#x60; are ignored. A full storage allowance is refused with the same 413 and &#x60;QUOTA_STORAGE_EXCEEDED&#x60;, but the message only says that it is not available right now (not how much is stored: that is the partner&#39;s business) and &#x60;error.details.limit&#x60; is &#x60;storage&#x60;. An account that administers a partner with a storage destination (&#x60;setPartnerStorageDestination&#x60;) has its files stored in the partner&#39;s own bucket instead. Such a file takes none of the allowance, its &#x60;url&#x60; is served from the partner&#39;s public address, and its &#x60;storage_key&#x60; is the key in the partner&#39;s bucket. The file is never stored with Widgetic instead: when the destination cannot be used the upload is refused with 503 and &#x60;STORAGE_DESTINATION_UNAVAILABLE&#x60;, and when the partner&#39;s storage rejects the file with 502 and &#x60;STORAGE_DESTINATION_WRITE_FAILED&#x60;. Partner storage is not optional, and it does not depend on how the file arrives. A partner&#39;s own uploads (with its API key, an SDK token, or from the Widgetic website, the resumable route and the media library alike) and the uploads of its customers&#39; editor sessions are kept in the partner&#39;s own storage or not at all, so a partner with no destination (or one that removed it after the session was made) has them refused with 409 and &#x60;PARTNER_STORAGE_REQUIRED&#x60;; they are never stored with Widgetic. An editor session&#39;s browser is only told that the feature is not available right now.
300
300
  # @param file [File] The file to store
301
301
  # @param [Hash] opts the optional parameters
302
302
  # @option opts [String] :context_type What the file is for. Send &#x60;content-property&#x60; for media that becomes widget content (images, video and PDF); the other values are used by Widgetic&#39;s own editor. (default to 'content-property')
@@ -305,13 +305,13 @@ module ApiSdkRb
305
305
  # @option opts [String] :managed_user_external_id The same, by your own identifier for the user, the &#x60;externalId&#x60; you gave when you created the managed user. Send this or &#x60;managedUserId&#x60;, not both.
306
306
  # @option opts [String] :purpose Where in your product you use the file. It is kept with the file, so that a customer&#39;s storage can be counted by purpose (&#x60;getManagedUserStorageUsage&#x60;). Optional; any other value is refused with 400 and &#x60;UPLOAD_INVALID_PURPOSE&#x60;.
307
307
  # @return [Array<(UploadResponse, Integer, Hash)>] UploadResponse data, response status code and response headers
308
- def uploads_post_0_with_http_info(file, opts = {})
308
+ def upload_file_with_http_info(file, opts = {})
309
309
  if @api_client.config.debugging
310
- @api_client.config.logger.debug 'Calling API: UploadsApi.uploads_post_0 ...'
310
+ @api_client.config.logger.debug 'Calling API: UploadsApi.upload_file ...'
311
311
  end
312
312
  # verify the required parameter 'file' is set
313
313
  if @api_client.config.client_side_validation && file.nil?
314
- fail ArgumentError, "Missing the required parameter 'file' when calling UploadsApi.uploads_post_0"
314
+ fail ArgumentError, "Missing the required parameter 'file' when calling UploadsApi.upload_file"
315
315
  end
316
316
  allowable_values = ["widget-codegen", "browser-ic", "content-property"]
317
317
  if @api_client.config.client_side_validation && opts[:'context_type'] && !allowable_values.include?(opts[:'context_type'])
@@ -322,7 +322,7 @@ module ApiSdkRb
322
322
  fail ArgumentError, "invalid value for \"source\", must be one of #{allowable_values}"
323
323
  end
324
324
  if @api_client.config.client_side_validation && !opts[:'managed_user_external_id'].nil? && opts[:'managed_user_external_id'].to_s.length > 255
325
- fail ArgumentError, 'invalid value for "opts[:"managed_user_external_id"]" when calling UploadsApi.uploads_post_0, the character length must be smaller than or equal to 255.'
325
+ fail ArgumentError, 'invalid value for "opts[:"managed_user_external_id"]" when calling UploadsApi.upload_file, the character length must be smaller than or equal to 255.'
326
326
  end
327
327
 
328
328
  allowable_values = ["canvas", "chat", "field"]
@@ -364,7 +364,7 @@ module ApiSdkRb
364
364
  auth_names = opts[:debug_auth_names] || ['apiKeyAuth']
365
365
 
366
366
  new_options = opts.merge(
367
- :operation => :"UploadsApi.uploads_post_0",
367
+ :operation => :"UploadsApi.upload_file",
368
368
  :header_params => header_params,
369
369
  :query_params => query_params,
370
370
  :form_params => form_params,
@@ -375,7 +375,7 @@ module ApiSdkRb
375
375
 
376
376
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
377
377
  if @api_client.config.debugging
378
- @api_client.config.logger.debug "API called: UploadsApi#uploads_post_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
378
+ @api_client.config.logger.debug "API called: UploadsApi#upload_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
379
379
  end
380
380
  return data, status_code, headers
381
381
  end