rocket_stack_sdk 1.0.1
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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +226 -0
- data/Rakefile +10 -0
- data/docs/CreateCronJob201Response.md +22 -0
- data/docs/CreateCronJob201ResponseData.md +20 -0
- data/docs/CreateCronJobRequest.md +26 -0
- data/docs/CreateCronJobRequestDeliveryTarget.md +32 -0
- data/docs/CreateCronJobRequestSchedule.md +22 -0
- data/docs/CreateDownloadUrl200Response.md +22 -0
- data/docs/CreateDownloadUrl200ResponseData.md +24 -0
- data/docs/CreateDownloadUrlRequest.md +22 -0
- data/docs/CreateFunction202Response.md +22 -0
- data/docs/CreateFunction202ResponseData.md +20 -0
- data/docs/CreateQueue201Response.md +22 -0
- data/docs/CreateQueue201ResponseData.md +20 -0
- data/docs/CreateQueueRequest.md +26 -0
- data/docs/CreateQueueRequestDeliveryTarget.md +32 -0
- data/docs/CreateSchedule201Response.md +22 -0
- data/docs/CreateSchedule201ResponseData.md +20 -0
- data/docs/CreateScheduleRequest.md +26 -0
- data/docs/CronApi.md +365 -0
- data/docs/DeleteKvItem200Response.md +22 -0
- data/docs/DeleteKvItem200ResponseData.md +18 -0
- data/docs/EnqueueMessage201Response.md +22 -0
- data/docs/EnqueueMessage201ResponseData.md +20 -0
- data/docs/EnqueueMessageRequest.md +22 -0
- data/docs/FinalizeUpload200Response.md +22 -0
- data/docs/FinalizeUpload200ResponseData.md +24 -0
- data/docs/FinalizeUploadRequest.md +18 -0
- data/docs/FunctionsApi.md +463 -0
- data/docs/GetCronJob200Response.md +22 -0
- data/docs/GetFunction200Response.md +22 -0
- data/docs/GetKvItem200Response.md +22 -0
- data/docs/GetKvItem200ResponseData.md +24 -0
- data/docs/GetMessageStatus200Response.md +22 -0
- data/docs/GetMessageStatus200ResponseData.md +30 -0
- data/docs/GetQueue200Response.md +22 -0
- data/docs/GetSchedule200Response.md +22 -0
- data/docs/GetScheduleStatus200Response.md +22 -0
- data/docs/GetScheduleStatus200ResponseData.md +26 -0
- data/docs/GetTemplate200Response.md +22 -0
- data/docs/InvokeFunction200Response.md +22 -0
- data/docs/InvokeFunction200ResponseData.md +26 -0
- data/docs/InvokeFunctionRequest.md +22 -0
- data/docs/KvApi.md +297 -0
- data/docs/ListCapabilities200Response.md +22 -0
- data/docs/ListCapabilities200ResponseDataInner.md +22 -0
- data/docs/ListCronJobs200Response.md +22 -0
- data/docs/ListCronJobs200ResponseData.md +20 -0
- data/docs/ListCronJobs200ResponseDataItemsInner.md +36 -0
- data/docs/ListCronJobs200ResponseDataItemsInnerSchedule.md +24 -0
- data/docs/ListFunctions200Response.md +22 -0
- data/docs/ListFunctions200ResponseData.md +20 -0
- data/docs/ListFunctions200ResponseDataItemsInner.md +38 -0
- data/docs/ListFunctions200ResponseDataItemsInnerActualSpec.md +18 -0
- data/docs/ListFunctions200ResponseDataItemsInnerDesiredSpec.md +36 -0
- data/docs/ListFunctions200ResponseDataItemsInnerDesiredSpecCode.md +20 -0
- data/docs/ListFunctions200ResponseError.md +22 -0
- data/docs/ListFunctions401Response.md +20 -0
- data/docs/ListKvItems200Response.md +22 -0
- data/docs/ListKvItems200ResponseData.md +20 -0
- data/docs/ListKvItems200ResponseDataItemsInner.md +24 -0
- data/docs/ListQueues200Response.md +22 -0
- data/docs/ListQueues200ResponseData.md +20 -0
- data/docs/ListQueues200ResponseDataItemsInner.md +36 -0
- data/docs/ListQueues200ResponseDataItemsInnerDeliveryTarget.md +28 -0
- data/docs/ListSchedules200Response.md +22 -0
- data/docs/ListSchedules200ResponseData.md +20 -0
- data/docs/ListSchedules200ResponseDataItemsInner.md +36 -0
- data/docs/ListSnippets200Response.md +22 -0
- data/docs/ListSnippets200ResponseDataInner.md +28 -0
- data/docs/ListStorageObjects200Response.md +22 -0
- data/docs/ListStorageObjects200ResponseData.md +20 -0
- data/docs/ListStorageObjects200ResponseDataItemsInner.md +28 -0
- data/docs/ListTemplates200Response.md +22 -0
- data/docs/ListTemplates200ResponseDataInner.md +28 -0
- data/docs/PutKvItem200Response.md +22 -0
- data/docs/PutKvItem200ResponseData.md +22 -0
- data/docs/PutKvItemRequest.md +24 -0
- data/docs/PutKvItemRequestIfVersion.md +15 -0
- data/docs/QueuesApi.md +511 -0
- data/docs/ResourcesApi.md +290 -0
- data/docs/SchedulerApi.md +505 -0
- data/docs/StorageApi.md +447 -0
- data/docs/UpdateCronJob200Response.md +22 -0
- data/docs/UpdateCronJob200ResponseData.md +22 -0
- data/docs/UpdateCronJobRequest.md +24 -0
- data/docs/UpdateCronJobRequestSchedule.md +22 -0
- data/docs/UpdateFunctionRequest.md +30 -0
- data/docs/UpdateQueue200Response.md +22 -0
- data/docs/UpdateQueue200ResponseData.md +22 -0
- data/docs/UpdateQueueRequest.md +24 -0
- data/docs/UpdateSchedule200Response.md +22 -0
- data/docs/UpdateSchedule200ResponseData.md +22 -0
- data/docs/UpdateScheduleRequest.md +24 -0
- data/docs/UploadObject201Response.md +22 -0
- data/docs/UploadObject201ResponseData.md +26 -0
- data/git_push.sh +57 -0
- data/lib/rocket_stack_sdk/api/cron_api.rb +357 -0
- data/lib/rocket_stack_sdk/api/functions_api.rb +536 -0
- data/lib/rocket_stack_sdk/api/kv_api.rb +308 -0
- data/lib/rocket_stack_sdk/api/queues_api.rb +496 -0
- data/lib/rocket_stack_sdk/api/resources_api.rb +277 -0
- data/lib/rocket_stack_sdk/api/scheduler_api.rb +483 -0
- data/lib/rocket_stack_sdk/api/storage_api.rb +474 -0
- data/lib/rocket_stack_sdk/api_client.rb +397 -0
- data/lib/rocket_stack_sdk/api_error.rb +58 -0
- data/lib/rocket_stack_sdk/api_model_base.rb +88 -0
- data/lib/rocket_stack_sdk/configuration.rb +309 -0
- data/lib/rocket_stack_sdk/models/create_cron_job201_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/create_cron_job201_response_data.rb +190 -0
- data/lib/rocket_stack_sdk/models/create_cron_job_request.rb +265 -0
- data/lib/rocket_stack_sdk/models/create_cron_job_request_delivery_target.rb +343 -0
- data/lib/rocket_stack_sdk/models/create_cron_job_request_schedule.rb +227 -0
- data/lib/rocket_stack_sdk/models/create_download_url200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/create_download_url200_response_data.rb +211 -0
- data/lib/rocket_stack_sdk/models/create_download_url_request.rb +228 -0
- data/lib/rocket_stack_sdk/models/create_function202_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/create_function202_response_data.rb +190 -0
- data/lib/rocket_stack_sdk/models/create_queue201_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/create_queue201_response_data.rb +190 -0
- data/lib/rocket_stack_sdk/models/create_queue_request.rb +313 -0
- data/lib/rocket_stack_sdk/models/create_queue_request_delivery_target.rb +343 -0
- data/lib/rocket_stack_sdk/models/create_schedule201_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/create_schedule201_response_data.rb +190 -0
- data/lib/rocket_stack_sdk/models/create_schedule_request.rb +265 -0
- data/lib/rocket_stack_sdk/models/delete_kv_item200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/delete_kv_item200_response_data.rb +164 -0
- data/lib/rocket_stack_sdk/models/enqueue_message201_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/enqueue_message201_response_data.rb +190 -0
- data/lib/rocket_stack_sdk/models/enqueue_message_request.rb +213 -0
- data/lib/rocket_stack_sdk/models/finalize_upload200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/finalize_upload200_response_data.rb +242 -0
- data/lib/rocket_stack_sdk/models/finalize_upload_request.rb +182 -0
- data/lib/rocket_stack_sdk/models/get_cron_job200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/get_function200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/get_kv_item200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/get_kv_item200_response_data.rb +212 -0
- data/lib/rocket_stack_sdk/models/get_message_status200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/get_message_status200_response_data.rb +303 -0
- data/lib/rocket_stack_sdk/models/get_queue200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/get_schedule200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/get_schedule_status200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/get_schedule_status200_response_data.rb +240 -0
- data/lib/rocket_stack_sdk/models/get_template200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/invoke_function200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/invoke_function200_response_data.rb +201 -0
- data/lib/rocket_stack_sdk/models/invoke_function_request.rb +204 -0
- data/lib/rocket_stack_sdk/models/list_capabilities200_response.rb +184 -0
- data/lib/rocket_stack_sdk/models/list_capabilities200_response_data_inner.rb +216 -0
- data/lib/rocket_stack_sdk/models/list_cron_jobs200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/list_cron_jobs200_response_data.rb +176 -0
- data/lib/rocket_stack_sdk/models/list_cron_jobs200_response_data_items_inner.rb +384 -0
- data/lib/rocket_stack_sdk/models/list_cron_jobs200_response_data_items_inner_schedule.rb +249 -0
- data/lib/rocket_stack_sdk/models/list_functions200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/list_functions200_response_data.rb +176 -0
- data/lib/rocket_stack_sdk/models/list_functions200_response_data_items_inner.rb +393 -0
- data/lib/rocket_stack_sdk/models/list_functions200_response_data_items_inner_actual_spec.rb +164 -0
- data/lib/rocket_stack_sdk/models/list_functions200_response_data_items_inner_desired_spec.rb +352 -0
- data/lib/rocket_stack_sdk/models/list_functions200_response_data_items_inner_desired_spec_code.rb +174 -0
- data/lib/rocket_stack_sdk/models/list_functions200_response_error.rb +201 -0
- data/lib/rocket_stack_sdk/models/list_functions401_response.rb +190 -0
- data/lib/rocket_stack_sdk/models/list_kv_items200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/list_kv_items200_response_data.rb +178 -0
- data/lib/rocket_stack_sdk/models/list_kv_items200_response_data_items_inner.rb +228 -0
- data/lib/rocket_stack_sdk/models/list_queues200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/list_queues200_response_data.rb +176 -0
- data/lib/rocket_stack_sdk/models/list_queues200_response_data_items_inner.rb +381 -0
- data/lib/rocket_stack_sdk/models/list_queues200_response_data_items_inner_delivery_target.rb +267 -0
- data/lib/rocket_stack_sdk/models/list_schedules200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/list_schedules200_response_data.rb +176 -0
- data/lib/rocket_stack_sdk/models/list_schedules200_response_data_items_inner.rb +384 -0
- data/lib/rocket_stack_sdk/models/list_snippets200_response.rb +184 -0
- data/lib/rocket_stack_sdk/models/list_snippets200_response_data_inner.rb +294 -0
- data/lib/rocket_stack_sdk/models/list_storage_objects200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/list_storage_objects200_response_data.rb +178 -0
- data/lib/rocket_stack_sdk/models/list_storage_objects200_response_data_items_inner.rb +260 -0
- data/lib/rocket_stack_sdk/models/list_templates200_response.rb +184 -0
- data/lib/rocket_stack_sdk/models/list_templates200_response_data_inner.rb +262 -0
- data/lib/rocket_stack_sdk/models/put_kv_item200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/put_kv_item200_response_data.rb +202 -0
- data/lib/rocket_stack_sdk/models/put_kv_item_request.rb +203 -0
- data/lib/rocket_stack_sdk/models/put_kv_item_request_if_version.rb +103 -0
- data/lib/rocket_stack_sdk/models/update_cron_job200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/update_cron_job200_response_data.rb +216 -0
- data/lib/rocket_stack_sdk/models/update_cron_job_request.rb +177 -0
- data/lib/rocket_stack_sdk/models/update_cron_job_request_schedule.rb +220 -0
- data/lib/rocket_stack_sdk/models/update_function_request.rb +337 -0
- data/lib/rocket_stack_sdk/models/update_queue200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/update_queue200_response_data.rb +216 -0
- data/lib/rocket_stack_sdk/models/update_queue_request.rb +258 -0
- data/lib/rocket_stack_sdk/models/update_schedule200_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/update_schedule200_response_data.rb +216 -0
- data/lib/rocket_stack_sdk/models/update_schedule_request.rb +177 -0
- data/lib/rocket_stack_sdk/models/upload_object201_response.rb +182 -0
- data/lib/rocket_stack_sdk/models/upload_object201_response_data.rb +251 -0
- data/lib/rocket_stack_sdk/version.rb +15 -0
- data/lib/rocket_stack_sdk.rb +134 -0
- data/rocket_stack_sdk.gemspec +39 -0
- data/spec/api/cron_api_spec.rb +97 -0
- data/spec/api/functions_api_spec.rb +121 -0
- data/spec/api/kv_api_spec.rb +86 -0
- data/spec/api/queues_api_spec.rb +123 -0
- data/spec/api/resources_api_spec.rb +83 -0
- data/spec/api/scheduler_api_spec.rb +121 -0
- data/spec/api/storage_api_spec.rb +114 -0
- data/spec/models/create_cron_job201_response_data_spec.rb +42 -0
- data/spec/models/create_cron_job201_response_spec.rb +48 -0
- data/spec/models/create_cron_job_request_delivery_target_spec.rb +82 -0
- data/spec/models/create_cron_job_request_schedule_spec.rb +52 -0
- data/spec/models/create_cron_job_request_spec.rb +60 -0
- data/spec/models/create_download_url200_response_data_spec.rb +54 -0
- data/spec/models/create_download_url200_response_spec.rb +48 -0
- data/spec/models/create_download_url_request_spec.rb +48 -0
- data/spec/models/create_function202_response_data_spec.rb +42 -0
- data/spec/models/create_function202_response_spec.rb +48 -0
- data/spec/models/create_queue201_response_data_spec.rb +42 -0
- data/spec/models/create_queue201_response_spec.rb +48 -0
- data/spec/models/create_queue_request_delivery_target_spec.rb +82 -0
- data/spec/models/create_queue_request_spec.rb +60 -0
- data/spec/models/create_schedule201_response_data_spec.rb +42 -0
- data/spec/models/create_schedule201_response_spec.rb +48 -0
- data/spec/models/create_schedule_request_spec.rb +60 -0
- data/spec/models/delete_kv_item200_response_data_spec.rb +36 -0
- data/spec/models/delete_kv_item200_response_spec.rb +48 -0
- data/spec/models/enqueue_message201_response_data_spec.rb +42 -0
- data/spec/models/enqueue_message201_response_spec.rb +48 -0
- data/spec/models/enqueue_message_request_spec.rb +48 -0
- data/spec/models/finalize_upload200_response_data_spec.rb +54 -0
- data/spec/models/finalize_upload200_response_spec.rb +48 -0
- data/spec/models/finalize_upload_request_spec.rb +36 -0
- data/spec/models/get_cron_job200_response_spec.rb +48 -0
- data/spec/models/get_function200_response_spec.rb +48 -0
- data/spec/models/get_kv_item200_response_data_spec.rb +54 -0
- data/spec/models/get_kv_item200_response_spec.rb +48 -0
- data/spec/models/get_message_status200_response_data_spec.rb +72 -0
- data/spec/models/get_message_status200_response_spec.rb +48 -0
- data/spec/models/get_queue200_response_spec.rb +48 -0
- data/spec/models/get_schedule200_response_spec.rb +48 -0
- data/spec/models/get_schedule_status200_response_data_spec.rb +60 -0
- data/spec/models/get_schedule_status200_response_spec.rb +48 -0
- data/spec/models/get_template200_response_spec.rb +48 -0
- data/spec/models/invoke_function200_response_data_spec.rb +60 -0
- data/spec/models/invoke_function200_response_spec.rb +48 -0
- data/spec/models/invoke_function_request_spec.rb +52 -0
- data/spec/models/list_capabilities200_response_data_inner_spec.rb +48 -0
- data/spec/models/list_capabilities200_response_spec.rb +48 -0
- data/spec/models/list_cron_jobs200_response_data_items_inner_schedule_spec.rb +58 -0
- data/spec/models/list_cron_jobs200_response_data_items_inner_spec.rb +90 -0
- data/spec/models/list_cron_jobs200_response_data_spec.rb +42 -0
- data/spec/models/list_cron_jobs200_response_spec.rb +48 -0
- data/spec/models/list_functions200_response_data_items_inner_actual_spec_spec.rb +36 -0
- data/spec/models/list_functions200_response_data_items_inner_desired_spec_code_spec.rb +42 -0
- data/spec/models/list_functions200_response_data_items_inner_desired_spec_spec.rb +98 -0
- data/spec/models/list_functions200_response_data_items_inner_spec.rb +96 -0
- data/spec/models/list_functions200_response_data_spec.rb +42 -0
- data/spec/models/list_functions200_response_error_spec.rb +48 -0
- data/spec/models/list_functions200_response_spec.rb +48 -0
- data/spec/models/list_functions401_response_spec.rb +42 -0
- data/spec/models/list_kv_items200_response_data_items_inner_spec.rb +54 -0
- data/spec/models/list_kv_items200_response_data_spec.rb +42 -0
- data/spec/models/list_kv_items200_response_spec.rb +48 -0
- data/spec/models/list_queues200_response_data_items_inner_delivery_target_spec.rb +70 -0
- data/spec/models/list_queues200_response_data_items_inner_spec.rb +90 -0
- data/spec/models/list_queues200_response_data_spec.rb +42 -0
- data/spec/models/list_queues200_response_spec.rb +48 -0
- data/spec/models/list_schedules200_response_data_items_inner_spec.rb +90 -0
- data/spec/models/list_schedules200_response_data_spec.rb +42 -0
- data/spec/models/list_schedules200_response_spec.rb +48 -0
- data/spec/models/list_snippets200_response_data_inner_spec.rb +66 -0
- data/spec/models/list_snippets200_response_spec.rb +48 -0
- data/spec/models/list_storage_objects200_response_data_items_inner_spec.rb +66 -0
- data/spec/models/list_storage_objects200_response_data_spec.rb +42 -0
- data/spec/models/list_storage_objects200_response_spec.rb +48 -0
- data/spec/models/list_templates200_response_data_inner_spec.rb +66 -0
- data/spec/models/list_templates200_response_spec.rb +48 -0
- data/spec/models/put_kv_item200_response_data_spec.rb +48 -0
- data/spec/models/put_kv_item200_response_spec.rb +48 -0
- data/spec/models/put_kv_item_request_if_version_spec.rb +21 -0
- data/spec/models/put_kv_item_request_spec.rb +54 -0
- data/spec/models/update_cron_job200_response_data_spec.rb +48 -0
- data/spec/models/update_cron_job200_response_spec.rb +48 -0
- data/spec/models/update_cron_job_request_schedule_spec.rb +52 -0
- data/spec/models/update_cron_job_request_spec.rb +54 -0
- data/spec/models/update_function_request_spec.rb +76 -0
- data/spec/models/update_queue200_response_data_spec.rb +48 -0
- data/spec/models/update_queue200_response_spec.rb +48 -0
- data/spec/models/update_queue_request_spec.rb +54 -0
- data/spec/models/update_schedule200_response_data_spec.rb +48 -0
- data/spec/models/update_schedule200_response_spec.rb +48 -0
- data/spec/models/update_schedule_request_spec.rb +54 -0
- data/spec/models/upload_object201_response_data_spec.rb +60 -0
- data/spec/models/upload_object201_response_spec.rb +48 -0
- data/spec/spec_helper.rb +111 -0
- metadata +472 -0
|
@@ -0,0 +1,536 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Rocketstack API
|
|
3
|
+
|
|
4
|
+
#API for Functions, Queues, KV, Storage, Cron, and Scheduler.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module RocketStackSdk
|
|
16
|
+
class FunctionsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create a new function
|
|
23
|
+
# Creates a new function and uploads its code bundle in a single request.
|
|
24
|
+
# @param name [String] Function name. Must start with a letter and contain only alphanumeric characters, hyphens, and underscores.
|
|
25
|
+
# @param runtime [String] Runtime for the function.
|
|
26
|
+
# @param handler [String] Handler entrypoint (e.g. index.handler).
|
|
27
|
+
# @param code [File] ZIP file containing function code.
|
|
28
|
+
# @param [Hash] opts the optional parameters
|
|
29
|
+
# @option opts [Integer] :memory_mb Memory in MB. Default 256.
|
|
30
|
+
# @option opts [Integer] :timeout_seconds Timeout in seconds. Default 10.
|
|
31
|
+
# @option opts [String] :env JSON object of env vars, e.g. {\\\"KEY\\\":\\\"value\\\"}.
|
|
32
|
+
# @option opts [Integer] :reserved_concurrency Concurrency cap. null = unreserved, 0 = paused, 1-100 = cap.
|
|
33
|
+
# @option opts [String] :description Optional description.
|
|
34
|
+
# @option opts [String] :is_public Set to \\\"true\\\" to make the function publicly invokable.
|
|
35
|
+
# @option opts [String] :public_method HTTP method accepted for public invocation (only applies when isPublic is true).
|
|
36
|
+
# @return [CreateFunction202Response]
|
|
37
|
+
def create_function(name, runtime, handler, code, opts = {})
|
|
38
|
+
data, _status_code, _headers = create_function_with_http_info(name, runtime, handler, code, opts)
|
|
39
|
+
data
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Create a new function
|
|
43
|
+
# Creates a new function and uploads its code bundle in a single request.
|
|
44
|
+
# @param name [String] Function name. Must start with a letter and contain only alphanumeric characters, hyphens, and underscores.
|
|
45
|
+
# @param runtime [String] Runtime for the function.
|
|
46
|
+
# @param handler [String] Handler entrypoint (e.g. index.handler).
|
|
47
|
+
# @param code [File] ZIP file containing function code.
|
|
48
|
+
# @param [Hash] opts the optional parameters
|
|
49
|
+
# @option opts [Integer] :memory_mb Memory in MB. Default 256.
|
|
50
|
+
# @option opts [Integer] :timeout_seconds Timeout in seconds. Default 10.
|
|
51
|
+
# @option opts [String] :env JSON object of env vars, e.g. {\\\"KEY\\\":\\\"value\\\"}.
|
|
52
|
+
# @option opts [Integer] :reserved_concurrency Concurrency cap. null = unreserved, 0 = paused, 1-100 = cap.
|
|
53
|
+
# @option opts [String] :description Optional description.
|
|
54
|
+
# @option opts [String] :is_public Set to \\\"true\\\" to make the function publicly invokable.
|
|
55
|
+
# @option opts [String] :public_method HTTP method accepted for public invocation (only applies when isPublic is true).
|
|
56
|
+
# @return [Array<(CreateFunction202Response, Integer, Hash)>] CreateFunction202Response data, response status code and response headers
|
|
57
|
+
def create_function_with_http_info(name, runtime, handler, code, opts = {})
|
|
58
|
+
if @api_client.config.debugging
|
|
59
|
+
@api_client.config.logger.debug 'Calling API: FunctionsApi.create_function ...'
|
|
60
|
+
end
|
|
61
|
+
# verify the required parameter 'name' is set
|
|
62
|
+
if @api_client.config.client_side_validation && name.nil?
|
|
63
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling FunctionsApi.create_function"
|
|
64
|
+
end
|
|
65
|
+
if @api_client.config.client_side_validation && name.to_s.length > 64
|
|
66
|
+
fail ArgumentError, 'invalid value for "name" when calling FunctionsApi.create_function, the character length must be smaller than or equal to 64.'
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
if @api_client.config.client_side_validation && name.to_s.length < 1
|
|
70
|
+
fail ArgumentError, 'invalid value for "name" when calling FunctionsApi.create_function, the character length must be greater than or equal to 1.'
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
pattern = Regexp.new(/^[a-zA-Z][a-zA-Z0-9-_]*$/)
|
|
74
|
+
if @api_client.config.client_side_validation && name !~ pattern
|
|
75
|
+
fail ArgumentError, "invalid value for 'name' when calling FunctionsApi.create_function, must conform to the pattern #{pattern}."
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# verify the required parameter 'runtime' is set
|
|
79
|
+
if @api_client.config.client_side_validation && runtime.nil?
|
|
80
|
+
fail ArgumentError, "Missing the required parameter 'runtime' when calling FunctionsApi.create_function"
|
|
81
|
+
end
|
|
82
|
+
# verify enum value
|
|
83
|
+
allowable_values = ["nodejs20.x", "python3.12"]
|
|
84
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(runtime)
|
|
85
|
+
fail ArgumentError, "invalid value for \"runtime\", must be one of #{allowable_values}"
|
|
86
|
+
end
|
|
87
|
+
# verify the required parameter 'handler' is set
|
|
88
|
+
if @api_client.config.client_side_validation && handler.nil?
|
|
89
|
+
fail ArgumentError, "Missing the required parameter 'handler' when calling FunctionsApi.create_function"
|
|
90
|
+
end
|
|
91
|
+
if @api_client.config.client_side_validation && handler.to_s.length < 1
|
|
92
|
+
fail ArgumentError, 'invalid value for "handler" when calling FunctionsApi.create_function, the character length must be greater than or equal to 1.'
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# verify the required parameter 'code' is set
|
|
96
|
+
if @api_client.config.client_side_validation && code.nil?
|
|
97
|
+
fail ArgumentError, "Missing the required parameter 'code' when calling FunctionsApi.create_function"
|
|
98
|
+
end
|
|
99
|
+
if @api_client.config.client_side_validation && !opts[:'memory_mb'].nil? && opts[:'memory_mb'] > 10240
|
|
100
|
+
fail ArgumentError, 'invalid value for "opts[:"memory_mb"]" when calling FunctionsApi.create_function, must be smaller than or equal to 10240.'
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if @api_client.config.client_side_validation && !opts[:'memory_mb'].nil? && opts[:'memory_mb'] < 128
|
|
104
|
+
fail ArgumentError, 'invalid value for "opts[:"memory_mb"]" when calling FunctionsApi.create_function, must be greater than or equal to 128.'
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if @api_client.config.client_side_validation && !opts[:'timeout_seconds'].nil? && opts[:'timeout_seconds'] > 60
|
|
108
|
+
fail ArgumentError, 'invalid value for "opts[:"timeout_seconds"]" when calling FunctionsApi.create_function, must be smaller than or equal to 60.'
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if @api_client.config.client_side_validation && !opts[:'timeout_seconds'].nil? && opts[:'timeout_seconds'] < 1
|
|
112
|
+
fail ArgumentError, 'invalid value for "opts[:"timeout_seconds"]" when calling FunctionsApi.create_function, must be greater than or equal to 1.'
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if @api_client.config.client_side_validation && !opts[:'reserved_concurrency'].nil? && opts[:'reserved_concurrency'] > 100
|
|
116
|
+
fail ArgumentError, 'invalid value for "opts[:"reserved_concurrency"]" when calling FunctionsApi.create_function, must be smaller than or equal to 100.'
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if @api_client.config.client_side_validation && !opts[:'reserved_concurrency'].nil? && opts[:'reserved_concurrency'] < 0
|
|
120
|
+
fail ArgumentError, 'invalid value for "opts[:"reserved_concurrency"]" when calling FunctionsApi.create_function, must be greater than or equal to 0.'
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if @api_client.config.client_side_validation && !opts[:'description'].nil? && opts[:'description'].to_s.length > 256
|
|
124
|
+
fail ArgumentError, 'invalid value for "opts[:"description"]" when calling FunctionsApi.create_function, the character length must be smaller than or equal to 256.'
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
allowable_values = ["GET", "POST", "PATCH", "DELETE"]
|
|
128
|
+
if @api_client.config.client_side_validation && opts[:'public_method'] && !allowable_values.include?(opts[:'public_method'])
|
|
129
|
+
fail ArgumentError, "invalid value for \"public_method\", must be one of #{allowable_values}"
|
|
130
|
+
end
|
|
131
|
+
# resource path
|
|
132
|
+
local_var_path = '/functions'
|
|
133
|
+
|
|
134
|
+
# query parameters
|
|
135
|
+
query_params = opts[:query_params] || {}
|
|
136
|
+
|
|
137
|
+
# header parameters
|
|
138
|
+
header_params = opts[:header_params] || {}
|
|
139
|
+
# HTTP header 'Accept' (if needed)
|
|
140
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
141
|
+
# HTTP header 'Content-Type'
|
|
142
|
+
content_type = @api_client.select_header_content_type(['multipart/form-data'])
|
|
143
|
+
if !content_type.nil?
|
|
144
|
+
header_params['Content-Type'] = content_type
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# form parameters
|
|
148
|
+
form_params = opts[:form_params] || {}
|
|
149
|
+
form_params['name'] = name
|
|
150
|
+
form_params['runtime'] = runtime
|
|
151
|
+
form_params['handler'] = handler
|
|
152
|
+
form_params['code'] = code
|
|
153
|
+
form_params['memoryMb'] = opts[:'memory_mb'] if !opts[:'memory_mb'].nil?
|
|
154
|
+
form_params['timeoutSeconds'] = opts[:'timeout_seconds'] if !opts[:'timeout_seconds'].nil?
|
|
155
|
+
form_params['env'] = opts[:'env'] if !opts[:'env'].nil?
|
|
156
|
+
form_params['reservedConcurrency'] = opts[:'reserved_concurrency'] if !opts[:'reserved_concurrency'].nil?
|
|
157
|
+
form_params['description'] = opts[:'description'] if !opts[:'description'].nil?
|
|
158
|
+
form_params['isPublic'] = opts[:'is_public'] if !opts[:'is_public'].nil?
|
|
159
|
+
form_params['publicMethod'] = opts[:'public_method'] if !opts[:'public_method'].nil?
|
|
160
|
+
|
|
161
|
+
# http body (model)
|
|
162
|
+
post_body = opts[:debug_body]
|
|
163
|
+
|
|
164
|
+
# return_type
|
|
165
|
+
return_type = opts[:debug_return_type] || 'CreateFunction202Response'
|
|
166
|
+
|
|
167
|
+
# auth_names
|
|
168
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
169
|
+
|
|
170
|
+
new_options = opts.merge(
|
|
171
|
+
:operation => :"FunctionsApi.create_function",
|
|
172
|
+
:header_params => header_params,
|
|
173
|
+
:query_params => query_params,
|
|
174
|
+
:form_params => form_params,
|
|
175
|
+
:body => post_body,
|
|
176
|
+
:auth_names => auth_names,
|
|
177
|
+
:return_type => return_type
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
181
|
+
if @api_client.config.debugging
|
|
182
|
+
@api_client.config.logger.debug "API called: FunctionsApi#create_function\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
183
|
+
end
|
|
184
|
+
return data, status_code, headers
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Get a function by ID
|
|
188
|
+
# Retrieves details of a specific function including its configuration and status.
|
|
189
|
+
# @param id [String]
|
|
190
|
+
# @param [Hash] opts the optional parameters
|
|
191
|
+
# @return [GetFunction200Response]
|
|
192
|
+
def get_function(id, opts = {})
|
|
193
|
+
data, _status_code, _headers = get_function_with_http_info(id, opts)
|
|
194
|
+
data
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Get a function by ID
|
|
198
|
+
# Retrieves details of a specific function including its configuration and status.
|
|
199
|
+
# @param id [String]
|
|
200
|
+
# @param [Hash] opts the optional parameters
|
|
201
|
+
# @return [Array<(GetFunction200Response, Integer, Hash)>] GetFunction200Response data, response status code and response headers
|
|
202
|
+
def get_function_with_http_info(id, opts = {})
|
|
203
|
+
if @api_client.config.debugging
|
|
204
|
+
@api_client.config.logger.debug 'Calling API: FunctionsApi.get_function ...'
|
|
205
|
+
end
|
|
206
|
+
# verify the required parameter 'id' is set
|
|
207
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
208
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling FunctionsApi.get_function"
|
|
209
|
+
end
|
|
210
|
+
# resource path
|
|
211
|
+
local_var_path = '/functions/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
212
|
+
|
|
213
|
+
# query parameters
|
|
214
|
+
query_params = opts[:query_params] || {}
|
|
215
|
+
|
|
216
|
+
# header parameters
|
|
217
|
+
header_params = opts[:header_params] || {}
|
|
218
|
+
# HTTP header 'Accept' (if needed)
|
|
219
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
220
|
+
|
|
221
|
+
# form parameters
|
|
222
|
+
form_params = opts[:form_params] || {}
|
|
223
|
+
|
|
224
|
+
# http body (model)
|
|
225
|
+
post_body = opts[:debug_body]
|
|
226
|
+
|
|
227
|
+
# return_type
|
|
228
|
+
return_type = opts[:debug_return_type] || 'GetFunction200Response'
|
|
229
|
+
|
|
230
|
+
# auth_names
|
|
231
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
232
|
+
|
|
233
|
+
new_options = opts.merge(
|
|
234
|
+
:operation => :"FunctionsApi.get_function",
|
|
235
|
+
:header_params => header_params,
|
|
236
|
+
:query_params => query_params,
|
|
237
|
+
:form_params => form_params,
|
|
238
|
+
:body => post_body,
|
|
239
|
+
:auth_names => auth_names,
|
|
240
|
+
:return_type => return_type
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
244
|
+
if @api_client.config.debugging
|
|
245
|
+
@api_client.config.logger.debug "API called: FunctionsApi#get_function\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
246
|
+
end
|
|
247
|
+
return data, status_code, headers
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Invoke a function
|
|
251
|
+
# Synchronously or asynchronously invokes a deployed function with the provided payload.
|
|
252
|
+
# @param id [String]
|
|
253
|
+
# @param [Hash] opts the optional parameters
|
|
254
|
+
# @option opts [InvokeFunctionRequest] :invoke_function_request
|
|
255
|
+
# @return [InvokeFunction200Response]
|
|
256
|
+
def invoke_function(id, opts = {})
|
|
257
|
+
data, _status_code, _headers = invoke_function_with_http_info(id, opts)
|
|
258
|
+
data
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# Invoke a function
|
|
262
|
+
# Synchronously or asynchronously invokes a deployed function with the provided payload.
|
|
263
|
+
# @param id [String]
|
|
264
|
+
# @param [Hash] opts the optional parameters
|
|
265
|
+
# @option opts [InvokeFunctionRequest] :invoke_function_request
|
|
266
|
+
# @return [Array<(InvokeFunction200Response, Integer, Hash)>] InvokeFunction200Response data, response status code and response headers
|
|
267
|
+
def invoke_function_with_http_info(id, opts = {})
|
|
268
|
+
if @api_client.config.debugging
|
|
269
|
+
@api_client.config.logger.debug 'Calling API: FunctionsApi.invoke_function ...'
|
|
270
|
+
end
|
|
271
|
+
# verify the required parameter 'id' is set
|
|
272
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
273
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling FunctionsApi.invoke_function"
|
|
274
|
+
end
|
|
275
|
+
# resource path
|
|
276
|
+
local_var_path = '/functions/{id}/invoke'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
277
|
+
|
|
278
|
+
# query parameters
|
|
279
|
+
query_params = opts[:query_params] || {}
|
|
280
|
+
|
|
281
|
+
# header parameters
|
|
282
|
+
header_params = opts[:header_params] || {}
|
|
283
|
+
# HTTP header 'Accept' (if needed)
|
|
284
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
285
|
+
# HTTP header 'Content-Type'
|
|
286
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
287
|
+
if !content_type.nil?
|
|
288
|
+
header_params['Content-Type'] = content_type
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# form parameters
|
|
292
|
+
form_params = opts[:form_params] || {}
|
|
293
|
+
|
|
294
|
+
# http body (model)
|
|
295
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'invoke_function_request'])
|
|
296
|
+
|
|
297
|
+
# return_type
|
|
298
|
+
return_type = opts[:debug_return_type] || 'InvokeFunction200Response'
|
|
299
|
+
|
|
300
|
+
# auth_names
|
|
301
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
302
|
+
|
|
303
|
+
new_options = opts.merge(
|
|
304
|
+
:operation => :"FunctionsApi.invoke_function",
|
|
305
|
+
:header_params => header_params,
|
|
306
|
+
:query_params => query_params,
|
|
307
|
+
:form_params => form_params,
|
|
308
|
+
:body => post_body,
|
|
309
|
+
:auth_names => auth_names,
|
|
310
|
+
:return_type => return_type
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
314
|
+
if @api_client.config.debugging
|
|
315
|
+
@api_client.config.logger.debug "API called: FunctionsApi#invoke_function\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
316
|
+
end
|
|
317
|
+
return data, status_code, headers
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
# List functions
|
|
321
|
+
# Returns a paginated list of functions for the tenant.
|
|
322
|
+
# @param [Hash] opts the optional parameters
|
|
323
|
+
# @option opts [Float] :limit (default to 50)
|
|
324
|
+
# @option opts [String] :cursor
|
|
325
|
+
# @return [ListFunctions200Response]
|
|
326
|
+
def list_functions(opts = {})
|
|
327
|
+
data, _status_code, _headers = list_functions_with_http_info(opts)
|
|
328
|
+
data
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
# List functions
|
|
332
|
+
# Returns a paginated list of functions for the tenant.
|
|
333
|
+
# @param [Hash] opts the optional parameters
|
|
334
|
+
# @option opts [Float] :limit (default to 50)
|
|
335
|
+
# @option opts [String] :cursor
|
|
336
|
+
# @return [Array<(ListFunctions200Response, Integer, Hash)>] ListFunctions200Response data, response status code and response headers
|
|
337
|
+
def list_functions_with_http_info(opts = {})
|
|
338
|
+
if @api_client.config.debugging
|
|
339
|
+
@api_client.config.logger.debug 'Calling API: FunctionsApi.list_functions ...'
|
|
340
|
+
end
|
|
341
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
342
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling FunctionsApi.list_functions, must be smaller than or equal to 100.'
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
346
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling FunctionsApi.list_functions, must be greater than or equal to 1.'
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
# resource path
|
|
350
|
+
local_var_path = '/functions'
|
|
351
|
+
|
|
352
|
+
# query parameters
|
|
353
|
+
query_params = opts[:query_params] || {}
|
|
354
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
355
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
|
356
|
+
|
|
357
|
+
# header parameters
|
|
358
|
+
header_params = opts[:header_params] || {}
|
|
359
|
+
# HTTP header 'Accept' (if needed)
|
|
360
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
361
|
+
|
|
362
|
+
# form parameters
|
|
363
|
+
form_params = opts[:form_params] || {}
|
|
364
|
+
|
|
365
|
+
# http body (model)
|
|
366
|
+
post_body = opts[:debug_body]
|
|
367
|
+
|
|
368
|
+
# return_type
|
|
369
|
+
return_type = opts[:debug_return_type] || 'ListFunctions200Response'
|
|
370
|
+
|
|
371
|
+
# auth_names
|
|
372
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
373
|
+
|
|
374
|
+
new_options = opts.merge(
|
|
375
|
+
:operation => :"FunctionsApi.list_functions",
|
|
376
|
+
:header_params => header_params,
|
|
377
|
+
:query_params => query_params,
|
|
378
|
+
:form_params => form_params,
|
|
379
|
+
:body => post_body,
|
|
380
|
+
:auth_names => auth_names,
|
|
381
|
+
:return_type => return_type
|
|
382
|
+
)
|
|
383
|
+
|
|
384
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
385
|
+
if @api_client.config.debugging
|
|
386
|
+
@api_client.config.logger.debug "API called: FunctionsApi#list_functions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
387
|
+
end
|
|
388
|
+
return data, status_code, headers
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
# Update function settings
|
|
392
|
+
# Updates function configuration (memory, timeout, env, isPublic, etc.). Does not trigger redeployment.
|
|
393
|
+
# @param id [String]
|
|
394
|
+
# @param [Hash] opts the optional parameters
|
|
395
|
+
# @option opts [UpdateFunctionRequest] :update_function_request
|
|
396
|
+
# @return [GetFunction200Response]
|
|
397
|
+
def update_function(id, opts = {})
|
|
398
|
+
data, _status_code, _headers = update_function_with_http_info(id, opts)
|
|
399
|
+
data
|
|
400
|
+
end
|
|
401
|
+
|
|
402
|
+
# Update function settings
|
|
403
|
+
# Updates function configuration (memory, timeout, env, isPublic, etc.). Does not trigger redeployment.
|
|
404
|
+
# @param id [String]
|
|
405
|
+
# @param [Hash] opts the optional parameters
|
|
406
|
+
# @option opts [UpdateFunctionRequest] :update_function_request
|
|
407
|
+
# @return [Array<(GetFunction200Response, Integer, Hash)>] GetFunction200Response data, response status code and response headers
|
|
408
|
+
def update_function_with_http_info(id, opts = {})
|
|
409
|
+
if @api_client.config.debugging
|
|
410
|
+
@api_client.config.logger.debug 'Calling API: FunctionsApi.update_function ...'
|
|
411
|
+
end
|
|
412
|
+
# verify the required parameter 'id' is set
|
|
413
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
414
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling FunctionsApi.update_function"
|
|
415
|
+
end
|
|
416
|
+
# resource path
|
|
417
|
+
local_var_path = '/functions/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
418
|
+
|
|
419
|
+
# query parameters
|
|
420
|
+
query_params = opts[:query_params] || {}
|
|
421
|
+
|
|
422
|
+
# header parameters
|
|
423
|
+
header_params = opts[:header_params] || {}
|
|
424
|
+
# HTTP header 'Accept' (if needed)
|
|
425
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
426
|
+
# HTTP header 'Content-Type'
|
|
427
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
428
|
+
if !content_type.nil?
|
|
429
|
+
header_params['Content-Type'] = content_type
|
|
430
|
+
end
|
|
431
|
+
|
|
432
|
+
# form parameters
|
|
433
|
+
form_params = opts[:form_params] || {}
|
|
434
|
+
|
|
435
|
+
# http body (model)
|
|
436
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_function_request'])
|
|
437
|
+
|
|
438
|
+
# return_type
|
|
439
|
+
return_type = opts[:debug_return_type] || 'GetFunction200Response'
|
|
440
|
+
|
|
441
|
+
# auth_names
|
|
442
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
443
|
+
|
|
444
|
+
new_options = opts.merge(
|
|
445
|
+
:operation => :"FunctionsApi.update_function",
|
|
446
|
+
:header_params => header_params,
|
|
447
|
+
:query_params => query_params,
|
|
448
|
+
:form_params => form_params,
|
|
449
|
+
:body => post_body,
|
|
450
|
+
:auth_names => auth_names,
|
|
451
|
+
:return_type => return_type
|
|
452
|
+
)
|
|
453
|
+
|
|
454
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
455
|
+
if @api_client.config.debugging
|
|
456
|
+
@api_client.config.logger.debug "API called: FunctionsApi#update_function\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
457
|
+
end
|
|
458
|
+
return data, status_code, headers
|
|
459
|
+
end
|
|
460
|
+
|
|
461
|
+
# Update function code
|
|
462
|
+
# Uploads and deploys a new function code bundle in a single request.
|
|
463
|
+
# @param id [String]
|
|
464
|
+
# @param code [File] ZIP file containing function code.
|
|
465
|
+
# @param [Hash] opts the optional parameters
|
|
466
|
+
# @return [CreateFunction202Response]
|
|
467
|
+
def update_function_code(id, code, opts = {})
|
|
468
|
+
data, _status_code, _headers = update_function_code_with_http_info(id, code, opts)
|
|
469
|
+
data
|
|
470
|
+
end
|
|
471
|
+
|
|
472
|
+
# Update function code
|
|
473
|
+
# Uploads and deploys a new function code bundle in a single request.
|
|
474
|
+
# @param id [String]
|
|
475
|
+
# @param code [File] ZIP file containing function code.
|
|
476
|
+
# @param [Hash] opts the optional parameters
|
|
477
|
+
# @return [Array<(CreateFunction202Response, Integer, Hash)>] CreateFunction202Response data, response status code and response headers
|
|
478
|
+
def update_function_code_with_http_info(id, code, opts = {})
|
|
479
|
+
if @api_client.config.debugging
|
|
480
|
+
@api_client.config.logger.debug 'Calling API: FunctionsApi.update_function_code ...'
|
|
481
|
+
end
|
|
482
|
+
# verify the required parameter 'id' is set
|
|
483
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
484
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling FunctionsApi.update_function_code"
|
|
485
|
+
end
|
|
486
|
+
# verify the required parameter 'code' is set
|
|
487
|
+
if @api_client.config.client_side_validation && code.nil?
|
|
488
|
+
fail ArgumentError, "Missing the required parameter 'code' when calling FunctionsApi.update_function_code"
|
|
489
|
+
end
|
|
490
|
+
# resource path
|
|
491
|
+
local_var_path = '/functions/{id}/code'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
492
|
+
|
|
493
|
+
# query parameters
|
|
494
|
+
query_params = opts[:query_params] || {}
|
|
495
|
+
|
|
496
|
+
# header parameters
|
|
497
|
+
header_params = opts[:header_params] || {}
|
|
498
|
+
# HTTP header 'Accept' (if needed)
|
|
499
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
500
|
+
# HTTP header 'Content-Type'
|
|
501
|
+
content_type = @api_client.select_header_content_type(['multipart/form-data'])
|
|
502
|
+
if !content_type.nil?
|
|
503
|
+
header_params['Content-Type'] = content_type
|
|
504
|
+
end
|
|
505
|
+
|
|
506
|
+
# form parameters
|
|
507
|
+
form_params = opts[:form_params] || {}
|
|
508
|
+
form_params['code'] = code
|
|
509
|
+
|
|
510
|
+
# http body (model)
|
|
511
|
+
post_body = opts[:debug_body]
|
|
512
|
+
|
|
513
|
+
# return_type
|
|
514
|
+
return_type = opts[:debug_return_type] || 'CreateFunction202Response'
|
|
515
|
+
|
|
516
|
+
# auth_names
|
|
517
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
518
|
+
|
|
519
|
+
new_options = opts.merge(
|
|
520
|
+
:operation => :"FunctionsApi.update_function_code",
|
|
521
|
+
:header_params => header_params,
|
|
522
|
+
:query_params => query_params,
|
|
523
|
+
:form_params => form_params,
|
|
524
|
+
:body => post_body,
|
|
525
|
+
:auth_names => auth_names,
|
|
526
|
+
:return_type => return_type
|
|
527
|
+
)
|
|
528
|
+
|
|
529
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
530
|
+
if @api_client.config.debugging
|
|
531
|
+
@api_client.config.logger.debug "API called: FunctionsApi#update_function_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
532
|
+
end
|
|
533
|
+
return data, status_code, headers
|
|
534
|
+
end
|
|
535
|
+
end
|
|
536
|
+
end
|